Node
Perpetual nodes secure the Audaces protocol by cranking transactions. Anyone can run a node and help secure the protocol. The cranking transactions are:
  • Liquidations
  • Funding rates
  • Funding extraction
  • Garbage collection
A Rust executable as well as a Typescript client can be found on Github to set up your own cranking node.

Rust Executable

It is recommended to use the Rust client
The cranker can be deployed on a small VPS, for instance an AWS LightSail VPS or a Bahnhof VPS.
The Github repository contains an Ansible playbook to automate the entire setup of the server. In order to deploy the cranker, you will only need to change the hosts.yaml file. For example, let's say you want to deploy a cranker in two AWS zones: Dublin and Tokyo, the hosts.yaml file could look like
1
tokyo:
2
hosts:
3
tokyo_1:
4
ansible_host: ip_of_your_server
5
ansible_ssh_private_key_file: path_to_your_ssh_key_file
6
7
dublin:
8
hosts:
9
dublin_1:
10
ansible_host: ip_of_your_server
11
ansible_ssh_private_key_file: path_to_your_ssh_key_file
12
Copied!
You also need to setup the wallet with which you want to crank using the wallet.json file in the cranker folder.

Ansible

You can then deploy your node using Ansible by running the following commands

Server setup

For the first time set up of your server use:
1
ansible-playbook -i hosts.yaml setup.yaml
Copied!

Environment files

On your local machine you will need to create the following files:
  • .env in cranker/pm2 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
  • wallet.json in cranker/ is the file containing the private key of the Solana wallet used for cranking.
In order to push these files to your remote machine run the following Ansible playbook
1
ansible-playbook -i hosts.yaml env_files.yaml
Copied!

Update your node

To update your node run the following Ansible playbook
1
ansible-playbook -i hosts.yaml update.yaml
Copied!

Stop your node

To stop your node run the following Ansible playbook
1
ansible-playbook -i hosts.yaml stop.yaml
Copied!
Last modified 3mo ago
Copy link