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

1
# You can run all of these commands from your home directory
2
cd $HOME
3
4
# Initialize the genesis.json file that will help you to bootstrap the network
5
antliad init <moniker name> --chain-id=antliachain
6
7
# Create a key to hold your validator account
8
antliacli keys add validator
9
10
# Add that key into the genesis.app_state.accounts array in the genesis file
11
# NOTE: this command lets you set the number of coins. Make sure this account has some coins
12
# with the genesis.app_state.staking.params.bond_denom denom, the default is staking
13
antliad add-genesis-account $(antliacli keys show validator -a) 1000000000stake
14
15
# Generate the transaction that creates your validator
16
antliad gentx --name validator
17
18
# Add the generated bonding transaction to the genesis file
19
antliad collect-gentxs
20
21
# Now its safe to start `antliad`
22
antliad start
Copied!
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.
1
# Work from the SDK repo
2
cd $GOPATH/src/github.com/cosmos/gaia
3
4
# Build the linux binary in ./build
5
make build-linux
6
7
# Build tendermint/antliadnode image
8
make build-docker-antliadnode
Copied!

Run Your Testnet

To start a 4 node testnet run:
1
make localnet-start
Copied!
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:
1
make build-linux localnet-start
Copied!

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:
1
$ tree -L 2 build/
2
build/
3
├── antliacli
4
├── antliad
5
├── gentxs
6
│ ├── node0.json
7
│ ├── node1.json
8
│ ├── node2.json
9
│ └── node3.json
10
├── node0
11
│ ├── antliacli
12
│ │ ├── key_seed.json
13
│ │ └── keys
14
│ └── antliad
15
│ ├── ${LOG:-antliad.log}
16
│ ├── config
17
│ └── data
18
├── node1
19
│ ├── antliacli
20
│ │ └── key_seed.json
21
│ └── antliad
22
│ ├── ${LOG:-antliad.log}
23
│ ├── config
24
│ └── data
25
├── node2
26
│ ├── antliacli
27
│ │ └── key_seed.json
28
│ └── antliad
29
│ ├── ${LOG:-antliad.log}
30
│ ├── config
31
│ └── data
32
└── node3
33
├── antliacli
34
│ └── key_seed.json
35
└── antliad
36
├── ${LOG:-antliad.log}
37
├── config
38
└── data
Copied!
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:
1
docker logs -f antliadnode0
Copied!

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:
1
antliacli keys list --home ./build/node0/antliacli
Copied!
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:
1
# Run with custom binary
2
BINARY=antliafoo make localnet-start
Copied!