Spin up remote vps
Download SSH key pem file
Host Machine Setup
1: update linux
sudo apt-get updatesudo apt-get upgrade
2: Create a new .pem file and copy and paste the public key from the .pem file you previously downloaded from AWS.
touch key.pemnano key.pem
Ctrl+x and saveChmod 600 key.pem (it will not work if you don't change these permissions)
3: Clone repo
git clone https://github.com/Bonfida/audaces-perps.git
4: Edit the hosts.yaml file
cd /bonfida-perps/cranker/ansiblenano hosts.yaml
Next to ansible_host enter the IP address of the vps you created.
Next to ansible_ssh_private_key_file enter the full path of the .pem file we created in step 2.
5:Add your wallet
For the example we are using sollet.io, navigate to www.sollet.io, create or restore a wallet.
Press the ^ on the right side to expand the window, and click on the “export” button on the bottom right.
Slide the “reveal” button to show the text, and copy the full text.
Navigate to the wallet.json file ( you will need to create the file)
cd bonfida-perps/crankertouch wallet.jsonnano wallet.json
Ctrl-x to save
Create the file .env in cranker/pm2 folder.
This is the environment file that contains the variable SLACK_URL. You can leave it blank if you are not planning to receive Slack alerts when the node encounters an error
6: launch the ansible playbook
Navigate to /bonfida-perps/cranker/ansible directory.
Enter the command:
ansible-playbook -i hosts.yaml setup.yaml
(this will only be used the first time launching the playbook to do the initial setup of the vps. After this any changes that need to be pushed can use the command:
ansible-playbook -i hosts.yaml update.yaml
Push the .env and wallet.json files to your remote machine by running the following Ansible playbook:
ansible-playbook -i hosts.yaml env_files.yaml
7. SSH into your node and navigate to index.js in the pm2 folder
cd audaces-perps/cranker/pm2nano index.js
Edit the fee payer line by adding in the path to your wallet file which should be located in bonfida-perps/cranker
Edit the Endpoint line by adding your chosen endpoint, example uses:
To check output of logs you can use the command:
pm2 logs -f