Skip to main content

Running a Local Testnet

To have a working network we need at least one validator node. So, let's create a validator node.

Initialize the validator node

Let's first crate a directory to keep all nodes data in it.

mkdir testnet
cd testnet

Create a directory for the main node (the first node)

mkdir -p node-main

Initiate the node with the chain name:

archwayd init node-main --chain-id my-chain --home ./node-main

Create a key to hold your account.

archwayd keys add node-main-account

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.

archwayd add-genesis-account $(archwayd keys show node-main-account -a) 1000000000stake,1000000000validatortoken --home ./node-main

We need to generate a transaction creating the validator.

archwayd gentx node-main-account 1000000000stake --chain-id my-chain --home ./node-main

archwayd collect-gentxs --home ./node-main

Now let's start the validator node.

archwayd start --home ./node-main

Initialize the second node

Create a directory for the second node:

mkdir -p node2

Initiate the node with the chain name.

archwayd init node2 --chain-id my-chain --home ./node2

Fix port conflicts

Since, in this guide, we run both nodes on the same machine, there will be some port conflicts. Let's fix them before starting the node.

Open the ./node2/config/app.toml file and look for

address = ""

Then change the port to something else like this:

address = ""

Open the ./node2/config/config.toml file and look for


laddr = "tcp://"

and change it to: laddr = "tcp://"

Then find

pprof_laddr = "localhost:6060"

And change it to: pprof_laddr = "localhost:6062"

And the last thing we need to change is the listen port for p2p connections. Find:


# Address to listen for incoming connections
laddr = "tcp://"

And change it to: laddr = "tcp://"

Copy the genesis file

In order to join the local test network, we need to use the same genesis file of that network. So let's copy it from the main node and replace it on our genesis file.

cp ./node-main/config/genesis.json ./node2/config/

Find addresses of the seeds

To join a p2p network we need the addresses of nodes that we are willing to connect to. So let's find the address of the main-node via running the following command:

archwayd status

Note: Please note that this command shows the status of the running node on default port. If we want to get the status of a specific node, we need to give it the IP address and the port it is listening to. For example: archwayd status -n tcp://localhost:10002 for node2 that we just configured.

This command gives an output like the following:

"NodeInfo": {
"protocol_version": {
"p2p": "8",
"block": "11",
"app": "0"
"id": "a118197af3c66781faa0299633cc59a1622d27e3",
"listen_addr": "tcp://",
"network": "chain-main",
"version": "",
"channels": "40202122233038606100",
"moniker": "node3",
"other": {
"tx_index": "on",
"rpc_address": "tcp://"
"SyncInfo": {
"ValidatorInfo": {

All we need is

  • The id which in our example is a118197af3c66781faa0299633cc59a1622d27e3
  • The host name and its listening port (listen_addr) which here is: tcp://

Join the network

Since we are running it on our local machine, the Ip address is which refers to localhost we can use either localhost or For me even worked!

Now let's run the following command to join the network:

archwayd --home ./node2 start --p2p.seeds [email protected]:26656

Using Gex to visualize the network status

GEX is a real time in-terminal explorer for Cosmos SDK blockchains. Gex displays blocks, transactions, validator, network status, and more information. Use the GEX block explorer to see the status of peers, connection, version, and other useful information to have a quick peek into your own node.

Let's quickly install Gex to see the status of our node.

go get -u

To launch a GEX in your terminal window, type:


Please, head over to this link for more information:

Now, before connecting to the main-node, our gex looks like this:

As you can see the number of peers is zero. Now we run execute the join network command and it should look like this:

So now we successfully joined a running network.

Running a Local Testnet with docker

Docker allows us to have a running a single node local test net in an easy way. First download the repository:

git clone [email protected]:archway-network/archway.git
cd archway

Then run the following command to build the docker image:

make build-docker

Once the docker image is built successfully, run the following command:

docker-compose up

If you want to hide the terminal output, just use flag -d like this:

docker-compose up -d