{"modulePath":"github.com/chainopen/matrixchaincode","version":"v0.0.0-20190924071332-ddf2b42e220f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package params\n\nCopyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)\n\n## Constants\n\n```go\nconst (\n\t// These are the multipliers for man denominations.\n\t// Example: To get the wei value of an amount in 'douglas', use\n\t//\n\t//    new(big.Int).Mul(value, big.NewInt(params.Douglas))\n\t//\n\tWei      = 1\n\tAda      = 1e3\n\tBabbage  = 1e6\n\tShannon  = 1e9\n\tSzabo    = 1e12\n\tFinney   = 1e15\n\tManer    = 1e18\n\tEinstein = 1e21\n\tDouglas  = 1e42\n)\n```\n\n```go\nconst (\n\tGasLimitBoundDivisor  uint64 = 1024                          // The bound divisor of the gas limit, used in update calculations.\n\tMinGasLimit           uint64 = 1050000000                    // Minimum the gas limit may ever be.\n\tGenesisGasLimit       uint64 = 1050000000                    // Gas limit of the Genesis block.\n\tOtherCoinPackNum      uint64 = GenesisGasLimit / 21000 / 100 //其他币种打包限制为MAN的1/100\n\tMaximumExtraDataSize  uint64 = 32                            // Maximum size extra data may be after Genesis.\n\tExpByteGas            uint64 = 10                            // Times ceil(log256(exponent)) for the EXP instruction.\n\tSloadGas              uint64 = 50                            // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added.\n\tCallValueTransferGas  uint64 = 9000                          // Paid for CALL when the value transfer is non-zero.\n\tCallNewAccountGas     uint64 = 25000                         // Paid for CALL when the destination address didn't exist prior.\n\tTxGas                 uint64 = 21000                         // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions.\n\tTxGasContractCreation uint64 = 53000                         // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions.\n\tTxDataZeroGas         uint64 = 4                             // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions.\n\tQuadCoeffDiv          uint64 = 512                           // Divisor for the quadratic particle of the memory cost equation.\n\tSstoreSetGas          uint64 = 20000                         // Once per SLOAD operation.\n\tLogDataGas            uint64 = 8                             // Per byte in a LOG* operation's data.\n\tCallStipend           uint64 = 2300                          // Free gas given at beginning of call.\n\n\tSha3Gas          uint64 = 30    // Once per SHA3 operation.\n\tSha3WordGas      uint64 = 6     // Once per word of the SHA3 operation's data.\n\tSstoreResetGas   uint64 = 5000  // Once per SSTORE operation if the zeroness changes from zero.\n\tSstoreClearGas   uint64 = 5000  // Once per SSTORE operation if the zeroness doesn't change.\n\tSstoreRefundGas  uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero.\n\tJumpdestGas      uint64 = 1     // Refunded gas, once per SSTORE operation if the zeroness changes to zero.\n\tEpochDuration    uint64 = 30000 // Duration between proof-of-work epochs.\n\tCallGas          uint64 = 40    // Once per CALL operation \u0026 message call transaction.\n\tCreateDataGas    uint64 = 200   //\n\tCallCreateDepth  uint64 = 1024  // Maximum depth of call/create stack.\n\tExpGas           uint64 = 10    // Once per EXP instruction\n\tLogGas           uint64 = 375   // Per LOG* operation.\n\tCopyGas          uint64 = 3     //\n\tStackLimit       uint64 = 1024  // Maximum size of VM stack allowed.\n\tTierStepGas      uint64 = 0     // Once per operation, for a selection of them.\n\tLogTopicGas      uint64 = 375   // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas.\n\tCreateGas        uint64 = 32000 // Once per CREATE operation \u0026 contract-creation transaction.\n\tSuicideRefundGas uint64 = 24000 // Refunded following a suicide operation.\n\tMemoryGas        uint64 = 3     // Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL.\n\tTxDataNonZeroGas uint64 = 68    // Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions.\n\n\tMaxCodeSize = 24576 // Maximum bytecode to permit for a contract\n\n\tEcrecoverGas            uint64 = 3000   // Elliptic curve sender recovery gas price\n\tSha256BaseGas           uint64 = 60     // Base price for a SHA256 operation\n\tSha256PerWordGas        uint64 = 12     // Per-word price for a SHA256 operation\n\tRipemd160BaseGas        uint64 = 600    // Base price for a RIPEMD160 operation\n\tRipemd160PerWordGas     uint64 = 120    // Per-word price for a RIPEMD160 operation\n\tIdentityBaseGas         uint64 = 15     // Base price for a data copy operation\n\tIdentityPerWordGas      uint64 = 3      // Per-work price for a data copy operation\n\tModExpQuadCoeffDiv      uint64 = 20     // Divisor for the quadratic particle of the big int modular exponentiation\n\tBn256AddGas             uint64 = 500    // Gas needed for an elliptic curve addition\n\tBn256ScalarMulGas       uint64 = 40000  // Gas needed for an elliptic curve scalar multiplication\n\tBn256PairingBaseGas     uint64 = 100000 // Base price for an elliptic curve pairing check\n\tBn256PairingPerPointGas uint64 = 80000  // Per-point price for an elliptic curve pairing check\n\n\t//\n\tTxCount              uint64 = 1000                //一对多交易最多可以支持1000笔(包括扩展之外的那一个交易)\n\tErrTxConsensus       uint64 = 6                   //错误交易需要共识的个数（超过6个节点认为该笔交易错误就可以确认删除这笔交易）\n\tSubBlockNum          uint64 = 200                 //超过SubBlockNum区块高度就删除某些东西（超过20个区块就删除未打包的交易）\n\tNonceAddOne          uint64 = 0x0010000000000000  //Nonce最高位加1\n\tNonceSubOne          uint64 = 0x0001FFFFFFFFFFFF  //Nonce最高位减1\n\tMaxTxN               uint32 = 0x1FFFF             //交易编号最大值\n\tFloodMaxTransactions int    = 200                 //洪泛交易数量阈值\n\tTxSize               uint64 = 32 * 1024           //交易的大小\n\tTxGasPrice           uint64 = 18000000000         //交易费\n\tEntrustByHeight      byte   = 0                   //按块高委托\n\tEntrustByTime        byte   = 1                   //按时间委托\n\tEntrustByCount       byte   = 2                   //按次数委托\n\tCallTxPachNum        uint64 = 9999                //币种打包交易数量限制\n\tCoinTypeUnit         uint64 = 1000000000000000000 //*big.Int = new(big.Int).SetString(\"0xDE0B6B3A7640000\",0)//new(big.Int).SetString(\"0xDE0B6B3A7640000\",0)\n\tCoinDampingNum       int    = 100                 //每100个币种衰减百分之五\n\n\t// Udp buffer\n\tMaxUdpBuf uint32 = 1024 * 64\n)\n```\n\n```go\nconst (\n\tMAN_COIN     string = \"MAN\"\n\tRANGE_MOUNTS int    = 256\n\tCOIN_NAME    string = \"COIN_TYPE\"\n\t//COINPREFIX   string = \"MATRIX\"\n\tDestroyBalance string = \"100000000000000000000000\" //创建币种需要的最小转账余额,十万MAN\n)\n```\n\n```go\nconst (\n\tVersionMajor = 1        // Major version component of the current release\n\tVersionMinor = 1        // Minor version component of the current release\n\tVersionPatch = 0        // Patch version component of the current release\n\tVersionMeta  = \"stable\" // Version metadata to append to the version string\n)\n```\n\n```go\nconst (\n\t// BloomBitsBlocks is the number of blocks a single bloom bit section vector\n\t// contains.\n\tBloomBitsBlocks uint64 = 4096\n)\n```\n\n## Variables\n\n```go\nvar (\n\tMainnetGenesisHash = common.HexToHash(\"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3\") // Mainnet genesis hash to enforce below configs on\n\tTestnetGenesisHash = common.HexToHash(\"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d\") // Testnet genesis hash to enforce below configs on\n)\n```\n\n```go\nvar (\n\t// MainnetChainConfig is the chain parameters to run a node on the main network.\n\tMainnetChainConfig = \u0026ChainConfig{\n\t\tChainId:             big.NewInt(1),\n\t\tHomesteadBlock:      big.NewInt(1150000),\n\t\tDAOForkBlock:        big.NewInt(1920000),\n\t\tDAOForkSupport:      true,\n\t\tEIP150Block:         big.NewInt(2463000),\n\t\tEIP150Hash:          common.HexToHash(\"0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0\"),\n\t\tEIP155Block:         big.NewInt(2675000),\n\t\tEIP158Block:         big.NewInt(2675000),\n\t\tByzantiumBlock:      big.NewInt(4370000),\n\t\tConstantinopleBlock: nil,\n\t\tManash:              new(ManashConfig),\n\t}\n\n\t// TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network.\n\tTestnetChainConfig = \u0026ChainConfig{\n\t\tChainId:             big.NewInt(3),\n\t\tHomesteadBlock:      big.NewInt(0),\n\t\tDAOForkBlock:        nil,\n\t\tDAOForkSupport:      true,\n\t\tEIP150Block:         big.NewInt(0),\n\t\tEIP150Hash:          common.HexToHash(\"0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d\"),\n\t\tEIP155Block:         big.NewInt(10),\n\t\tEIP158Block:         big.NewInt(10),\n\t\tByzantiumBlock:      big.NewInt(1700000),\n\t\tConstantinopleBlock: nil,\n\t\tManash:              new(ManashConfig),\n\t}\n\n\t// RinkebyChainConfig contains the chain parameters to run a node on the Rinkeby test network.\n\tRinkebyChainConfig = \u0026ChainConfig{\n\t\tChainId:             big.NewInt(4),\n\t\tHomesteadBlock:      big.NewInt(1),\n\t\tDAOForkBlock:        nil,\n\t\tDAOForkSupport:      true,\n\t\tEIP150Block:         big.NewInt(2),\n\t\tEIP150Hash:          common.HexToHash(\"0x9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9\"),\n\t\tEIP155Block:         big.NewInt(3),\n\t\tEIP158Block:         big.NewInt(3),\n\t\tByzantiumBlock:      big.NewInt(1035301),\n\t\tConstantinopleBlock: nil,\n\t\tClique: \u0026CliqueConfig{\n\t\t\tPeriod: 15,\n\t\t\tEpoch:  30000,\n\t\t},\n\t}\n\n\t// AllManashProtocolChanges contains every protocol change (EIPs) introduced\n\t// and accepted by the Matrix core developers into the Manash consensus.\n\t//\n\t// This configuration is intentionally not using keyed fields to force anyone\n\t// adding flags to the config to also have to set these fields.\n\tAllManashProtocolChanges = \u0026ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), nil, new(ManashConfig), nil, false}\n\n\t// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced\n\t// and accepted by the Matrix core developers into the Clique consensus.\n\t//\n\t// This configuration is intentionally not using keyed fields to force anyone\n\t// adding flags to the config to also have to set these fields.\n\tAllCliqueProtocolChanges = \u0026ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), nil, nil, \u0026CliqueConfig{Period: 0, Epoch: 30000}, false}\n\n\tTestChainConfig = \u0026ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), nil, new(ManashConfig), nil, false}\n\tTestRules       = TestChainConfig.Rules(new(big.Int))\n)\n```\n\n```go\nvar (\n\t// GasTableHomestead contain the gas prices for\n\t// the homestead phase.\n\tGasTableHomestead = GasTable{\n\t\tExtcodeSize: 20,\n\t\tExtcodeCopy: 20,\n\t\tBalance:     20,\n\t\tSLoad:       50,\n\t\tCalls:       40,\n\t\tSuicide:     0,\n\t\tExpByte:     10,\n\t}\n\n\t// GasTableHomestead contain the gas re-prices for\n\t// the homestead phase.\n\tGasTableEIP150 = GasTable{\n\t\tExtcodeSize: 700,\n\t\tExtcodeCopy: 700,\n\t\tBalance:     400,\n\t\tSLoad:       200,\n\t\tCalls:       700,\n\t\tSuicide:     5000,\n\t\tExpByte:     10,\n\n\t\tCreateBySuicide: 25000,\n\t}\n\n\tGasTableEIP158 = GasTable{\n\t\tExtcodeSize: 700,\n\t\tExtcodeCopy: 700,\n\t\tBalance:     400,\n\t\tSLoad:       200,\n\t\tCalls:       700,\n\t\tSuicide:     5000,\n\t\tExpByte:     50,\n\n\t\tCreateBySuicide: 25000,\n\t}\n)\n```\n\n```go\nvar (\n\tDifficultyBoundDivisor    = big.NewInt(10)  // The bound divisor of the difficulty, used in the update calculations.\n\tGenesisDifficulty         = big.NewInt(10)  // Difficulty of the Genesis block.\n\tMinimumDifficulty         = big.NewInt(10)  // The minimum that the difficulty may ever be.\n\tDurationLimit             = big.NewInt(6)   // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.\n\tVersionGammaDurationLimit = big.NewInt(9)   // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not.\n\tFloodTime                 = 1 * time.Second //洪泛时间阈值\n)\n```\n\n```go\nvar (\n\tDepositVersionKey_1 = \"DepostVersion_1.0\"\n\tDepositVersion_1    = \"1.0\"\n)\n```\n\n```go\nvar DAOForkBlockExtra = common.FromHex(\"0x64616f2d686172642d666f726b\")\n```\nDAOForkBlockExtra is the block header extra-data field to set for the DAO fork point and a number of consecutive blocks to allow fast/light syncers to correctly pick the side they want  (\"dao-hard-fork\").\n\n```go\nvar DAOForkExtraRange = big.NewInt(10)\n```\nDAOForkExtraRange is the number of consecutive blocks from the DAO fork point to override the extra-data in to prevent no-fork attacks.\n\n```go\nvar DAORefundContract = common.HexToAddress(\"0xbf4ed7b27f1d666546e30d74d50d173d20bca754\")\n```\nDAORefundContract is the address of the refund contract to send DAO balances to.\n\n```go\nvar DefLessDiskConfig = \u0026LessDiskConfig{\n\tOptInterval:     120,\n\tHeightThreshold: 30000,\n\tTimeThreshold:   2 * 60 * 60,\n}\n```\n\n```go\nvar DiscoveryV5Bootnodes = []string{}\n```\nDiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the experimental RLPx v5 topic-discovery network.\n\n```go\nvar MainnetBootnodes = []string{}\n```\nMainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main Matrix network.\n\n```go\nvar RinkebyBootnodes = []string{}\n```\nRinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the Rinkeby test network.\n\n```go\nvar (\n\tTargetGasLimit uint64 = GenesisGasLimit // The artificial target\n)\n```\n\n```go\nvar TestnetBootnodes = []string{}\n```\nTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the Ropsten test network.\n\n```go\nvar Version = func() string {\n\tv := fmt.Sprintf(\"%d.%d.%d\", VersionMajor, VersionMinor, VersionPatch)\n\tif VersionMeta != \"\" {\n\t\tv += \"-\" + VersionMeta\n\t}\n\treturn v\n}()\n```\nVersion holds the textual version string.\n\n## Functions\n\n```go\nfunc DAODrainList() []common.Address\n```\nDAODrainList is the list of accounts whose full balances will be moved into a refund contract at the beginning of the dao-fork block.\n\n```go\nfunc VersionWithCommit(gitCommit string) string\n```\n\n## Types\n\n```go\ntype ChainConfig struct {\n\tChainId *big.Int `json:\"chainId\"` // Chain id identifies the current chain and is used for replay protection\n\n\tHomesteadBlock *big.Int `json:\"homesteadBlock,omitempty\"` // Homestead switch block (nil = no fork, 0 = already homestead)\n\n\tDAOForkBlock   *big.Int `json:\"daoForkBlock,omitempty\"`   // TheDAO hard-fork switch block (nil = no fork)\n\tDAOForkSupport bool     `json:\"daoForkSupport,omitempty\"` // Whether the nodes supports or opposes the DAO hard-fork\n\n\tByzantiumBlock *big.Int `json:\"byzantiumBlock,omitempty\"` // Byzantium switch block (nil = no fork, 0 = already on byzantium)\n\t// EIP150 implements the Gas price changes (https://github.com/MatrixAINetwork/EIPs/issues/150)\n\tEIP150Block *big.Int    `json:\"eip150Block,omitempty\"` // EIP150 HF block (nil = no fork)\n\tEIP150Hash  common.Hash `json:\"eip150Hash,omitempty\"`  // EIP150 HF hash (needed for header only clients as only gas pricing changed)\n\n\tEIP155Block *big.Int `json:\"eip155Block,omitempty\"` // EIP155 HF block\n\tEIP158Block *big.Int `json:\"eip158Block,omitempty\"` // EIP158 HF block\n\n\tConstantinopleBlock *big.Int `json:\"constantinopleBlock,omitempty\"` // Constantinople switch block (nil = no fork, 0 = already activated)\n\n\t// Various consensus engines\n\tManash *ManashConfig `json:\"manash,omitempty\"`\n\tClique *CliqueConfig `json:\"clique,omitempty\"`\n\n\t// Simple mode\n\tSimpleMode bool `json:\"simpleMode,omitempty\"`\n}\n```\nChainConfig is the core config which determines the blockchain settings.\n\nChainConfig is stored in the database on a per block basis. This means that any network, identified by its genesis block, can have its own set of configuration options.\n\n```go\nfunc (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError\n```\nCheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.\n\n```go\nfunc (c *ChainConfig) GasTable(num *big.Int) GasTable\n```\nGasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).\n\nThe returned GasTable's fields shouldn't, under any circumstances, be changed.\n\n```go\nfunc (c *ChainConfig) IsByzantium(num *big.Int) bool\n```\n\n```go\nfunc (c *ChainConfig) IsConstantinople(num *big.Int) bool\n```\n\n```go\nfunc (c *ChainConfig) IsDAOFork(num *big.Int) bool\n```\nIsDAO returns whether num is either equal to the DAO fork block or greater.\n\n```go\nfunc (c *ChainConfig) IsEIP150(num *big.Int) bool\n```\n\n```go\nfunc (c *ChainConfig) IsEIP155(num *big.Int) bool\n```\n\n```go\nfunc (c *ChainConfig) IsEIP158(num *big.Int) bool\n```\n\n```go\nfunc (c *ChainConfig) IsHomestead(num *big.Int) bool\n```\nIsHomestead returns whether num is either equal to the homestead block or greater.\n\n```go\nfunc (c *ChainConfig) Rules(num *big.Int) *Rules\n```\n\n```go\nfunc (c *ChainConfig) String() string\n```\nString implements the fmt.Stringer interface.\n\n```go\ntype CliqueConfig struct {\n\tPeriod uint64 `json:\"period\"` // Number of seconds between blocks to enforce\n\tEpoch  uint64 `json:\"epoch\"`  // Epoch length to reset votes and checkpoint\n}\n```\nCliqueConfig is the consensus engine configs for proof-of-authority based sealing.\n\n```go\nfunc (c *CliqueConfig) String() string\n```\nString implements the stringer interface, returning the consensus engine details.\n\n```go\ntype ConfigCompatError struct {\n\tWhat string\n\t// block numbers of the stored and new configurations\n\tStoredConfig, NewConfig *big.Int\n\t// the block number to which the local chain must be rewound to correct the error\n\tRewindTo uint64\n}\n```\nConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.\n\n```go\nfunc (err *ConfigCompatError) Error() string\n```\n\n```go\ntype GasTable struct {\n\tExtcodeSize uint64\n\tExtcodeCopy uint64\n\tBalance     uint64\n\tSLoad       uint64\n\tCalls       uint64\n\tSuicide     uint64\n\n\tExpByte uint64\n\n\t// CreateBySuicide occurs when the\n\t// refunded account is one that does\n\t// not exist. This logic is similar\n\t// to call. May be left nil. Nil means\n\t// not charged.\n\tCreateBySuicide uint64\n}\n```\n\n```go\ntype LessDiskConfig struct {\n\tOptInterval     int64  // 操作间隔，单位秒\n\tHeightThreshold uint64 // 高度阈值\n\tTimeThreshold   int64  // 事件阈值，单位秒\n}\n```\n\n```go\ntype ManashConfig struct{}\n```\nManashConfig is the consensus engine configs for proof-of-work based sealing.\n\n```go\nfunc (c *ManashConfig) String() string\n```\nString implements the stringer interface, returning the consensus engine details.\n\n```go\ntype Rules struct {\n\tChainId                                   *big.Int\n\tIsHomestead, IsEIP150, IsEIP155, IsEIP158 bool\n\tIsByzantium                               bool\n}\n```\nRules wraps ChainConfig and is merely syntatic sugar or can be used for functions that do not have or require information about the block.\n\nRules is a one time interface meaning that it shouldn't be used in between transition phases.\n\n","path":"github.com/chainopen/matrixchaincode/params","name":"params","synopsis":"","isRedistributable":true}
