User Tools

Site Tools


network:chianetwork:testnet

How to use Testnet on Windows?

Below you will find the instructions for joining testnet7 using a Windows machine. This guide is for farmers that want to run the testnet on the same machine as their mainnet. If you want to do it on a seperate device, please see https://github.com/Chia-Network/chia-blockchain/wiki/How-to-connect-to-the-Testnet for simple instructions.

Step 1 - Create a Windows Subsystem for Linux (WSL)

First, we need to create a Windows Subsystem for Linux (WSL).

  1. Go to the windows store and download the “Ubuntu” app.
  2. While it downloads, go to the Windows Start Button and type: “Turn Windows features on or off” and select “Windows Subsystem for Linux”, click OK. Then, reboot your system.
  3. Open the command prompt and type wsl –set-default-version 1. WSL1 better supports access to your ntfs-formatted windows drives through the automatic mount points /mnt/<drive letter>, including network shares, which makes file transfers and access between Linux and Windows much easier when we start plotting.
  4. Open the Ubuntu app. This will prompt an install, which will take a few minutes.
  5. Once finished, create a username and set a password (the password input won’t preview).

You are now able to use the Linux CLI in Windows!

Make sure to install the latest updates for your security with sudo apt update and sudo apt full-upgrade.

For more information see: https://www.windowscentral.com/install-windows-subsystem-linux-windows-10

Step 2 - Installing Chia

You may now proceed to follow the procedure outlined in the Chia Network wiki install instructions.

Note: you don’t need to install the GUI parts, as our CLI obviously won’t have a use for it.

Below you find the relevant code:

# Install Git
sudo apt install git -y
# Checkout the source and install
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
cd chia-blockchain
sh install.sh
. ./activate

Step 3 - Prepare the config.yaml

  1. Initialize the chia process by: chia init
  2. point to testnet7 instead of mainnet: chia configure -t t

Now comes a tricky part. Using chia configure -t t doesn’t change all the ports instantly. the previous step only changed the target network from mainnet to testnet7 and the external port from 8444 to 58444 in config.yaml. All other internal TCP ports are 8XXX, just like your Windows running the mainnet instance. This will lead to TCP ports conflicts.

To change this, we need to go to the config.yaml file and change all 8xxx ports to 58xxx ports (about 10 occurences), change the 55400 to 58400 (2 occurences) and change the 9256 port to 59256 (1 occurence). You can do this by

  • using nano ~/.chia/mainnet/config/config.yaml in the Linux CLI (use the arrow keys to navigate).

Safe your changes using ctrl+O and then hit enter. Use ctrl+X to close the nano instance and return to your Linux CLI.

  • or by navigating in the Windows File Explorer to

\\wsl$\Ubuntu 20.04\home\<username>\ .chia\mainnet\config\config.yaml and changing the config.yaml using Notepad. Safe the config.yaml file after the edits.

Step 4 - Start Chia on testnet7

It’s time to start synching the testnet7 blockchain and the wallet. This is done by using chia start farmer.

At this point, if you get an error try to retrace the previous steps. Still having issues? Our experts will support you in our Discord channel

See if all processes started correctly by using ps -Af | grep chia use the command chia show -s -c to see how far you have synched and to see your connected peers.

add chia show -a testnet-node.chia.net:58444 to add a fast peer.

Step 5 - Syncing the testnet blockchain

Now it is time to get up to speed on the testnet blockchain. There are two ways to sync the testnet blockchain:

  • Downloading the db file from the Chia Github (+-12minutes)
  • Synchronizing the blockchain through a peer-to-peer network (+-8 hours)

Downloading the testnet db

  1. You can download the testnet db file from the chia github
  2. Stop all the chia processes with chia stop -d all
  3. Check all are gone with ps -Af | grep chia
  4. cd ~/.chia/mainnet/db
  5. mv blockchain_v1_mainnet.sqlite blockchain_v1_mainnet.sqlite.bak (to make a backup of the current db)
  6. copy the downloaded db to ~/.chia/mainnet/db (two ways to do this)
  • do it from Windows in the File Explorer using \\wsl$\<distro name>\home\<user>\.chia\db as the target path of the copy;
  • or do it from WSL, if you downloaded the db in e.g. D:\Temp, that would be cp /mnt/d/Temp/blockchain_v1_mainnet.sqlite ~/.chia/mainnet/db/

When you are done copying, you can restart all the Chia processes by using chia start farmer

If the node restarts properly, don't forget to cleanup the database backup rm ~/.chia/mainnet/db/blockchain_v1_mainnet.sqlite.bak

Synchronising peer-to-peer

For this method you have to do nothing but wait. Keep tracking your synchronization progress by using command chia show -s -c to see how far you have synched and to see your connected peers.

Step 6 - Using testnet

Once you are fully synched, you can start making (pool) plots and interact with testnet. In the meantime, try to get your hands on some TXCH (testnet Chia) by asking your friends. Don’t have friends? No problem, you can always ask us on Discord. You can find your keys by using chia keys show.

An community built explorer for testnet can be found here: https://xch-testnet7.flaxexplorer.org/ You may join the SpaceFarmer testnet pool by asking in our Discord.

network/chianetwork/testnet.txt · Last modified: 2021/09/14 21:22 by vleesbanaan