How to setup a Cranker
Need Help - View our video tutorial - https://www.youtube.com/watch?v=87EeXr3WthI
Recommended to use AWS lightsail Ubuntu 18.04
Demonstration uses Ubuntu 18.04 LTS OS on a basic instance. For best results use a vps with 2GB ram.
(make sure the username on the vps is “ubuntu” if it is not then you will have to edit multiple files in the setup to account for a different username)
  • Spin up remote vps
  • Download SSH key pem file
Record Public IP address, it will be used on the host machine.
(recommend setting this to a static IP address)
Host Machine Setup
1: update linux
1
sudo apt-get update
2
sudo apt-get upgrade
Copied!
2: Create a new .pem file and copy and paste the public key from the .pem file you previously downloaded from AWS.
1
touch key.pem
2
nano key.pem
Copied!
(insert entire contents of downloaded .pem file)
1
Ctrl+x and save
2
Chmod 600 key.pem (it will not work if you don't change these permissions)
Copied!
You will need to know the file path of this key.pem file in the next step. You can use this command to display the path, then copy it down.
1
realpath key.pem
Copied!
3: Clone repo
1
git clone https://github.com/Bonfida/audaces-perps.git
Copied!
4: Edit the hosts.yaml file
1
cd /bonfida-perps/cranker/ansible
2
nano hosts.yaml
Copied!
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.
(you can set up multiple vps at the same time, but for now we are only doing one. You can delete the other blank hosts.)
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)
1
cd bonfida-perps/cranker
2
touch wallet.json
3
nano wallet.json
Copied!
Paste the text you copied from sollet.io wallet export.
  • Ctrl-x to save
  • Create the file .env in cranker/pm2 folder.
touch .env
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:
1
ansible-playbook -i hosts.yaml setup.yaml
Copied!
(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:
1
ansible-playbook -i hosts.yaml update.yaml
Copied!
Push the .env and wallet.json files to your remote machine by running the following Ansible playbook:
1
ansible-playbook -i hosts.yaml env_files.yaml
Copied!
Node setup
7. SSH into your node and navigate to index.js in the pm2 folder
1
cd audaces-perps/cranker/pm2
2
nano index.js
Copied!
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:
Solana RPC
Could not load image
Monitoring
To check output of logs you can use the command:
pm2 monit
Or:
pm2 logs -f
Last modified 4mo ago
Copy link