This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11920|Reply: 2

Ethereum client mist and geth methods to speed up block synchronization

[Copy link]
Posted on 2/19/2018 5:07:57 PM | | | |
Ethereum has released the graph client Mist and the command line client Geth under Windows, but a problem was found in China, creating a new Ethereum account, which currently needs to synchronize 1.7 million blocks, which is very slow, often not synchronized for several days. According to Ethernodes statistics, the number of domestic Ethereum nodes was 143 at the time of publication, and the special network reasons in China will also affect the synchronization of block data by domestic users.

In order to synchronize blocks more smoothly for domestic users, EthFans launched the Spark Node Program, organizing domestic organizations and individuals interested in the Ethereum project to voluntarily run supernodes, and the information of Spark nodes will be packaged into node (node) files, allowing community members to freely download and connect to more supernodes to speed up synchronization, the specific steps are as follows:

1. Whether it is a mist client or other clients such as geth or eth, they all share the same application configuration, that is, the location where the data is stored is the same, and the default datadir is different according to different system locations.

Mac: ~/Library/Ethereum
Linux: ~/.ethereum
Windows: %APPDATA%\Ethereum

2. Find the file storage directory as above, save the following content as a static-nodes.json, and put it in the Ethereum datadir directory, such as windows, put it in %APPDATA%\Ethereum\static-nodes.json, pay attention to the encoding format when saving, select ANSI.


3. The Ethereum client defaults to 11-13 nodes to start the connection, if you feel that it is not enough, you can use the command to increase the startup parameters -maxpeers 100 command at startup to increase the number of connection startup nodes to the upper limit of 100, of course, it will also consume a lot of your hard disk and CPU.

static-nodes.json (2.37 KB, Number of downloads: 8)



 Landlord| Posted on 2/19/2018 5:10:45 PM |
Check if the connection is successful
1. Enter the console through the geth console, or open the console through geth --ipcpath ~/.ethereum/geth.ipc attach to hang the current process
2. Enter admin.peers.forEach(function(p) {console.log(p.network.remoteAddress) in the console; })
3. If the printed address includes 120.27.164.92, it means it is connected
 Landlord| Posted on 2/19/2018 5:11:21 PM |
The second method of linking nodes:

First, open the command line wallet with the geth command, then create a new terminal window and enter the command geth attach.

Then, enter the command line in the new window

admin.addPeer(" enode://91922b12115c067005c574844c6bbdb114eb262f90b6355cec89e13b483c3e4669c6d63ec66b6e3ca7a3a462d28edb3c659e9fa05ed4c7234524e582a8816743@120.27.164.92:13333")
Finally, check if the connection is successful. Enter the command line admin.peers and press enter. See if there are any of the nodes listed above.

For more connection settings, please refer to the documentation: https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com