Hi Guest

More contents, please log on!

Bitmere.com 区块链技术 Content
本帖最后由 真无牙泛 于 2022-11-2 21:46 编辑

 最快的速度同步以太坊的区块链,需要将以下地址设置为默认连接节点如果你是geth用户,可以做如下设置,默认连接这个节点,地址为:enode://91922b12115c067005c574844c6bbdb114eb262f90b6355cec89e13b483c3e4669c6d63ec66b6e3ca7a3a462d28edb3c659e9fa05ed4c7234524e582a8816743@120.27.164.92:13333

  找到你的data目录,例如linux上默认是~/.ethereum

  在data目录里面新建一个static-nodes.json文件,输入以下内容并保存:

  1. ["enode://91922b12115c067005c574844c6bbdb114eb262f90b6355cec89e13b483c3e4669c6d63ec66b6e3ca7a3a462d28edb3c659e9fa05ed4c7234524e582a8816743@120.27.164.92:13333"]
Copy the Code

  如常启动geth即可

  检查是否连接成功

  通过geth console进入控制台,或者通过geth --ipcpath ~/.ethereum/geth.ipc attach开控制台挂上当前进程

  控制台中输入:

  1. admin.peers.forEach(function(p) {console.log(p.network.remoteAddress);})
Copy the Code

  如果打印出的地址里面包括120.27.164.92, 说明已经连上。

 
链接该节点的第二个方法:首先,用geth命令打开命令行钱包,然后新建一个终端窗口,输入命令 geth attach。

然后,在新窗口中输入命令行

  1. admin.addPeer("enode://91922b12115c067005c574844c6bbdb114eb262f90b6355cec89e13b483c3e4669c6d63ec66b6e3ca7a3a462d28edb3c659e9fa05ed4c7234524e582a8816743@120.27.164.92:13333"),
Copy the Code


enter键。最后,检查是否连接成功。输入命令行 admin.peers,enter键。

查看列出的节点中有没有上面的节点。


 


BitMere.com is Information release platform,just provides information storage space services.
The opinions expressed are solely those of the author,Does not constitute advice, please treat with caution.
You have to log in before you can reply Login | 立即注册

Points Rules

Write the first review

真无牙泛 初中生
  • Follow

    1

  • Following

    0

  • Articles

    17

币圈江左盟
Promoted