AIOZ Blockchain - EVM x Cosmos
Join Mainnet

Join Mainnet

Quickstart

Install aiozd

Follow the installation prerequisites document to install the AIOZ Network Node binary aiozd.

Configuration

  • Configure your node with a moniker
  • Download compressed genesis state
  • Put the genesis.json file in the corresponding location
aiozd init chooseanicehandle --chain-id aioz_168-1
wget https://github.com/AIOZNetwork/mainnet/raw/main/genesis.aioz_168-1.json.gz
gzip -d genesis.aioz_168-1.json.gz
mv genesis.aioz_168-1.json ~/.aioz/config/genesis.json

Start AIOZ Network Node

aiozd 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 ~/.aioz/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 aioz version installed. First, initialize the node.

aiozd init <your_custom_moniker> --chain-id aioz_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 ~/.aioz 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 ~/.aioz/config/config.toml file:

# A custom human readable name for this node
moniker = "<your_custom_moniker>"

For optimized node performance, edit the ~/.aioz/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, 10attoaioz).
 
minimum-gas-prices = "1000000000attoaioz"

Your full node has been initialized!

Genesis & Seeds

Copy the Genesis File

Fetch the mainnet's genesis.json file into aiozd's config directory.

mkdir -p $HOME/.aioz/config
wget https://github.com/AIOZNetwork/mainnet/raw/main/genesis.aioz_168-1.json.gz
gzip -d genesis.aioz_168-1.json.gz
mv genesis.aioz_168-1.json $HOME/.aioz/config/genesis.json

If you want to connect to the public testnet instead, click here

To verify the correctness of the configuration run:

aiozd start

Add Seed Nodes

Your node needs to know how to find peers. You'll need to add healthy seed nodes to $HOME/.aioz/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:

aiozd start

Check that everything is running smoothly:

aiozd status

View the status of the network with the AIOZ 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 aioz 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:

aiozd 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:
        aiozd 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 ~/.aioz/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 ~/.aioz/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/aiozd.service > /dev/null <<EOF  
[Unit]
Description=AIOZ Network Daemon
After=network-online.target
 
[Service]
User=$USER
ExecStart=$(which aiozd) start
Restart=always
RestartSec=3
LimitNOFILE=4096
 
[Install]
WantedBy=multi-user.target
EOF

If you're using Cosmovisor, you want to add

Environment="DAEMON_HOME=$HOME/.aioz"
Environment="DAEMON_NAME=aiozd"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=false"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"

after the LimitNOFILE line and replace $(which aiozd) with $(which cosmovisor).

Then setup the daemon

sudo -S systemctl daemon-reload
sudo -S systemctl enable aiozd

We can then start the process and confirm that it is running

sudo -S systemctl start aiozd
 
sudo service aiozd status

Export State

AIOZ 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:

aiozd export > [filename].json

You can also export state from a particular height (at the end of processing the block of that height):

aiozd export --height [height] > [filename].json

If you plan to start a new network from the exported state, export with the --for-zero-height flag:

aiozd 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 ~/.aioz/config/app.toml file. The following pruning state settings are available:

  1. everything: Prune all saved states other than the current state.
  2. nothing: Save all states and delete nothing.
  3. default: Save the last 100 states and the state of every 10,000th block.
  4. custom: Specify pruning settings with the pruning-keep-recent, pruning-keep-every, and pruning-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 aioz 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 aiozd start.

Note: When you are pruning state you will not be able to query the heights that are not in your store.

AIOZ Network Mainnet Information

AIOZ NetworkMainnet
Chain ID168
Ethereum JSON-RPChttps://eth-dataseed.aioz.network (opens in a new tab)
Cosmos RPChttps://rpc-dataseed.aioz.network (opens in a new tab)
Blockchain Explorer URLhttps://explorer.aioz.network (opens in a new tab)