建立私有网络

Private Networks | Go Ethereum

连接到RPC

geth attach http(s)://RPC_ADDRESS:RPC_PORT

版本

对于geth的私有网络,确定其版本需要查看创世区块配置。

或者geth attach上去,admin.nodeInfo查看(不过基本上你没有admin的机会就是了)

出现了的hard fork,且当前height已经到达后面对应的值时,该hard fork就会被启用。

例如下方,从第0个区块开始就启用了istanbul及以前的hard fork。

{
  "config": {
    "chainId": 19260817,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "clique": {
      "period": 0,
      "epoch": 30000
    }
  },
  "nonce": "0x0",
  "timestamp": "0x62440850",
  "extraData": "",
  "gasLimit": "0x47b760",
  "difficulty": "0x1",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "baseFeePerGas": null
}

使用geth的puppeth生成的创世区块配置(genesis.json),默认情况下不一定会包含到最新的Hard Fork(1.10.16只启用到istanbul,Berlin和London均未启用)