Starcoin Wiki
MoveMove 社区Aptos WikiSui Wiki
English
English
  • 🎉Welcome
  • 💫Overview
    • Vision & Mission
    • White Paper
  • 📖Get Started
    • Wallet
      • StarMask
      • OneKey
    • Trading
    • Run Node
      • Windows
        • Run a node on Windows
        • Upgrade & Migrate a node on Windows
      • Docker
        • Run a node with Docker
        • Upgrade & Migrate a node with Docker
      • FAQ
    • Block Explorer
  • ⛏️Mining
    • GoldShell S1 Mini
    • GoldShell STC Box
    • Mining on CPU
    • Mining on GPU
  • 🏛️Governance
    • Poll
    • Airdrop
    • Grants
  • 🏞️Eco
    • Move
    • DeFi
      • BFly
      • WENWEN Protocol
    • Swap
      • Starswap
      • Kikoswap
      • Aswap
    • NFT
      • CyberRare
      • KikoVerse
    • GameFi
      • Arm Wrest War
Powered by GitBook
On this page
  • Environment
  • Run a node
  • Export account and private key
  • Connect to the Starcoin console
  • View account and export private key
  • View account public key and balance
  • Exit the console
  • Block explorer

Was this helpful?

Edit on GitHub
  1. Get Started
  2. Run Node
  3. Docker

Run a node with Docker

Environment

Ubuntu/CentOS and other systems (including Windows 10 Professional Edition, similar commands) with Docker installed, and docker is running.

Run a node

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

Export account and private key

Connect to the Starcoin console

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

View account and export private key

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! ! !

View account public key and balance

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.

Exit the console

Command:

$ exit

Block explorer

PreviousDockerNextUpgrade & Migrate a node with Docker

Last updated 3 years ago

Was this helpful?

Website:

📖
https://stcscan.io