以下は、プライベート Ethereum ネットワークにアクセスするために bootnode に接続する必要がdocker-compose.yml
ある Ethereum ノードを開始するために使用されます。geth
version: '2'
geth:
image: ethereum/client-go:latest
volumes:
- ./node:/root/.ethereum
- ./files/genesis.json:/root/genesis.json:ro
ports:
- "30303:30303"
- "30303:30303/udp"
- 8543:8545
command: --rpc --rpcaddr 0.0.0.0 --networkid 13377331 --bootnodes="enode://692b8eda368ffc427fc1a047850557536a0ef0bfa3b66f998e03e8b83c3fd8f786e3c2b710a20e2e821a9eff34fc7b34ffa326a8a5fbcf3634b55b44596ada43@159.999.999.999:30303" --nodiscover
ただし、実行後docker-compose up
、エコーされたチェーン構成はデフォルトのものであり、ブートノードが使用している構成ではないことがわかります
初期化されたチェーン構成 config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 コンスタンティノープル: エンジン: ethash}"
質問:geth
が bootnode に接続せず、bootnode にある構成を使用しないのはなぜgenesis.json
ですか?
docker-compose 出力:
geth_1 | WARN [07-15|00:48:33.310] Sanitizing cache to Go's GC limits provided=1024 updated=666
geth_1 | INFO [07-15|00:48:33.310] Maximum peer count ETH=25 LES=0 total=25
geth_1 | INFO [07-15|00:48:33.317] Starting peer-to-peer node instance=Geth/v1.8.13-unstable-2e0391ea/linux-amd64/go1.10.3
geth_1 | INFO [07-15|00:48:33.317] Allocated cache and file handles database=/root/.ethereum/geth/chaindata cache=499 handles=1024
geth_1 | INFO [07-15|00:48:33.331] Writing default main-net genesis block
geth_1 | INFO [07-15|00:48:33.632] Persisted trie from memory database nodes=12356 size=1.88mB time=84.3549ms gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=0.00B
geth_1 | INFO [07-15|00:48:33.636] Initialised chain configuration config="{ChainID: 1 Homestead: 1150000 DAO: 1920000 DAOSupport: true EIP150: 2463000 EIP155: 2675000 EIP158: 2675000 Byzantium: 4370000 Constantinople: <nil> Engine: ethash}"
geth_1 | INFO [07-15|00:48:33.636] Disk storage enabled for ethash caches dir=/root/.ethereum/geth/ethash count=3
geth_1 | INFO [07-15|00:48:33.636] Disk storage enabled for ethash DAGs dir=/root/.ethash count=2
geth_1 | INFO [07-15|00:48:33.636] Initialising Ethereum protocol versions="[63 62]" network=1
geth_1 | INFO [07-15|00:48:33.637] Loaded most recent local header number=0 hash=d4e567…cb8fa3 td=17179869184
geth_1 | INFO [07-15|00:48:33.637] Loaded most recent local full block number=0 hash=d4e567…cb8fa3 td=17179869184
geth_1 | INFO [07-15|00:48:33.637] Loaded most recent local fast block number=0 hash=d4e567…cb8fa3 td=17179869184
geth_1 | INFO [07-15|00:48:33.640] Regenerated local transaction journal transactions=0 accounts=0
geth_1 | INFO [07-15|00:48:33.640] Starting P2P networking
geth_1 | INFO [07-15|00:48:33.641] RLPx listener up self="enode://27175216e04387fb93e87a4069021b640fc6f87f985c86940e3297103a2b5e348bdecec4eea98af6ee2f106890fd28b49e1d983b6c5b8ce9ae1571c032bf2d5c@[::]:30303?discport=0"
geth_1 | INFO [07-15|00:48:33.644] IPC endpoint opened url=/root/.ethereum/geth.ipc
geth_1 | INFO [07-15|00:48:33.645] HTTP endpoint opened url=http://0.0.0.0:8545 cors= vhosts=localhost
ジェネシス.json
{
"config": {
"chainId": 13377331,
"homesteadBlock": 1,
"eip150Block": 2,
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 3,
"eip158Block": 3,
"byzantiumBlock": 4,
"clique": {
"period": 15,
"epoch": 30000
}
},
....