是否有可能获得节点ChainConfig (使用硬叉块数激活,如Constantinople:块号.)从控制台?
geth是只使用来自ChainConfig的genesis.json,还是在必要时更新ChainConfig并添加新的硬叉块号?
非常感谢!
发布于 2023-02-07 17:35:27
不,不可能从控制台获取ChainConfig结构,因为没有客户端实现。这是因为这些值是固定的(常量),并且只根据网络进行更改,因此没有人会定期(使用控制台或RPC)请求它们。
如果需要为任何网络获取这些常量,则可以从源获取这些常量:
MainnetChainConfig = &ChainConfig{
ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(1_150_000),
DAOForkBlock: big.NewInt(1_920_000),
DAOForkSupport: true,
EIP150Block: big.NewInt(2_463_000),
EIP150Hash: common.HexToHash("0x2086799aeebeae135c246c65021c82b4e15a2c451340993aacfd2751886514f0"),
EIP155Block: big.NewInt(2_675_000),
EIP158Block: big.NewInt(2_675_000),
ByzantiumBlock: big.NewInt(4_370_000),
ConstantinopleBlock: big.NewInt(7_280_000),
PetersburgBlock: big.NewInt(7_280_000),
IstanbulBlock: big.NewInt(9_069_000),
MuirGlacierBlock: big.NewInt(9_200_000),
BerlinBlock: big.NewInt(12_244_000),
LondonBlock: big.NewInt(12_965_000),
ArrowGlacierBlock: big.NewInt(13_773_000),
GrayGlacierBlock: big.NewInt(15_050_000),
TerminalTotalDifficulty: MainnetTerminalTotalDifficulty, // 58_750_000_000_000_000_000_000
TerminalTotalDifficultyPassed: true,
Ethash: new(EthashConfig),
}这是发布它们的文件:
https://github.com/ethereum/go-ethereum/blob/master/params/config.go
https://ethereum.stackexchange.com/questions/144359
复制相似问题