geth bootnodes

前言

  • geth Version 1.8.17-stable

指定 bootnodes

有三种方式,参见这里:https://ethereum.gitbooks.io/frontier-guide/content/connecting.html
个人感觉最好用的方式是在命令行中指定的方式,形式如下

geth --bootnodes "enode://pubkey1@ip1:port1,enode://pubkey2@ip2:port2,enode://pubkey3@ip3:port3"

bootnode间,用逗号分隔。

来个实例:

nohup geth \
    --syncmode "fast" \
    --datadir /sde/geth_network/data \
    --identity "gethNetwork" \
    --bootnodes "enode://7de08e36efeabbdd432e25ee6155fb82ce632770f48a55c08a1560ded8ff6d9168021ecc0f0069b241af47550fc12a341075c99f82b1a851006d11c6fcf8093e@87.122.222.255:30303,enode://a4de274d3a159e10c2c9a68c326511236381b84c9ec52e72ad732eb0b2b1a2277938f78593cdbe734e6002bf23114d434a085d260514ab336d4acdc312db671b@5.9.150.40:30301,enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303,enode://f6ba1f1d9241d48138136ccf5baa6c2c8b008435a1c2bd009ca52fb8edbbc991eba36376beaee9d45f16d5dcbf2ed0bc23006c505d57ffcf70921bd94aa7a172@144.76.62.101:30303,enode://f4642fa65af50cfdea8fa7414a5def7bb7991478b768e296f5e4a54e8b995de102e0ceae2e826f293c481b5325f89be6d207b003382e18a8ecba66fbaf6416c0@129.16.191.64:30303,enode://9cab44256cc26bfb1ba57bfec0c70e72712a826db26c069a9d63a8e429bd725d7c5dc8c81e91fae3f7bd6f8a80e3dba944c485007d51341619c007f2866052f4@47.103.31.105:30303" \
    >> console.out 2>&1 &

我也不知道哪个bootnode好用。

指定 bootnodes 的作用

加速连到网络中。
要了解更多,可以参考:
https://www.jianshu.com/p/51d486afebdd
https://www.zhihu.com/question/23041414
https://blog.csdn.net/weixin_40401264/article/details/78097842

你可能感兴趣的:(以太坊Geth)