Main Network - Second-Earth/setchain GitHub Wiki
Server environment minimum requirements:
System version: Ubuntu 18.04 64-bit
Bandwidth: 10Mbps
CPU (CPU): 4 cores
Hard disk: 256G
Memory: 8GB
Go Version:
-go1.9.2+ (It is recommended to install the latest version)
Supported operating systems:
-Ubuntu 16.04 -Ubuntu 18.04 -MacOS Darwin 10.12 and higher
1: Download the public chain source code to $GOPATH/src/github.com/setchain
:
git clone https://github.com/Second-Earth/setchain
2: Enter the project root directory
cd setchain
3: Compile
make all
After compiling, there will be two executable files set
and setfinder
in the ./build/bin
directory
Note that some users encounter file format problems when compiling, please execute make fmt before compiling
After entering the ./build/bin
directory, execute the following commands in order:
# nohup ./set --genesis=../genesis.json --datadir=./mainnetData --contractlog --p2p_listenaddr :9090 --http_modules=fee,miner,dpos,account,txpool,set >> mainnet.log &
# ./set --ipcpath mainnetData/set.ipc p2p add fnode://39d9c0d40b01d5e588d492e3b528868d37b1fe69bdfb1fe502aee0b2ffa79cd30da464bf00883f0f511ad36c499414148b3104f058734ff6132d17e90e6192
After the command is executed successfully, check the mainnet.log file. Normally, the node will batch synchronize the historical block data of the main network until it keeps up with the latest block.
When "blocks=1" is continuously output in the log, it indicates that it has kept up with the latest block
If you need to make a block node, you need to perform the following two steps in the ./build/bin
directory:
first step:
./set miner -i ./mainnetData/set.ipc setcoinbase "your_account" privateKey.txt
-privateKey.txt is a file in the bin directory, which stores the private key. Note that the private key does not need to be prefixed with 0x. Remember to delete the privateKey.txt file after executing this command to prevent the private key from leaking -After the miner restarts, the above command to configure the private key needs to be executed again -After this command is executed, please check the results in the log file. If the output "valid", it means success, if the output "invalid", it means failure
The second step:
./set miner start -i ./mainnetData/set.ipc
-After this command is executed, please check the results in the log file. If the output "valid", it means success, if the output "invalid", it means failure
After this step is completed, the node will meet the necessary conditions for participating in the block generation, and the block can be generated after the election is successful.
# cd setchain // setchain is the root directory of the public chain code
# git pull // Get the latest code
# make // compile the latest code
# cd build/bin
# kill <node_pid> // Stop the old version of the node process, node_pid is the process id of the node
# nohup ./set --genesis=../genesis.json --datadir=./mainnetData --contractlog --p2p_listenaddr :9090 --http_modules=fee,miner,dpos,account,txpool,set >> mainnet.log &
# ./set --ipcpath mainnetData/set.ipc p2p add fnode://39d9c0d40b01d5e588d492e3b528868d37b1fe69bdfb1fe502aee0b2ffa79cd30da464bf00883f0f511ad36c499414148b3104f058734ff6132d17e90e6. After executing this block 192, the synchronization will start.
#./set miner -i ./mainnetData/set.ipc setcoinbase "<your_account>" privateKey.txt // After executing this command, valid should be output synchronously in the log instead of invalid, which means the execution is successful
#./set miner start -i ./mainnetData/set.ipc // After executing this command, the log will synchronously output valid instead of invalid, which means the execution is successful
note: -Replace the above <node_pid> and <your_account> with the information of your own node and account -For the block producing node of the current cycle, it is best to upgrade the node just after the end of the block production, so that you can get the most generous upgrade time (try not to affect the block production of the node), about 6 minutes (20 * 6 * 3 = 360s) -For the block producing node, observe whether the block is produced normally when it is your turn to produce the block. If the block is not produced normally, you need to locate the problem