Ansible roles to bootstrap Avalanche validators, create subnets and blockchains.
This project is a work in progress. It is provided as is without any guaranty.
2 Vagrant environments are available:
local
: 5 VMs (RAM = 1 GB, CPU = 2) to bootstrap a local test networkfuji
: 1 VM (RAM = 8 GB, CPU = 4) to bootstrap a Fuji (testnet) validator
To switch environment, use symlinks. E.g. to use the local
setup:
# 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.
To run the playbooks on custom servers (I use this to provision my Fuji validator) create a hosts
file in remote/
:
mkdir -p remote
echo "validator01 ansible_host=$IP_ADDRESS ansible_user=root" > remote/myvalidator.hosts
-
Set Ansible inventory to
local
export ANSIBLE_INVENTORY=ansible/inventory/local.hosts
-
Install + configure avalanchego
ansible-playbook ansible/bootstrap-local-network.yml
-
Create a subnet with 3 validators
ansible-playbook ansible/create-subnet.yml
-
Manual step: add the new subnet ID to
whitelisted_subnets
list inbootstrap-local-network.yml
-
Rerun the
bootstrap-local-network.yml
playbook (to validate the new subnet)ansible-playbook ansible/bootstrap-network.yml
-
Create a blockchain in the new subnet
-
Compile the VM and add the VM binary in
ansible/files/plugins
-
Run the playbook
# Timestamp VM ansible-playbook ansible/create-timestamp-blockchain.yml # Subnet EVM ansible-playbook ansible/create-evm-blockchain.yml
-
-
Set Ansible inventory to
fuji
# Local VM export ANSIBLE_INVENTORY=ansible/inventory/fuji.hosts # Or custom remote hosts export ANSIBLE_INVENTORY=remote/myvalidator.hosts
-
Install + configure avalanchego
ansible-playbook ansible/bootstrap-fuji-validator.yml
- 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