Join Mainnet
Quickstart
Install atomd
Follow the installation prerequisites document to install the ATOM Network Node binary atomd.
Configuration
Configure your node with a moniker
Download compressed genesis state
Put the
genesis.json
file in the corresponding location
atomd init chooseanicehandle --chain-id atomd_168-1wget https://github.com/ionicNetwork/mainnet/raw/main/genesis.atom_168-1.json.gzgzip -d genesis.ionic_168-1.json.gzmv genesis.ionic_168-1.json ~/.ionic/config/genesis.json
Start ATOM Network Node
atomd start --p2p.seeds [email protected]:26656 --x-crisis-skip-assert-invariants
To save those seeds to your settings, put the comma-separated list format seeds in ~/.ionc/config/config.toml
in the p2p section under seeds.
Manual Setup
These instructions are for setting up a brand new full node from scratch.
Ensure the latest atom version installed. First, initialize the node.
atom d init <your_custom_moniker> --chain-id atom _168-1
Note Monikers can contain only ASCII characters. Using Unicode characters is not supported and renders your node unreachable.
By default, the init
command creates your ~/.
atom directory with subfolders config
and data
. In the config
directory, the most important files for configuration are app.toml
and config.toml
.
You can edit the moniker
in the ~/.
atom /config/config.toml
file:
# A custom human readable name for this nodemoniker = "<your_custom_moniker>"
For optimized node performance, edit the ~/.
atom /config/app.toml
file to enable the anti-spam mechanism and reject incoming transactions with less than the minimum gas prices:
# 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 (for example, 10attoatom). minimum-gas-prices = "1000000000attoatom"
Your full node has been initialized!
Genesis & Seeds
Copy the Genesis File
Fetch the mainnet's genesis.json
file into atomd's config directory.
mkdir -p $HOME/.atom/configwget https://github.com/atomNetwork/mainnet/raw/main/genesis.ionic-1.json.gzgzip -d genesis.atom_168-1.json.gzmv genesis.atom_168-1.json $HOME/.atom/config/genesis.json
If you want to connect to the public testnet instead, click here
To verify the correctness of the configuration run:
atomd start
Add Seed Nodes
Your node needs to know how to find peers. You'll need to add healthy seed nodes to $HOME/.
atom/config/config.toml
. The launch
(opens in a new tab) repo contains links to some seed nodes.
Run a Full Node
Start the full node with this command:
atomd start
Check that everything is running smoothly:
atomd status
View the status of the network with the atom Explorer(opens in a new tab).
Verify Mainnet
Help prevent a catastrophe by running invariants on each block on your full node. In essence, by running invariants, you ensure that the state of mainnet is the correct expected state. One vital invariant check is that no atom are being created or destroyed outside of the expected protocol, however, there are many other invariant checks each unique to their respective module. Because invariant checks are computationally expensive, they are not enabled by default. To run a node with these checks, start your node with the assert-invariants-blockly flag:
atomd start --assert-invariants-blockly
If an invariant is broken on your node, your node will panic and prompt you to send a transaction which will halt mainnet. For example, the provided message may look like:
invariant broken: loose token invariance: pool.NotBondedTokens: 100 sum of account tokens: 101 CRITICAL please submit the following transaction: atomd tx crisis invariant-broken staking supply
When submitting an invariant-broken transaction, transaction fee tokens are not deducted as the blockchain will halt (invariant-broken transactions are free transactions).
Enable the REST API
By default, the REST API is disabled. To enable the REST API, edit the ~/.
ionic/config/app.toml
file, and set enable
to true
in the [api]
section.
################################################################################## API Configuration ##################################################################################[api]# Enable defines if the API server should be enabled.enable = true# Swagger defines if swagger documentation should automatically be registered.swagger = false# Address defines the API server to listen on.address = "tcp://0.0.0.0:1317"
Optionally, you can activate swagger by setting swagger
to true
or changing the port of the REST API in the parameter address
. After restarting your application, you can access the REST API on YOURNODEIP:1317
.
GRPC Configuration
By default, gRPC is enabled on port 9090
. In the ~/.
ionic/config/app.toml
file, you can make changes in the gRPC section. To disable the gRPC endpoint, set enable
to false
. To change the port, use the address
parameter.
################################################################################## gRPC Configuration ##################################################################################[grpc]# Enable defines if the gRPC server should be enabled.enable = true# Address defines the gRPC server address to bind to.address = "0.0.0.0:9090"
Background Process
To run the node in a background process with automatic restarts, you can use a service manager like systemd
. To set this up, run the following:
sudo tee /etc/systemd/system/ionicd.service > /dev/null <<EOF [Unit]Description=atom Network DaemonAfter=network-online.target [Service]User=$USERExecStart=$(which atomd) startRestart=alwaysRestartSec=3LimitNOFILE=4096 [Install]WantedBy=multi-user.targetEOF
If you're using Cosmovisor, you want to add
Environment="DAEMON_HOME=$HOME/.ionic"Environment="DAEMON_NAME=atomd"Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
after the LimitNOFILE
line and replace $(which
ionicd)
with $(which cosmovisor)
.
Then setup the daemon
sudo -S systemctl daemon-reloadsudo -S systemctl enable ionicd
We can then start the process and confirm that it is running
sudo -S systemctl start atomd sudo service ionicd status
Export State
IONIC Network can dump the entire application state into a JSON file. This application state dump is useful for manual analysis and can also be used as the genesis file of a new network.
Export state with:
ionicd export > [filename].json
You can also export state from a particular height (at the end of processing the block of that height):
ionicd export --height [height] > [filename].json
If you plan to start a new network from the exported state, export with the --for-zero-height
flag:
ionicd export --height [height] --for-zero-height > [filename].json
Pruning of State
There are four strategies for pruning state. These strategies apply only to state and do not apply to block storage. To set pruning, adjust the pruning
parameter in the ~/.
ionic/config/app.toml
file. The following pruning state settings are available:
everything
: Prune all saved states other than the current state.nothing
: Save all states and delete nothing.default
: Save the last 100 states and the state of every 10,000th block.custom
: Specify pruning settings with thepruning-keep-recent
,pruning-keep-every
, andpruning-interval
parameters.
By default, every node is in default
mode which is the recommended setting for most environments. If you want to change your node pruning strategy, you must do so when the node is initialized. Passing a flag when starting ionic will always override settings in the app.toml
file, if you would like to change your node to the everything
mode then you can pass the ---pruning everything
flag when you call ionic start
.
Note: When you are pruning state you will not be able to query the heights that are not in your store.
Last updated