Two full node startup modes for the Ethereum go-ethereum client

Original address: https://blog.csdn.net/wo541075754/article/details/53900224

This blog introduces the two startup modes of go-ethereum full nodes: main network fast startup and test network fast startup. These are also two startup methods provided by the client, which can be used directly. The following describes how to use it in detail.

Mainnet Quick Start

In fact, when most of us use nodes again, it is not related to the previous historical data. We start a node just to create accounts, trade funds, deploy contracts, and interact with contracts. In this case, the geth client provides a quick sync start method, the command is as follows:

$ geth --fast --cache=512 console
  • 1

The fast parameter enables fast sync mode. Although this mode does not concern the entire historical data, it will result in downloading more data in exchange for processing the historical data of the entire network, which is a CPU-intensive configuration. 
The cache parameter specifies the database memory storage size, which helps to improve the synchronization time. This range can be adjusted between 512M-2G depending on the machine configuration.

Test network full node

As a developer, you may need to publish some contracts or make some transactions, which is unlikely in a real network without ether. Then, at this time, you can access the test network and just perform "play-Ether". The 
command is as follows:

$ geth --testnet --fast --cache=512 console
  • 1

Other parameters are the same as normal parameters. The testnet parameter will reconfigure the Geth instance: 
(1) A testnet directory dedicated to storing test data is generated under the original default .ethereum directory. 
(2) Switch from the original main network to the test network, and use different P2P startup nodes, different network IDs and genesis states at the same time. 
PS: Although the main network and the test network are separated by default, it is better to use different accounts when using them.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325494012&siteId=291194637