Skip to content

Joining a testnet

In order to join the test network you will need to have the correct version of the fetchd ledger available on your system.

Using a local version

Assuming that you have followed the installation guide. You should now have fetchd successfully installed in your path. You can check this with the following command:

fetchd version

This should print a version number that must be compatible with the network you're connecting to (see the network page for the list of supported versions per network).

Configuring the client fetchd

In general to configure the CLI to point at a given network it needs as a minimum the following configuration values

fetchd config chain-id <chain-id>
fetchd config node <rpc url>

Dorado example

In the case of the Dorado network this would be as follows:

fetchd config chain-id dorado-1
fetchd config node

Configuring the server fetchd

Initialize fetchd by running command. This setups a default / empty genesis configuration.

fetchd init <moniker-name> --chain-id <chain id>

This will initialize default configuration files under the FETCHD_HOME folder, which default to ~/.fetchd/.

Execute the following command to download the latest genesis file:

curl <rpc url>/genesis | jq '.result.genesis' > ~/.fetchd/config/genesis.json

Finally connect fetchd to the network by getting it to connect to a seed node for the given network.

fetchd start --p2p.seeds=<network seed peers>

Dorado Example

Less abstractly then, if you wants to connect to the Dorado test net for example, you would need to run the following steps:

# init
fetchd init my-first-fetch-node --chain-id dorado-1

# genesis
curl | jq '.result.genesis' > ~/.fetchd/config/genesis.json
# ...or, if that's too large to download from the rpc interface as a single file...
curl --output ~/.fetchd/config/genesis.json

# start
fetchd start --p2p.seeds=[email protected]:36556,[email protected]:36557,066fc56[email protected]:36558

Your local node will then start to synchronise itself with the network, replaying all blocks and transactions up to the current block. Depending on the age of the network and your hard disk speed, this could take a while. Consider using chain snapshots to speed up this process.

To know when your node as finished syncing, you can query it's status from its RPC API:

curl -s |  jq '.result.sync_info.catching_up'
true # this will print "false" once your node is up to date