Skip to content

How to Connect to the Testnet

Chris Marslender edited this page Feb 17, 2022 · 25 revisions

Testnet 10 is the supported testnet. Testnet 7 may remain active, but is no longer officially supported by Chia.


How to join testnet

These steps assume you have Chia installed.

Step 1. Run chia init

Step 2. If you do not already have keys generated then run chia keys generate

Step 3. Edit ~\.chia\mainnet\config\config.yaml to include testnet10 values

If you are running a version of Chia higher than 1.2.11, proceed to step 3a below. If you are running version 1.2.11 or below, you will need to manually edit the config.yaml file to include testnet10 values. You can edit this file using a simple text editor such as Notepad, Vi, Nano, etc. or the IDE of your choice. In config.yaml, add the following testnet10 sections:

...
farmer:
...
    config:
...
      testnet10:
        address_prefix: txch
        default_full_node_port: 58444
...
    constants:
...
      testnet10:
        AGG_SIG_ME_ADDITIONAL_DATA: ae83525ba8d1dd3f09b277de18ca3e43fc0af20d20c4b3e92ef2a48bd291ccb2
        DIFFICULTY_CONSTANT_FACTOR: 10052721566054
        DIFFICULTY_STARTING: 30
        EPOCH_BLOCKS: 768
        GENESIS_CHALLENGE: ae83525ba8d1dd3f09b277de18ca3e43fc0af20d20c4b3e92ef2a48bd291ccb2
        GENESIS_PRE_FARM_FARMER_PUZZLE_HASH: 3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af
        GENESIS_PRE_FARM_POOL_PUZZLE_HASH: d23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc
        MEMPOOL_BLOCK_BUFFER: 10
        MIN_PLOT_SIZE: 18
        NETWORK_TYPE: 1 

After the above code has been added to your config.yaml, move further down the file and replace the existing entries with the following values:

full_node:
...
  dns_servers:
  - dns-introducer-testnet10.chia.net
...
  introducer_peer:
    host: introducer-testnet10.chia.net
...
wallet:
...
  introducer_peer:
    host: introducer-testnet10.chia.net
...

Once those replacements have been made, search the config.yaml file for all instances of the selected_network parameter, which should all show a value of mainnet (or potentially a different testnet). Change all selected_network parameters to show a value of testnet10. Save the file. If you have previously run chia start for this installation, at this point run chia stop all -d to ensure that no mainnet processes are still running.

Step 3a. Run chia configure --testnet true

If you are running a version of Chia greater than 1.2.11, do not perform the actions in Step 3 above, and instead run chia configure --testnet true, as this command will make your client automatically select and configure itself for the currently-active testnet. If you have previously run chia start for this installation, at this point run chia stop all -d to ensure that no mainnet processes are still running.

Step 4. Create a directory named db in the Chia root directory.

Once in root directory (~/.chia/mainnet), you can run mkdir db and cd db on Linux or if using the Windows/macOS GUI you can create the folder as normal.

Step 5. Download the Official Testnet DB (optional)

This step is optional, but it will speed up syncing with the testnet

For Linux users wget https://download.chia.net/testnet10/blockchain_v1_testnet10.sqlite while in the directory. Windows users can download it from https://downloads.chia.net/testnet10/ and move it to the db folder you created in step 4.

Step 6. Starting Your Node and Getting Peers

To start your node, run chia start farmer and wait for it to start. Once your node has started, you can connect to Chia's testnet node by using chia show -a testnet10-node.chia.net:58444. You can use chia show -s to check your sync status, and once fully synced you can run chia wallet show to see your wallet. chia wallet get_address will give you your testnet wallet address, which will differentiate itself from your mainnet wallet by beginning with txch instead of xch.

Step 7. (Optional) Getting funds

Go to Chia testnet faucet and input your testnet address from step 6. If it says you are in the queue, it has worked. Funds will not appear in your wallet until you are fully synced to the blockchain.

What to do if you are having trouble with setting up testnet

Join Our Keybase and join the #testnet channel for support

Clone this wiki locally