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
-
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/
. -
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
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:
-
You would need to initialize a new Fetch.ai node (e.g.,
my-first-fetch-node
) with the chain IDdorado-1
using 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:
# start fetchd start --p2p.seeds=eb9b9717975b49a57e62ea93aa4480e091ae0660@connect-dorado.fetch.ai:36556,46d2f86a255ece3daf244e2ca11d5be0f16cb633@connect-dorado.fetch.ai:36557,066fc564979b1f3173615f101b62448ac7e00eb1@connect-dorado.fetch.ai:36558
-
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.