Documentation ¶
Index ¶
- Constants
- Variables
- func VersionWithCommit(gitCommit string) string
- type ChainConfig
- func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError
- func (c *ChainConfig) GasTable(num *big.Int) GasTable
- func (c *ChainConfig) IsByzantium(num *big.Int) bool
- func (c *ChainConfig) IsConstantinople(num *big.Int) bool
- func (c *ChainConfig) IsEIP150(num *big.Int) bool
- func (c *ChainConfig) IsEIP155(num *big.Int) bool
- func (c *ChainConfig) IsEIP158(num *big.Int) bool
- func (c *ChainConfig) IsHomestead(num *big.Int) bool
- func (c *ChainConfig) Rules(num *big.Int) Rules
- func (c *ChainConfig) String() string
- type CliqueConfig
- type ConfigCompatError
- type EthashConfig
- type GasTable
- type GenesisAccount
- type PoCConfig
- type PoCLightConfig
- type Rules
Constants ¶
const ( // These are the multipliers for ether denominations. // Example: To get the wei value of an amount in 'douglas', use // // new(big.Int).Mul(value, big.NewInt(params.Douglas)) // Wei = 1 Ada = 1e3 Babbage = 1e6 Shannon = 1e9 Szabo = 1e12 Finney = 1e15 Ether = 1e18 Einstein = 1e21 Douglas = 1e42 )
const ( GasLimitBoundDivisor uint64 = 64 //1024 // The bound divisor of the gas limit, used in update calculations. MinGasLimit uint64 = 500000 //5000 // Minimum the gas limit may ever be. GenesisGasLimit uint64 = 50000000 //5000000 // Gas limit of the Genesis block. MaximumExtraDataSize uint64 = 32 // Maximum size extra data may be after Genesis. ExpByteGas uint64 = 10 // Times ceil(log256(exponent)) for the EXP instruction. SloadGas uint64 = 50 // Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added. CallValueTransferGas uint64 = 9000 // Paid for CALL when the value transfer is non-zero. CallNewAccountGas uint64 = 25000 // Paid for CALL when the destination address didn't exist prior. TxGas uint64 = 21000 // Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. TxGasContractCreation uint64 = 53000 // Per transaction that creates a contract. NOTE: Not payable on data of calls between transactions. TxDataZeroGas uint64 = 4 // Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions. QuadCoeffDiv uint64 = 512 // Divisor for the quadratic particle of the memory cost equation. SstoreSetGas uint64 = 20000 // Once per SLOAD operation. LogDataGas uint64 = 8 // Per byte in a LOG* operation's data. CallStipend uint64 = 2300 // Free gas given at beginning of call. Sha3Gas uint64 = 30 // Once per SHA3 operation. Sha3WordGas uint64 = 6 // Once per word of the SHA3 operation's data. SstoreResetGas uint64 = 5000 // Once per SSTORE operation if the zeroness changes from zero. SstoreClearGas uint64 = 5000 // Once per SSTORE operation if the zeroness doesn't change. SstoreRefundGas uint64 = 15000 // Once per SSTORE operation if the zeroness changes to zero. JumpdestGas uint64 = 1 // Refunded gas, once per SSTORE operation if the zeroness changes to zero. EpochDuration uint64 = 30000 // Duration between proof-of-work epochs. CallGas uint64 = 40 // Once per CALL operation & message call transaction. CreateDataGas uint64 = 200 // CallCreateDepth uint64 = 1024 // Maximum depth of call/create stack. ExpGas uint64 = 10 // Once per EXP instruction LogGas uint64 = 375 // Per LOG* operation. CopyGas uint64 = 3 // StackLimit uint64 = 1024 // Maximum size of VM stack allowed. TierStepGas uint64 = 0 // Once per operation, for a selection of them. LogTopicGas uint64 = 375 // Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas. CreateGas uint64 = 32000 // Once per CREATE operation & contract-creation transaction. SuicideRefundGas uint64 = 24000 // Refunded following a suicide operation. MemoryGas 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. TxDataNonZeroGas 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. MaxCodeSize = 24576 // Maximum bytecode to permit for a contract EcrecoverGas uint64 = 3000 // Elliptic curve sender recovery gas price Sha256BaseGas uint64 = 60 // Base price for a SHA256 operation Sha256PerWordGas uint64 = 12 // Per-word price for a SHA256 operation Ripemd160BaseGas uint64 = 600 // Base price for a RIPEMD160 operation Ripemd160PerWordGas uint64 = 120 // Per-word price for a RIPEMD160 operation IdentityBaseGas uint64 = 15 // Base price for a data copy operation IdentityPerWordGas uint64 = 3 // Per-work price for a data copy operation ModExpQuadCoeffDiv uint64 = 20 // Divisor for the quadratic particle of the big int modular exponentiation Bn256AddGas uint64 = 500 // Gas needed for an elliptic curve addition Bn256ScalarMulGas uint64 = 40000 // Gas needed for an elliptic curve scalar multiplication Bn256PairingBaseGas uint64 = 100000 // Base price for an elliptic curve pairing check Bn256PairingPerPointGas uint64 = 80000 // Per-point price for an elliptic curve pairing check )
const ( VersionMajor = 0 // Major version component of the current release VersionMinor = 2 // Minor version component of the current release VersionPatch = 2 // Patch version component of the current release VersionMeta = "stable" // Version metadata to append to the version string )
const ( // BloomBitsBlocks is the number of blocks a single bloom bit section vector // contains. BloomBitsBlocks uint64 = 4096 )
Variables ¶
var ( MainnetGenesisHash = common.HexToHash("t0c6f20167950874a396ca06b717df8cd96597bc849b4935003cda98598c5e98be") // Mainnet genesis hash to enforce below configs on TestnetGenesisHash = common.HexToHash("t01fa3701d9164c47b587e335e9d4c2a34360dd77c84859c818ba7ea684bdf6ee1") // Testnet genesis hash to enforce below configs on )
var ( // MainnetChainConfig is the chain parameters to run a node on the main network. MainnetChainConfig = &ChainConfig{ ChainId: big.NewInt(9999), HomesteadBlock: big.NewInt(1), EIP150Block: big.NewInt(2), EIP150Hash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), EIP155Block: big.NewInt(3), EIP158Block: big.NewInt(3), ByzantiumBlock: big.NewInt(4), ConstantinopleBlock: nil, PoC: &PoCConfig{ Period: 3, Epoch: 201600, MaxValidatorsCount: 21, MinContribution: new(big.Int).Mul(big.NewInt(100), big.NewInt(1e+18)), GenesisTimestamp: 1554004800, Validators: []common.Address{ common.HexToAddress("0xfc97a1a683fb0108299d5725bc9d72899c9a86b4"), common.HexToAddress("0xb01d3dd946d3e2e1f3bf7ba86ff03864f8af47cd"), common.HexToAddress("0xbfa6f96861798532a334fd0df82e9f26c626dc59"), }, }, } // MainnetChainConfig is the chain parameters to run a node on the main network. RinkebyChainConfig = &ChainConfig{ ChainId: big.NewInt(9999), HomesteadBlock: big.NewInt(1), EIP150Block: big.NewInt(2), EIP150Hash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), EIP155Block: big.NewInt(3), EIP158Block: big.NewInt(3), ByzantiumBlock: big.NewInt(4), ConstantinopleBlock: nil, PoC: &PoCConfig{ Period: 3, Epoch: 201600, MaxValidatorsCount: 21, MinContribution: new(big.Int).Mul(big.NewInt(100), big.NewInt(1e+18)), GenesisTimestamp: 1554004800, Validators: []common.Address{ common.HexToAddress("0xfc97a1a683fb0108299d5725bc9d72899c9a86b4"), common.HexToAddress("0xb01d3dd946d3e2e1f3bf7ba86ff03864f8af47cd"), common.HexToAddress("0xbfa6f96861798532a334fd0df82e9f26c626dc59"), }, }, } // TestnetChainConfig contains the chain parameters to run a node on the Ropsten test network. TestnetChainConfig = &ChainConfig{ ChainId: big.NewInt(9998), HomesteadBlock: big.NewInt(1), EIP150Block: big.NewInt(2), EIP150Hash: common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000000"), EIP155Block: big.NewInt(3), EIP158Block: big.NewInt(3), ByzantiumBlock: big.NewInt(4), ConstantinopleBlock: nil, PoC: &PoCConfig{ Period: 3, Epoch: 201600, MaxValidatorsCount: 21, MinContribution: new(big.Int).Mul(big.NewInt(100), big.NewInt(1e+18)), GenesisTimestamp: 1554004800, Validators: []common.Address{ common.HexToAddress("0xfc97a1a683fb0108299d5725bc9d72899c9a86b4"), common.HexToAddress("0xb01d3dd946d3e2e1f3bf7ba86ff03864f8af47cd"), common.HexToAddress("0xbfa6f96861798532a334fd0df82e9f26c626dc59"), }, }, } // AllEthashProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Ethash consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, nil} // AllCliqueProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the Clique consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil} // AllPoCProtocolChanges contains every protocol change (EIPs) introduced // and accepted by the Ethereum core developers into the PoC consensus. // // This configuration is intentionally not using keyed fields to force anyone // adding flags to the config to also have to set these fields. AllPoCProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, &PoCConfig{Period: 3, Epoch: 30000, MaxValidatorsCount: 21, MinContribution: big.NewInt(1000000000000000000), GenesisTimestamp: 0, Validators: []common.Address{}}} TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, new(EthashConfig), nil, nil} TestRules = TestChainConfig.Rules(new(big.Int)) )
var ( // GasTableHomestead contain the gas prices for // the homestead phase. GasTableHomestead = GasTable{ ExtcodeSize: 20, ExtcodeCopy: 20, Balance: 20, SLoad: 50, Calls: 40, Suicide: 0, ExpByte: 10, } // GasTableHomestead contain the gas re-prices for // the homestead phase. GasTableEIP150 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 10, CreateBySuicide: 25000, } GasTableEIP158 = GasTable{ ExtcodeSize: 700, ExtcodeCopy: 700, Balance: 400, SLoad: 200, Calls: 700, Suicide: 5000, ExpByte: 50, CreateBySuicide: 25000, } )
var ( DifficultyBoundDivisor = big.NewInt(2048) // The bound divisor of the difficulty, used in the update calculations. GenesisDifficulty = big.NewInt(131072) // Difficulty of the Genesis block. MinimumDifficulty = big.NewInt(131072) // The minimum that the difficulty may ever be. DurationLimit = big.NewInt(13) // The decision boundary on the blocktime duration used to determine whether difficulty should go up or not. )
var DiscoveryV5Bootnodes = []string{
"enode://06051a5573c81934c9554ef2898eb13b33a34b94cf36b202b69fde139ca17a85051979867720d4bdae4323d4943ddf9aeeb6643633aa656e0be843659795007a@35.177.226.168:30303",
"enode://0cc5f5ffb5d9098c8b8c62325f3797f56509bff942704687b6530992ac706e2cb946b90a34f1f19548cd3c7baccbcaea354531e5983c7d1bc0dee16ce4b6440b@40.118.3.223:30304",
"enode://1c7a64d76c0334b0418c004af2f67c50e36a3be60b5e4790bdac0439d21603469a85fad36f2473c9a80eb043ae60936df905fa28f1ff614c3e5dc34f15dcd2dc@40.118.3.223:30306",
"enode://85c85d7143ae8bb96924f2b54f1b3e70d8c4d367af305325d30a61385a432f247d2c75c45c6b4a60335060d072d7f5b35dd1d4c45f76941f62a4f83b6e75daaf@40.118.3.223:30307",
}
DiscoveryV5Bootnodes are the enode URLs of the P2P bootstrap nodes for the experimental RLPx v5 topic-discovery network.
var MainnetBootnodes = []string{
"enode://94268dca1403ceaaad778913953134d572e59810e4aa2c208938fceae8315d51963d51ca1ec903332179e34921cfd51e4dca6508e85756f624e1c28fc8d5f613@35.195.13.217:30313",
"enode://00c9ac313b53b22f0639d7609ae343bb01b3a594503f8e9887f46130771c78536969b52968560828881c7dad3adb0acead5e5c95644cc15da2976acd7bd72e13@35.231.35.71:30311",
"enode://eb227d3ade864eade034d69a02d46c37a215c25616f5c79a21a131e46c1e47deb1868151d7b4af6e0fa076a43fac6ae9ba0a0937dbf0214e8814945985f0a258@35.231.35.71:30313",
"enode://1ff1e9e6707b87d674ac2300c949cfa249906e46eaceb6d58d43dd44f8d8f62d75e097b78f5040f22ddd7473831cb70842841fba2a52cea26701b47f69ab7e62@35.228.112.210:30311",
"enode://26aa260b2dd45392816bf29f3f01532f282f4bd98e1d42fcb1a20d7bc45c48809f87c4f94719207631083e985d88cfbecb5bb98a002f59514c18e64aad282d30@35.228.112.210:30312",
"enode://6f983c38ab7b34360760668bb032e5c0968ad967c631c5decaee087adb88497a9b5c76bbd61b4dbeb218faa6ffe1a0f77288e5fb8a7a032e975f7cf42d6fce47@35.230.128.59:30311",
"enode://fcb0c9b8c375b973011a27f1d2ddc2df34d56080c1d8b2daa961542912e90224d650ce38a2c6f61f24189018f960f80123e402d6d40a70fa2dff42b90b995ce7@35.230.128.59:30312",
"enode://5652b8cb4c5ae8f9ef004fc7eebc3a409e2a3421ad6bda95090a46c3cbcae82324981d0bac8836558f09741d459850452300145085675c87a1e84753b5730474@35.243.91.57:30311",
"enode://e0fe630505fa7ec17178bdf816018e1b6c566804d1eaad5a6ba50d29522f796b82518b0b168da3a5b222b2ec6be9f651c6a4e321247144d15d0288bff4864a32@35.243.118.24:30311",
"enode://de741dcc7474645790c1890eea02c1e6dc14689dcbaa8e12a0cba6a0dc96d9c84dfcd3b7a001e9eae1dfc1ce3efabcc0a6b70bfe2d0491347367d2524f684000@35.190.239.155:30303",
"enode://80b6e1b753e4b662db6c4fc53bd58c51cd3ed549c062e3743c5bd6ce9f7042b0b3152a093fc535c19960a7625aaad4f6e77d88220ad4aa676f2cefb4dce03956@35.190.239.155:30312",
"enode://0843721927af5ac58a2bdaf3b8c0783c452762788fc578261401c54caac3b6c751804a91d183db806bd9a45012b0000d703c9024ec6920f7c4ba037be44f8965@35.190.239.155:30314",
"enode://67e7ee1779f6165a8c93df0b7aa281448031660f3301fb59a6a0acfbffa0ea44a4bba3d02008c6c76b8b1218fe8f941d70e431b243d91c3e5e38a6b5bdae6158@34.74.182.148:30303",
"enode://4c3e8d3ba2c174df4f93eaaac3073d62d5ef49f3d993721c72325add9785ac7290e8c84551a5418884021e993d00df20fc7c05ce486faf189af40768aaaa34dd@34.74.182.148:30312",
"enode://2bc058f435aeb40f289bb8bb0033c25546abbba90a6691a0337e4adec31a22ab87972800424aafecca4cb37481419e13c40dc228a13ff7821d1585aeed9fc779@34.77.28.121:30303",
"enode://ea18e7b08e9b7b6951f08bae369616968264b7338a3f3194c2c5e38c0d2ef2fc7ea4d0dbd717c14008204f2e18b5212525013f4c409a00c5663c1ca4266d3aa1@34.77.28.121:30312",
"enode://76b30846780ae7d2f296877a67f1bb39da646c92a96d9e13f0a2de4f5305d8dcbe2b07d16b2863b9e280c1cee496332bacaae2ed3949e9734f75dcb9f59f684f@35.241.177.70:30312",
"enode://81ab2cb3fd0b5298a2d63b4cdb866af824720bce46d69ffe596c32131bd1e94e13f9662b3c06c8c7f5697931012cf806e4fe890d39babd8416a9a9382cbd8765@35.241.177.70:30313",
"enode://8583f990f2b40fc20e3c4c779b5cdd301071f5bcd1cc32edd7efac566efe0ddf3a7ad8ecad4072f966c56bff913928275918079a26bea8a8f35c5ade72ff5caa@35.241.177.70:30314",
"enode://c4b924871aa8706a9a07da15bdf450bfb8fbea29a376d26c5649ce2ff9ededa0a2e18ba9ecf8c1f72e626fe274a441cddeb1e831f9e72bb38b4c208405ef5f21@35.243.190.93:30311",
"enode://461a358b6bde98f6a29db00f63a552df9e6e72241343c3190380231e551308296f1f875e39109c90796a5cb7551cf505131fa4d317dd44f5bb17f8b1704b09a9@35.243.190.93:30314",
"enode://83d248abd03c311bba6c998b1d265bd5313ba11ee617a5978e90c5051bdf08cfd91e998f81a1515ffc08b4d6c63cd3cdaafe9d6bdf435e3b4350d2441e06b59c@35.195.84.56:30311",
"enode://a1e8c3d3a9dd56ca9bac501cdaa217c544e9450a64b1504866069bb4eabffd78cef31477f768a4d37610b7b23a6c21b2099c999e11669830853253ccc7ee75c6@35.195.84.56:30314",
}
MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the main Ethereum network.
var MainnetRPCnodes = []string{
"47.111.177.215:8511",
"47.111.178.14:8511",
"47.111.177.154:8511",
}
MainnetRPCnodes are the RPC URLs of TTC main network.
var RinkebyBootnodes = []string{
"enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303",
"enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303",
"enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303",
}
RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the Rinkeby test network.
var SidechainBootnodes = []string{
"enode://1a4cc9c8512256ff475990c4ab03636ac7771315a42432a240c6161befa162324be5af0f65828f0b7ec468b3d2183c430fb4a33d88ba5057eaa35b36a3af4b56@127.0.0.1:30510",
}
SidechainBootnodes are the enode URLs of the P2P bootstrap nodes running on the TTC sidechain network.
var (
TargetGasLimit uint64 = GenesisGasLimit // The artificial target
)
var TestnetBootnodes = []string{
"enode://b9487401a29c9c2b6f58ad96d080c22ed5c93a037d5cbd3412dc310837081ce6aa2b43910c3f1e8c94e072d56ddd2741941a04ae889f9119ab3bcfde8172fff8@47.111.177.215:30310",
"enode://b52b9dec747cada8e4697544d857ab4b7e4298dce707f0591166cb3fedc07de86daffe73c49a23fd8e2b911b2246ea81a6ef709f42eab01c6d61b49c6f2b89c8@47.111.177.215:30311",
"enode://f70bc22fc68fa25de65d365926deecb961b33165cba4078236d83e05259d6082979c2a0c5eb436351f49ddec2150e20b1425ca2c288512db5eeb2702b43f0d94@47.111.178.14:30312",
"enode://bfbdf7ecb9be785ea0105a28db115dbdb61f6e486d6310859985974f05555d10e531290bd821a962efafdec087c075f6e5d15efd94937fb00d10c053b2bd56ed@47.111.177.154:30313",
"enode://8327d9c22125b548fe9bf6ea463d011a87774974f7178847931d9ff4ca1b01151a4ef2a6c3a2626e7c2132d5e39f4f59437ab47feee8f3b9c5fd32cef118eb6b@47.111.178.14:30314",
"enode://d72b636e208ad90cf46da4b6c04b2bf2e9a5a7a240655ea0dd8162e9f59bf734b12a8e4770c9e1f9eef11f2308241c49ffce62fef86fb78fc48d92fcbd72cace@47.111.178.14:30315",
"enode://c8712027f2351bc59d0f5e8d8d278c645d4e6f91875a706684a20677e2695f20e29903d7ee679831e1bad7550b65cccc34b8c23abf3d09749ee556dce7415047@47.111.178.14:30316",
"enode://082b1d3068ca66dc35c2439b64ce5b43c67585f0bb140fe15c4acf9db6a2cf821c0ab399bfa0f850cc2f30b71179ede9687a81e9d406cac52134386d8838224d@47.111.177.154:30318",
"enode://2ee5103c7ce3b3cfda3ac081d0541903ebd834cba75907e4612dc825e37e2d83deb3ce579bc4bc64322f68ebdc7fa0b8181d00852aa92d5df6735030aff9fd53@47.111.177.154:30319",
}
TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the TTC test network.
var Version = func() string { v := fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) if VersionMeta != "" { v += "-" + VersionMeta } return v }()
Version holds the textual version string.
Functions ¶
func VersionWithCommit ¶
Types ¶
type ChainConfig ¶
type ChainConfig struct { ChainId *big.Int `json:"chainId"` // Chain id identifies the current chain and is used for replay protection HomesteadBlock *big.Int `json:"homesteadBlock,omitempty"` // Homestead switch block (nil = no fork, 0 = already homestead) // EIP150 implements the Gas price changes (https://github.com/ethereum/EIPs/issues/150) EIP150Block *big.Int `json:"eip150Block,omitempty"` // EIP150 HF block (nil = no fork) EIP150Hash common.Hash `json:"eip150Hash,omitempty"` // EIP150 HF hash (needed for header only clients as only gas pricing changed) EIP155Block *big.Int `json:"eip155Block,omitempty"` // EIP155 HF block EIP158Block *big.Int `json:"eip158Block,omitempty"` // EIP158 HF block ByzantiumBlock *big.Int `json:"byzantiumBlock,omitempty"` // Byzantium switch block (nil = no fork, 0 = already on byzantium) ConstantinopleBlock *big.Int `json:"constantinopleBlock,omitempty"` // Constantinople switch block (nil = no fork, 0 = already activated) // Various consensus engines Ethash *EthashConfig `json:"ethash,omitempty"` Clique *CliqueConfig `json:"clique,omitempty"` PoC *PoCConfig `json:"poc,omitempty"` }
ChainConfig is the core config which determines the blockchain settings.
ChainConfig 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.
func (*ChainConfig) CheckCompatible ¶
func (c *ChainConfig) CheckCompatible(newcfg *ChainConfig, height uint64) *ConfigCompatError
CheckCompatible checks whether scheduled fork transitions have been imported with a mismatching chain configuration.
func (*ChainConfig) GasTable ¶
func (c *ChainConfig) GasTable(num *big.Int) GasTable
GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).
The returned GasTable's fields shouldn't, under any circumstances, be changed.
func (*ChainConfig) IsByzantium ¶
func (c *ChainConfig) IsByzantium(num *big.Int) bool
func (*ChainConfig) IsConstantinople ¶
func (c *ChainConfig) IsConstantinople(num *big.Int) bool
func (*ChainConfig) IsHomestead ¶
func (c *ChainConfig) IsHomestead(num *big.Int) bool
IsHomestead returns whether num is either equal to the homestead block or greater.
func (*ChainConfig) String ¶
func (c *ChainConfig) String() string
String implements the fmt.Stringer interface.
type CliqueConfig ¶
type CliqueConfig struct { Period uint64 `json:"period"` // Number of seconds between blocks to enforce Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint }
CliqueConfig is the consensus engine configs for proof-of-authority based sealing.
func (*CliqueConfig) String ¶
func (c *CliqueConfig) String() string
String implements the stringer interface, returning the consensus engine details.
type ConfigCompatError ¶
type ConfigCompatError struct { What string // block numbers of the stored and new configurations StoredConfig, NewConfig *big.Int // the block number to which the local chain must be rewound to correct the error RewindTo uint64 }
ConfigCompatError is raised if the locally-stored blockchain is initialised with a ChainConfig that would alter the past.
func (*ConfigCompatError) Error ¶
func (err *ConfigCompatError) Error() string
type EthashConfig ¶
type EthashConfig struct{}
EthashConfig is the consensus engine configs for proof-of-work based sealing.
func (*EthashConfig) String ¶
func (c *EthashConfig) String() string
String implements the stringer interface, returning the consensus engine details.
type GasTable ¶
type GasTable struct { ExtcodeSize uint64 ExtcodeCopy uint64 Balance uint64 SLoad uint64 Calls uint64 Suicide uint64 ExpByte uint64 // CreateBySuicide occurs when the // refunded account is one that does // not exist. This logic is similar // to call. May be left nil. Nil means // not charged. CreateBySuicide uint64 }
type GenesisAccount ¶
type GenesisAccount struct {
Balance string `json:"balance"`
}
type PoCConfig ¶
type PoCConfig struct { Period uint64 `json:"period"` // Number of seconds between blocks to enforce Epoch uint64 `json:"epoch"` // Epoch length to reset votes and checkpoint MaxValidatorsCount uint64 `json:"maxValidatorsCount"` // Max count of validators MinContribution *big.Int `json:"minContribution"` GenesisTimestamp uint64 `json:"genesisTimestamp"` // The LoopStartTime of first Block Validators []common.Address `json:"validators"` // Signers vote by themselves to seal the block, make sure the signer accounts are pre-funded LightConfig *PoCLightConfig `json:"lightConfig,omitempty"` }
PoCConfig is the consensus engine configs for delegated-proof-of-stake based sealing.
type PoCLightConfig ¶
type PoCLightConfig struct {
Alloc map[common.UnprefixedAddress]GenesisAccount `json:"alloc"`
}
PoCLightConfig is the config for light node of poc
type Rules ¶
type Rules struct { ChainId *big.Int IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium bool }
Rules wraps ChainConfig and is merely syntatic sugar or can be used for functions that do not have or require information about the block.
Rules is a one time interface meaning that it shouldn't be used in between transition phases.