How to run full node

Fullnodes Functions

  • Stores the full blockchain history on disk and can answer the data request from the network.
  • Receives and validates the new blocks and transactions.
  • Verifies the states of every account.

Supported Platforms

We support running a full node on Linux.

Hardware Recommendation

  • Directly facing internet
  • 16 cores CPU
  • 32GB of RAM
  • SSD storage
If you are running a node in Testnet, 2CPU/8GB of RAM is sufficient.

Steps to Run a Fullnode

Prepare junca client software

Build from source code¶
Create new directory for the project
mkdir -p $GOPATH/src/
cd $GOPATH/src/
  • Download source code and build
git clone juncachain
cd juncachain
  • Checkout the latest version (e.g v0.2.0)
git pull origin --tags
git checkout v0.2.0
  • Build the project
make all
  • Binary file should be generated in build folder $GOPATH/src/
alias junca=$GOPATH/src/
Download JuncaChain binary from Github release page
Download junca binary from our releases page (e.g v0.2.0)
tar xf junca-linux-amd64-v0.2.0.tar.gz
alias junca=build/bin/junca

Download genesis block

$GENESIS_PATH : location of genesis file you would like to put
export GENESIS_PATH=path/to/genesis.json
  • Testnet
curl -L -o $GENESIS_PATH
  • Mainnet
curl -L -o $GENESIS_PATH

Create datadir

  • create a folder to store juncachain data on your machine
export DATA_DIR=/path/to/your/data/folder
mkdir -p $DATA_DIR/junca

Initialize the chain from genesis

junca init $GENESIS_PATH --datadir $DATA_DIR

Initialize / Import accounts for the nodes's keystore

If you already had an existing account, import it. Otherwise, please initialize new accounts
export KEYSTORE_DIR=path/to/keystore
Initialize new accounts
junca account new \
--keystore $KEYSTORE_DIR
Import accounts
junca account import [PRIVATE_KEY_FILE_OF_YOUR_ACCOUNT] \
--keystore $KEYSTORE_DIR \
List all available accounts in keystore folder
junca account list --datadir $DATA_DIR --keystore $KEYSTORE_DIR

Start a node

Environment variables
  • $IDENTITY: the name of your node
  • $PASSWORD: the password file to unlock your account
  • $YOUR_COINBASE_ADDRESS: address of your account which generated in the previous step
  • $NETWORK_ID: the networkId. Mainnet: 668. Testnet: 669
  • $BOOTNODES: The comma separated list of bootnodes. Find them Mainnet here Testnet here
Let's start a node
junca --syncmode "full" \
--datadir $DATA_DIR --networkid $NETWORK_ID --port 30303 \
--keystore $KEYSTORE_DIR --password $PASSWORD \
--identity $IDENTITY \
--mine --miner.gasprice 250000000 --miner.etherbase $YOUR_COINBASE_ADDRESS \
--bootnodes $BOOTNODES
If you are a dapp developer, you should open RPC and WS apis:
junca --syncmode "full" \
--datadir $DATA_DIR --networkid $NETWORK_ID --port 30303 \
--keystore $KEYSTORE_DIR --password $PASSWORD \
--identity $IDENTITY \
--mine --miner.gasprice 250000000 --miner.etherbase $YOUR_COINBASE_ADDRESS \
--http --http.port=8545 \
--ws --ws.port=8546 \
--bootnodes $BOOTNODES