Ubuntu/CentOS and other systems (including Windows 10 Professional Edition, similar commands) with Docker installed, and docker is running.
Run the following command to run the node:
$ 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
Hint:
- If you don't need to start the mining pool function, you can remove -p 9880:9880, and the last parameter --stratum-address 0.0.0.0 --stratum-port 9880;
- -n main: Specify the main network main, the test network can be changed to barnard;
- --miner-thread 0: The number of mining threads, which can be adjusted by yourself;
Check the running status of the node:
$ sudo docker ps -a
Enter the server and run this command:
$ sudo docker exec -it starcoin-main /bin/bash
Connect to the console and see that starcoin%
is returned at the end, which means that you have successfully reached the console:
/starcoin/starcoin --connect /data/starcoin/main/starcoin.ipc console
Prerequisite: Connecting the Starcoin console.
View the default account:
account default
Export the private key of the default account:
account export 0x8b79fdf7bd004b72ea4bd83289429455
As shown in the figure below, the account and private key are exported, and the private key must be saved! ! !
Command:
account show 0x8b79fdf7bd004b72ea4bd83289429455
Field explanation:
- public_key: Account public key;
- balances: Account balance. 0x000000000000000000000000000001::STC::STC STC balance, the precision is 9 digits, the balance will increase after the block is produced.
Command:
$ exit
Website: https://stcscan.io