Fetch Network
Ledger
How to join a testnet
FetchdLedgerTestnetBlockchainUser-flow

How to join a testnet

You can join a test network by first having the correct version of the fetchd ledger available on your system.

Using a local version

If you have correctly followed the installation ↗ī¸ guide, then you should now have fetchd successfully installed in your path. You can check this by running the following command:

fetchd version
ℹī¸

This should print a version number that must be compatible with the network you are connecting to.

You can check the network page ↗ī¸ for the list of supported versions for each network.

Configuring the client fetchd

In general, you can 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 test network, this would be as follows:

fetchd config chain-id dorado-1
fetchd config node https://rpc-dorado.fetch.ai:443

Configuring the server fetchd

  1. You can initialize fetchd by running the following command:

    fetchd init <moniker-name> --chain-id <chain id>
    ℹī¸

    This command setups a default/empty genesis configuration.

    ℹī¸

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

  2. You will then need to execute the following command to download the latest genesis file:

    curl <rpc url>/genesis | jq '.result.genesis' > ~/.fetchd/config/genesis.json
  3. Finally, you will need to connect fetchd by getting it to connect to a seed node for the given network:

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

Dorado Example

If you wish to connect to the Dorado testnet for example, you would need to follow the steps provided below:

  1. You would need to initialize a new Fetch.ai node (e.g., my-first-fetch-node) with the chain ID dorado-1 using the following command:

    fetchd init my-first-fetch-node --chain-id dorado-1
  2. You would then need to get the genesis file, which contains the initial state of the blockchain. You can get it either from the RPC interface with:

    # genesis
    curl https://rpc-dorado.fetch.ai:443 | jq '.result.genesis' > ~/.fetchd/config/genesis.json
     
    # ...or, if that's too large to download from the rpc interface as a single file...
    curl https://storage.googleapis.com/fetch-ai-testnet-genesis/genesis-dorado-827201.json --output ~/.fetchd/config/genesis.json
  3. Then, you would need to start the Fetch.ai node with specific seed nodes on the Dorado testnet using the following command:

    # start
    fetchd start --p2p.seeds=eb9b9717975b49a57e62ea93aa4480e091ae0660@connect-dorado.fetch.ai:36556,[email protected]:36557,066fc5[email protected]:36558
  4. Your local node will now synchronize with the network, replaying all blocks and transactions. This process may take some time depending on factors like the network's age and your disk speed. Consider using chain snapshots ↗ī¸ to speed up this process.

  5. You can query your node's status from its RPC API to know when it has finished syncing by running:

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

    If the response is false, your node is up-to-date.

Was this page helpful?