See the mainnet repo for information on the latest mainnet, including the correct version of OKTC to use and details about the genesis file.
You need to install oktc before you go further
We support running a full node on Mac OS X
, Windows
and Linux
.
The hardware must meet certain requirements to run exchaind
.
For node requirement details, please visit Node Requirement
These instructions are for setting up a brand new full node from scratch.
First, initialize the node and create the necessary config files:
exchaind init <your_custom_moniker>
NOTE: Monikers can contain only ASCII characters. Using Unicode characters will render your node unreachable.
Or you can also edit this moniker
later, in the ~/.exchaind/config/config.toml
file:
# A custom human readable name for this node
moniker = "<your_custom_moniker>"
You can edit the ~/.exchaind/config/exchaind.toml
file in order to enable the anti spam mechanism and reject incoming transactions with less than the minimum gas prices("0.000000001okt" is recommended):
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction’s fees must meet the minimum of any denomination
# specified in this config (Our recommended quantity is 10^-9 okt).
minimum-gas-prices = "0.000000001okt"
Your full node has been initialized!
Fetch the mainnet’s genesis.json
file into exchaind
’s config directory.
Note we use the latest
directory in the mainnet repo which contains details for the mainnet like the latest version and the genesis file.
To verify the correctness of the configuration run:
exchaind validate-genesis
Your node needs to know how to find peers. You’ll need to add healthy seed nodes to $HOME/.exchaind/config/config.toml
. The mainnet repo’s README.md contains some seed nodes.
You can add those seeds nodes to the seeds
filed in the ~/.exchaind/config/config.toml
file:
# Comma separated list of seed nodes to connect to
seeds = "[email protected]:26656,[email protected]:26656,[email protected]:26656"
For more information on seeds and peers, you can read this.
Start the full node with this command:
exchaind start --chain-id exchain-66
Check that everything is running smoothly:
exchaincli status
See the mainnet repo for information on mainnet, including the correct version of the OKTC to use and details about the genesis file.
These instructions are for full nodes that have ran on previous versions of and would like to upgrade to the latest mainnet.
First, remove the outdated files and reset the data.
rm $HOME/.exchaind/config/addrbook.json $HOME/.exchaind/config/genesis.json
exchaind unsafe-reset-all
Your node is now in a pristine state while keeping the original priv_validator.json
and config.toml
. If you had any sentry nodes or full nodes setup before,
your node will still try to connect to them, but may fail if they haven’t also
been upgraded.
NOTE: Make sure that every node has a unique
priv_validator.json
. Do not copy thepriv_validator.json
from an old node to multiple new nodes. Running two nodes with the samepriv_validator.json
will cause you to double sign.
Now it is time to upgrade the software:
git clone https://github.com/okx/exchain.git
cd exchain
git fetch --all && git checkout vx.y.z
make install
NOTE: If you have issues at this step, please check that you have the latest stable version of GO installed.
Note we use master
here since it contains the latest stable release.
See the mainnet repo for details on which version is needed for which mainnet, and the OKTC release page for details on each release.
Your full node has been cleanly upgraded!
You now have an active full node. What’s the next step? You can upgrade your full node to become a OKTC Validator. The top 100 validators have the ability to propose new blocks to the OKTC. Continue onto the Validator Setup.