Install the node software

With the server configured and Docker installed, you can proceed with the node image installation and configuration.

Pull the full node Docker image.

Find the latest release on https://github.com/iotexproject/iotex-bootstrap#release-status

docker pull iotex/iotex-core:v1.12.1

Set up the environment

mkdir -p ~/iotex-var cd ~/iotex-var
export IOTEX_HOME=$PWD
mkdir -p $IOTEX_HOME/data mkdir -p $IOTEX_HOME/log mkdir -p $IOTEX_HOME/etc

Download the default node configuration

Please remember to change the correct node release version in the command below:

curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.12.1/config_mainnet.yaml > $IOTEX_HOME/etc/config.yaml

Download the genesis file

curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v1.10.0/genesis_mainnet.yaml > $IOTEX_HOME/etc/genesis.yaml

Edit the node configuration

You can change the full node configuration by editing the file: $IOTEX_HOME/etc/config.yaml.

nano $IOTEX_HOME/etc/config.yaml

Look for the externalHost and producerPrivKey fields, uncomment the respective lines, and fill in your node external IP address and your Operator Account private key:

If you are only interested in running a full node to be used as an IoTeX API Gateway, not as a Delegate Candidate, you can leave producerPrivKey empty, and your node will be assigned a random key.

Syncing from a snapshot

You can skip this section if you intend to sync the ledger of your full node starting from height 1: in this case, please notice that the synchronization process can take very long. Additionally, please take a look at Gravity Chain Binding

Running the node with API Gateway disabled

If you do not intend to enable the API Gateway for your node, you can download the official snapshot of the ledger provided by the IoTeX Foundation that does not include index data: this image is updated every day.

# Mirror 1
curl -L https://t.iotex.me/mainnet-data-latest > $IOTEX_HOME/data.tar.gz
# Mirror 2
curl -L https://storage.googleapis.com/blockchain-archive/mainnet-data-latest.tar.gz > $IOTEX_HOME/data.tar.gz

Running the node with API Gateway enabled

If you want to enable the API Gateway for your node, you can download the official snapshot of the ledger provided by the IoTeX Foundation that includes index data: this image is updated every day.

# Mirror 1
curl -L https://t.iotex.me/mainnet-data-with-idx-latest > $IOTEX_HOME/data.tar.gz
# Mirror 2
curl -L https://storage.googleapis.com/blockchain-archive/mainnet-data-with-idx-latest.tar.gz > $IOTEX_HOME/data.tar.gz

Finally, uncompress the data:

tar -xzf data.tar.gz

Syncing from blockchain peers

While syncing a blockchain starting from a recent snapshot is very convenient, if you are concerned about the risk of downloading a malicious file, the most secure way to bootstrap a full node is always to let it sync with other blockchain peers starting from height 1.

In this case, the syncing time may take very long, depending on the network speed of your server and that of the peers it's connected to.

When the IoTeX Network Alpha and Beta releases were launched, delegates election data (i.e. staking and delegation of IOTX tokens) relied on a smart contract on the Ethereum network. Only with the release of IoTeX 1.0 election data was moved to an IoTeX native smart contract first, and eventually to custom transactions at the protocol level.

When syncing your full node from height 1 your nod will have to also index that legacy Ethereum smart contract to get the initial election data, which will require access to an Ethereum API Gateway. You have two options in this case:

Syncing without fetching Legacy Election data

If you don't want to index the Ethereum smart contract for legacy election data, before starting your node syncing you can download only the election data snapshot that includes the data from Ethereum:

curl -L https://storage.googleapis.com/blockchain-golden/poll.mainnet.tar.gz > $IOTEX_HOME/poll.tar.gz; tar -xzf $IOTEX_HOME/poll.tar.gz --directory $IOTEX_HOME/data

Syncing and also fetch Legacy Election data

If you want to sync the chain from height 1 and also fetch legacy delegate election data from Ethereum, then you need to change the gravityChainAPIs setting in your config.yaml with your Infura API endpoint. Please notice that your Infura key must have Ethereum archive mode enabled. Alternatively, change the API endpoint to an Ethereum archive node that you can access.

Last updated