Guides |

Connecting to a remote Gno chain (from scratch)

Back Author:  zivkovicmilos 2 min to read Check on repo

This guide covers how to start a local Gno node and connect to an existing chain (like a testnet).

Prerequisites #

1. Initialize the node directory #

To initialize a new gno.land node working directory (configuration and secrets), make sure to follow the steps from the local chain setup tutorial on gnops.io.

2. Obtain the genesis.json of the remote chain #

The genesis file of target chain is required in order to initialize the local node.

Obtain the file by

  • Sharing via scp or ftp
  • Fetching it from {chain_rpc:26657}/genesis (might result in time-out error due to large file sizes)
  • Downloading it from the misc/deployments chain directory on GitHub

3. Confirm the validator information of the node #

gnoland secrets get node_id

{
    "id": "g17h5t86vrztm6vuesx0xsyrg90wplj9mt9nsxng",
    "p2p_address": "[email protected]:26656"
}

Public IP of the Node #

You need the IP information about the network interface that you wish to connect from external nodes.

If you wish to only connect from nodes in the same network, using a private IP should suffice.

However, if you wish to connect from all nodes without any specific limitations, use your public IP.

curl ifconfig.me/ip # GET PUBLIC IP

# 1.2.3.4 # USE YOUR OWN PUBLIC IP

4. Configure the persistent_peers list #

We need to configure a list of nodes that your validators will always retain a connection with. To get the local P2P address of the current node (these values should be obtained from remote peers):

gnoland secrets get node_id.p2p_address

"[email protected]:26656"

We can use this P2P address value to configure the persistent_peers configuration value

gnoland config set p2p.persistent_peers "[email protected]:26656"

5. Configure the seeds #

We should configure the list of seed nodes. Seed nodes provide information about other nodes for the validator to connect with the chain, enabling a fast and stable initial connection. These seed nodes are also called bootnodes.

Optain the most up to date information on active seed nodes form the relevant misc/deployments configuration, or the core team.

For example, you can set it with:

gnoland config set p2p.seeds "[email protected]:26656"

6. Start the node #

Now that we’ve set up the local node configuration, and added peering info, we can start the gno.land node:

gnoland start \
--genesis ./genesis.json \
--data-dir ./gnoland-data

That’s it! 🎉

Your new Gno node should be up and running, and syncing block data from the remote chain.

Gnops is a community project. Check out the GitHub Repo.