Create Localnet

This document describes 3 ways to setup a network of aromd nodes, each serving a different usecase:

  1. Single-node, local, manual testnet

  2. Multi-node, local, automated testnet

  3. Multi-node, remote, automated testnet

Supporting code can be found in the networks directory(opens in a new tab) and additionally the local or remote sub-directories.

NOTE: The remote network bootstrapping may be out of sync with the latest releases and is not to be relied upon.

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 arom

  • Install jq(opens in a new tab) (optional)

Create Genesis File and Start the NetworkThis setup puts all the data for arom in ~/.arom. You can examine the genesis file you created at ~/.arom/config/genesis.json. With this configuration, arom d 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(opens in a new tab):

Requirements

  • Install arom

  • Install docker(opens in a new tab)

  • Install docker-compose(opens in a new tab)

Build

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

To start a 4 node testnet run:

Copy

Copy

make localnet-start

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

Node IDP2P PortRPC Port

aromnode0

26656

26657

aromnode1

26659

26660

aromnode2

26661

26662

iaromnode3

26663

26664

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

Copy

Copy

make build-linux localnet-start

Configuration

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

Copy

Copy

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

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

Logging

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

Copy

Copy

docker logs -f aromdnode0

Keys & Accounts

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

Copy

Copy

ionicd keys list --home ./build/node0/aromd

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

ℹ️

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

Special Binaries

You can specify which one to run with the BINARY environment variable if you have multiple binaries with different names. The path of the binary is relative to the attached volume.

Last updated