Chia Test Environment
I want to develop some little tools for myself. But i dont want to play around with my real money in the case i mess it up. So i need a test environment connected to chia testnet
Deploying lxd
I use lxd on rasbian (arm64 / 64 bit arm) and on my workstation (amd64) for this.
Install and configure lxd / lxc in a way it works for you. This is what i did:
What environment am i on
To get the right packages i want to know on which environment i am working.
So iam on Debian 11 (wich is my current raspbian version)
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
And whats the architecture?
aarch64
so i am on a 64bit arm processor
Deploying Ubuntu Image for my Testhost
For the next steps i sudo
ed to root. So i am root for all these steps.
If you prefer to not be root you should add sudo
to all these (lxc related) commands.
So what are the right images for my host?
my choice is ubuntu/jammy/cloud
i don't want my testhost to start automatically (resources)
OK Login to Container and Test
Looks good
putting it all together
Fast forward launching an image when lxd / lxc is prepared
Launch a image
Prepare it for ansible.
Configuring a development environment with ansible
Prerequesites
So i installed ansible on my ubuntu development machine (not "chiatest" VM. My Development Workstation)
sudo apt install ansible
#no clue why i also need this python module. but was necessary
pip install ansible
Create your ssh private public keypair
if you haven't already. Create a ssh private public keypair
Save it in default path ~/.ssh/id_rsa
. Ansible will be using key and public-key from default path.
Ansible Inventory and Playbook
Clone this repoository https://github.com/RudolfAchter/chia-test-environment
Follow instructions
Basically what the ansible playbook does
- https://github.com/RudolfAchter/chia-test-environment/blob/main/src/ansible/playbook/chia-test.yml
- It installs ubuntu desktop
- Installs all necessary packages for chia full node
- installs xrdp and git
So you have a virtual desktop environment where you can play around with your chia full node.
Remote Development
My virtual Machine does not hav as many recsources as my workstation has. And via Remote Desktop Protocol, VNC or whatever your developmet will not run as smooth as on a local machine. I am using VS Code as my development IDE. One feature i like very much is Remote Development using SSH.Install Remove Development Extensionpack in VsCode.
In VS Code Press F1
or CTRL + P
and run command "Remote-SSH: Add new Host
Beforehand your public key must be in file ~/.ssh/authorized_keys
of user chia. If you installed the test environment with my ansible script then the key should already be there. Enter the ssh command to login to your remote SSH Host. For example ssh chia@chia-wallet01.fritz.box
per default the ssh config file of your user will be updated. You simply can press enter again.
After adding this Host you can connect to it.
Choose you connected host and press enter
A new vscode Window opens. Look at the top of the new window. Maybe VsCode asks you the host Type of the new Host to install a vscode Server. Choose Linux if you are asked.
Start a new Terminal there when you are connected
You see you are now chia@chia-wallet01