This repository contains Ansible scripts for deploying snarkOS Aleo node as a systemd service on Ubuntu servers. It automates the process of installing required dependencies, setting up the Rust environment, building snarkOS from source, and configuring it to run as a validator node service.
Before you begin, ensure you have the following prerequisites met:
- Ansible Installed: You need Ansible installed on your control machine (the machine from which you are running the Ansible commands). For installation instructions, refer to the official Ansible documentation.
- SSH Access: SSH access to your target host(s) with an SSH key. The user should have
sudoprivileges without a password prompt. Ensure your SSH public key is added to the~/.ssh/authorized_keysfile on the target host(s). - Target Hosts: One or more Ubuntu servers where you wish to deploy snarkOS. Ensure these hosts have internet access for downloading necessary packages.
snarkos-ansible/
│
├── inventory.ini # Inventory file with target host(s) information
│
├── vars/
│ └── snarkos_vars.yml # Variable file with snarkOS configurations
│
└── playbooks/
└── setup_snarkos.yml # Main playbook for setting up snarkOS
-
Inventory File: Update the
inventory.inifile with the IP addresses and SSH users of your target hosts. For example:[snarkos_hosts] 192.168.1.100 ansible_user=ubuntu -
Variable File: Customize
vars/snarkos_vars.ymlwith your specific configurations, such as the validators list and any other parameters relevant to your deployment. -
SSH Configuration: Ensure you can SSH into your target host(s) using the specified user without a password prompt. This usually involves setting up SSH keys and configuring
sudoprivileges.
To deploy snarkOS, follow these steps:
-
Navigate to the Project Directory: Open a terminal on your control machine and navigate to the root of the
snarkos-ansibleproject. -
Execute the Playbook: Run the following command to start the deployment:
ansible-playbook -i inventory.ini playbooks/setup_snarkos.yml
-
Monitor the Deployment: Ansible provides real-time feedback during the deployment. Monitor the output for any errors or warnings.
After successfully deploying snarkOS, you can manage the snarkOS service using systemd commands. For example:
- To check the status of the service:
sudo systemctl status validator - To start the service:
sudo systemctl start validator - To stop the service:
sudo systemctl stop validator - To enable the service to start on boot:
sudo systemctl enable validator
- Permission Issues: If you encounter permission issues, ensure the SSH user on your target hosts has
sudoprivileges without a password prompt. - Deployment Errors: Increase the verbosity of the Ansible output with
-v,-vv, or-vvvflags for more detailed information.
For more assistance, refer to the Ansible documentation and the snarkOS GitHub repository.