3. Testnet Setup
If you haven't already, you will need to clone the Chia Blockchain repository, then follow the below steps to set it up and configure it for the testnet.
Setup
If you are using Windows, we recommend PowerShell, and you may need to replace forward slashes /
with backslashes \
.
- Open the
chia-blockchain
folder in a command prompt of your choice. - Set the environment variable
CHIA_ROOT
to~/.chia/testnet
. - Run
./Install.ps1
on Windows or./install.sh
on MacOS or Linux. - Run
. ./activate
to use the Python virtual environment. - Run
chia init
to setup and configure Chia. - Run
chia keys generate
to prepare the wallet keys. - Run
chia configure -t true
to use the Testnet. - Download the Testnet database and place it in the
~/.chia/testnet11/db
folder. - Finally, run
chia start node
to start the full node.
Faucet
Now you can set up the wallet and use a faucet to receive Testnet coins to use in the upcoming guides.
- Run
chia start wallet
to start the wallet. - Run
chia wallet get_address
to get the next wallet address. - Go to the Testnet faucet and give it your address.
- Wait a minute or two and run
chia wallet show
to check your balance.
Peers
If you were previously running on mainnet, you will have a list of mainnet peers stored in the following file:
~/.chia/mainnet/db/peers.dat
Be sure to rename or delete this file when you convert your system to running on testnet. If you do not do this, your system will eventually drop its mainnet peers and add new testnet peers, but this could take a long time.
One way to speed up the peer discovery process even more is to run the add-nodes bash script. Note that this script won't work on Windows. Your mileage also may vary on Linux and MacOS.
Conclusion
You should now be ready to use the Testnet to create and spend smart coins. As always, if you ran into any issues while setting up the Testnet, feel free to ask for support on our Discord.