Connect to the node console and execute the following command:
Not sure how to enter the console? You can refer to the following tutorials:
- How to enter the console of the node with Docker, click here
- How to enter the console of the node on Windows, click here
node sync status
Execute the above command to see the current block height:
Sliding to the last line, there are two results:
- Result 1: If the content in the screenshot below is returned, it means that during synchronization, the synchronization is completed when
chain_status.head.number
andstate.Synchronizing.target.number
are the same.
- Result 2: Synchronization complete
Answer: Execute the above command to view the synchronization progress. The synchronization time can be estimated by yourself according to the command execution result.
Download the mainnet block data of other nodes to the new node, and start the node with the downloaded block data.
Download the starcoin_db_exporter
node data export tool, this is a must, and the synchronization script needs to be used.
$ wget https://github.com/starcoinorg/starcoin/releases/download/v1.11.9/starcoin-ubuntu-18.04.zip
$ unzip starcoin-ubuntu-18.04.zip
$ cp starcoin-artifacts/starcoin_db_exporter starcoin_db_exporter
First download the official synchronization script tool:
$ wget https://raw.githubusercontent.com/starcoinorg/starcoin/master/scripts/import_block.sh
Grant the script execution permission and start downloading the mainnet block data to the /data/starcoin/main directory and import:
$ chmod 755 import_block.sh
$ ./import_block.sh main /data/starcoin/main
Hint:
- main: main is the main network. You can replace it with testnet, such as: barnard, proxima, halley.
- /data/starcoin/main: Custom block data directory;
Once the script has finished running, it's time to run the new node.
Let's use Docker to run the new node. If it is Windows, you can refer to the running command in the previous article.
$ sudo docker run --restart=always \
--name starcoin-main \
-d -p 9880:9880 \
-v /data/starcoin/:/data/starcoin/ \
starcoin/starcoin \
/starcoin/starcoin \
-n main \
-d /data/starcoin \
--disable-metrics true \
--stratum-address 0.0.0.0 --stratum-port 9880 \
--miner-thread 0