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.
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:
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.
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>
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
You can initialize
fetchdby 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_HOMEfolder, which default to
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
Finally, you will need to connect
fetchdby getting it to connect to a seed node for the given network:
fetchd start --p2p.seeds=<network seed peers>
If you wish to connect to the Dorado testnet for example, you would need to follow the steps provided below:
You would need to initialize a new Fetch.ai node (e.g.,
my-first-fetch-node) with the chain ID
dorado-1using the following command:
fetchd init my-first-fetch-node --chain-id dorado-1
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
Then, you would need to start the Fetch.ai node with specific seed nodes on the Dorado testnet using the following command:
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.
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.