Setting up the environment and starting the testnet using Vagrant
As an option, you can use Vagrant to setup development environment.
Here is an example of setting up the development environment for MacOS.
Installation and setting up Vagrant
To set up Vagrant, follow the steps below:
brew install caskroom/cask/vagrant
If you use a VM:
For Parallels, add Parallels support to Vagrant:
vagrant plugin install vagrant-parallels
For VirtualBox (default option), modify the
PATHvariable to add the VirtualBox binary to Vagrant:
Install the hostmanager plugin to manage the
vagrant plugin install vagrant-hostmanager
Setting up the environment
To set up the environment, follow the steps below:
tpnoderepository from Github and go to
Start the virtual machine using Vagrant:
When running the Vagrant command, provisioning will be started. During the provisioning, Vagrant downloads all the necessary libraries and compiles the proper versions of Erlang and other environment components.Reboot the virtual machine after successful provisioning using the following commands:
Connect to virtual environment by running:
vagrant ssh -- -A
-A— key to ssh agent forwarding. You will be able to use ssh key from host machine to perform operations inside the virtual machine.
Compiling and starting the node
Go to the project directory:
Compile the testnet by running the following command:
Start the testnet by running the script:
Stopping the testnet
To stop the testnet, run:
Using Makefile targets
You can also use the Makefile targets as a reference on how to perform other tasks.
You can see the API ports by running:
netstat -an |grep 498
After you've started testnet you should see 9 different ports. You can use these ports for The Power nodes API calls.
API call sample:
curl http://pwr.local:49841/api/node/status | jq .
Note: the domain
pwr.localin URL is used to reference the node from virtual or host machine.