AntliaDaemon

Single-node, Local, Manual Testnet

This guide helps you create a single validator node that runs a network locally for testing and other development related uses.

Requirements

  • Install Antlia

  • Install jq (optional)

Create Genesis File and Start the Network

# You can run all of these commands from your home directory
cd $HOME

# Initialize the genesis.json file that will help you to bootstrap the network
antliad init <moniker name> --chain-id=antliachain

# Create a key to hold your validator account
antliacli keys add validator

# Add that key into the genesis.app_state.accounts array in the genesis file
# NOTE: this command lets you set the number of coins. Make sure this account has some coins
# with the genesis.app_state.staking.params.bond_denom denom, the default is staking
antliad add-genesis-account $(antliacli keys show validator -a) 1000000000stake

# Generate the transaction that creates your validator
antliad gentx --name validator

# Add the generated bonding transaction to the genesis file
antliad collect-gentxs

# Now its safe to start `antliad`
antliad start

This setup puts all the data for antliad in ~/.antliad. You can examine the genesis file you created at ~/.antliad/config/genesis.json. With this configuration antliacli is also ready to use and has an account with tokens (both staking and custom).

Multi-node, Local, Automated Testnet

From the networks/local directory:

Requirements

  • Install antlia

  • Install docker

  • Install docker-compose

Build

Build the antliad binary (linux) and the tendermint/antlianode docker image required for running the localnet commands. This binary will be mounted into the container and can be updated rebuilding the image, so you only need to build the image once.

# Work from the SDK repo
cd $GOPATH/src/github.com/cosmos/gaia

# Build the linux binary in ./build
make build-linux

# Build tendermint/antliadnode image
make build-docker-antliadnode

Run Your Testnet

To start a 4 node testnet run:

make localnet-start

This command creates a 4-node network using the antlianode image. The ports for each node are found in this table:

Node ID

P2P Port

RPC Port

antliadnode0

26656

26657

antliadnode1

26659

26660

antliadnode2

26661

26662

antliadnode3

26663

26664

To update the binary, just rebuild it and restart the nodes:

make build-linux localnet-start

Configuration

The make localnet-start creates files for a 4-node testnet in ./build by calling the antliad testnet command. This outputs a handful of files in the ./build directory:

$ tree -L 2 build/
build/
├── antliacli
├── antliad
├── gentxs
│   ├── node0.json
│   ├── node1.json
│   ├── node2.json
│   └── node3.json
├── node0
│   ├── antliacli
│   │   ├── key_seed.json
│   │   └── keys
│   └── antliad
│       ├── ${LOG:-antliad.log}
│       ├── config
│       └── data
├── node1
│   ├── antliacli
│   │   └── key_seed.json
│   └── antliad
│       ├── ${LOG:-antliad.log}
│       ├── config
│       └── data
├── node2
│   ├── antliacli
│   │   └── key_seed.json
│   └── antliad
│       ├── ${LOG:-antliad.log}
│       ├── config
│       └── data
└── node3
    ├── antliacli
    │   └── key_seed.json
    └── antliad
        ├── ${LOG:-antliad.log}
        ├── config
        └── data

Each ./build/nodeN directory is mounted to the /antliad directory in each container.

Logging

Logs are saved under each ./build/nodeN/antliad/antlia.log. You can also watch logs directly via Docker, for example:

docker logs -f antliadnode0

Keys & Accounts

To interact with antliacli and start querying state or creating txs, you use the antliacli directory of any given node as your home, for example:

antliacli keys list --home ./build/node0/antliacli

Now that the accounts exist, you may create new accounts and send those accounts funds!

Note: Each node's seed is located at ./build/nodeN/antliacli/key_seed.json and can be restored to the CLI using the antliacli keys add --restore command

Special Binaries

If you have multiple binaries with different names, you can specify which one to run with the BINARY environment variable. The path of the binary is relative to the attached volume. For example:

# Run with custom binary
BINARY=antliafoo make localnet-start

Last updated