# Deploy Your Own Gaia Testnet
This document describes 3 ways to setup a network of
gaiad nodes, each serving a different usecase:
- Single-node, local, manual testnet
- Multi-node, local, automated testnet
- Multi-node, remote, automated testnet
Supporting code can be found in the networks directory and additionally the
remotenetwork bootstrapping may be out of sync with the latest releases and is not to be relied upon.
# Available Docker images
In case you need to use or deploy gaia as a container you could skip the
build steps and use the official images, $TAG stands for the version you are interested in:
docker run -it -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli tendermint:$TAG gaiad init
docker run -it -p 26657:26657 -p 26656:26656 -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli tendermint:$TAG gaiad start
docker run -it -v ~/.gaiad:/root/.gaiad -v ~/.gaiacli:/root/.gaiacli tendermint:$TAG gaiacli version
The same images can be used to build your own docker-compose stack.
# 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.
# Create Genesis File and Start the Network
This setup puts all the data for
~/.gaiad. You can examine the genesis file you created at
~/.gaiad/config/genesis.json. With this configuration
gaiacli 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:
gaiad binary (linux) and the
tendermint/gaiadnode 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.
# Run Your Testnet
To start a 4 node testnet run:
This command creates a 4-node network using the gaiadnode image. The ports for each node are found in this table:
|Node ID||P2P Port||RPC Port|
| || |
| || |
| || |
| || |
To update the binary, just rebuild it and restart the nodes:
make localnet-start creates files for a 4-node testnet in
gaiad testnet command. This outputs a handful of files in the
./build/nodeN directory is mounted to the
/gaiad directory in each container.
Logs are saved under each
./build/nodeN/gaiad/gaia.log. You can also watch logs
directly via Docker, for example:
# Keys & Accounts
To interact with
gaiacli and start querying state or creating txs, you use the
gaiacli directory of any given node as your
home, for example:
Now that accounts exists, you may create new accounts and send those accounts funds!
Note: Each node's seed is located at
./build/nodeN/gaiacli/key_seed.json and can be restored to the CLI using the
gaiacli 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:
# Multi-Node, Remote, Automated Testnet
The following should be run from the networks directory.
# Terraform & Ansible
- Install Terraform and Ansible on a Linux machine.
- Create an AWS API token with EC2 create capability.
- Create SSH keys
These will be used by both
# Create a Remote Network
The testnet name is what's going to be used in --chain-id, while the cluster name is the administrative tag in AWS for the servers. The code will create SERVERS amount of servers in each availability zone up to the number of REGION_LIMITs, starting at us-east-2. (us-east-1 is excluded.) The below BaSH script does the same, but sometimes it's more comfortable for input.
# Quickly see the /status Endpoint
# Delete Servers
You can ship logs to Logz.io, an Elastic stack (Elastic search, Logstash and Kibana) service provider. You can set up your nodes to log there automatically. Create an account and get your API key from the notes on this page, then:
You can install the DataDog agent with: