https://github.com/nuttymoon/ansible-avalanche-roles
Ansible roles to bootstrap Avalanche validators, create subnets and blockchains
https://github.com/nuttymoon/ansible-avalanche-roles
ansible avalanche blockchain
Last synced: 2 months ago
JSON representation
Ansible roles to bootstrap Avalanche validators, create subnets and blockchains
- Host: GitHub
- URL: https://github.com/nuttymoon/ansible-avalanche-roles
- Owner: Nuttymoon
- Created: 2021-12-19T14:25:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-13T22:28:27.000Z (over 3 years ago)
- Last Synced: 2025-02-06T08:13:02.017Z (4 months ago)
- Topics: ansible, avalanche, blockchain
- Language: Ruby
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ansible Avalanche Roles
Ansible roles to bootstrap [Avalanche](https://docs.avax.network/) validators, create subnets and blockchains.
## Disclaimer
This project is a work in progress. It is provided as is without any guaranty.
## Usage
### Vagrant environment
2 Vagrant environments are available:
- `local`: 5 VMs (RAM = 1 GB, CPU = 2) to bootstrap a local test network
- `fuji`: 1 VM (RAM = 8 GB, CPU = 4) to bootstrap a Fuji (testnet) validatorTo switch environment, use symlinks. E.g. to use the `local` setup:
```sh
# Link Vagrantfile to Vagrantfile.local
ln -sf Vagrantfile.local Vagrantfile# Create/start the VMs
vagrant up
```**Note:** The `fuji` Vagrant environment is provided as an example. I do not recommand to run a Fuji validator on such a small VM on your PC.
### Custom remote server
To run the playbooks on custom servers (I use this to provision my Fuji validator) create a `hosts` file in `remote/`:
```sh
mkdir -p remote
echo "validator01 ansible_host=$IP_ADDRESS ansible_user=root" > remote/myvalidator.hosts
```### Provisioning
#### Local test network
1. Set Ansible inventory to `local`
```sh
export ANSIBLE_INVENTORY=ansible/inventory/local.hosts
```
2. Install + configure avalanchego
```sh
ansible-playbook ansible/bootstrap-local-network.yml
```
3. Create a subnet with 3 validators
```sh
ansible-playbook ansible/create-subnet.yml
```
4. **Manual step:** add the new subnet ID to `whitelisted_subnets` list in `bootstrap-local-network.yml`
5. Rerun the `bootstrap-local-network.yml` playbook (to validate the new subnet)
```sh
ansible-playbook ansible/bootstrap-network.yml
```
6. Create a blockchain in the new subnet1. Compile the VM and add the VM binary in `ansible/files/plugins`
2. Run the playbook```sh
# Timestamp VM
ansible-playbook ansible/create-timestamp-blockchain.yml# Subnet EVM
ansible-playbook ansible/create-evm-blockchain.yml
```#### Fuji validator
1. Set Ansible inventory to `fuji`
```sh
# Local VM
export ANSIBLE_INVENTORY=ansible/inventory/fuji.hosts# Or custom remote hosts
export ANSIBLE_INVENTORY=remote/myvalidator.hosts
```2. Install + configure avalanchego
```sh
ansible-playbook ansible/bootstrap-fuji-validator.yml
```## TO DO
- [ ] Create an Ansible collection to distribute the roles
- [ ] Check that a subnet with the same validators does not already exist before creation and prompt for confirmation
- [ ] Check that a blockchain using the same VM does not already exist before creation and prompt for confirmation
- [ ] Secure fund private key in vault
- [ ] Always recreate chain aliases on startup