This repository contains scripts and configurations to set up and manage an Azure Validator Node using Terraform and Ansible.
- Terraform: Used to provision the necessary Azure infrastructure for the Validator Node.
- Ansible: Used to configure the provisioned infrastructure and deploy the Validator Node.
Before you begin, ensure you have the following installed on your local machine:
- Terraform (version >= 0.12)
- Ansible
- Installation Guide
- Install necessary Ansible modules:
ansible-galaxy collection install community.docker community.crypto
- Azure CLI
- Docker
- Docker Compose
- Git
-
Authenticate with Azure CLI:
az login
-
Clone the repository:
git clone https://github.com/ten-protocol/ten-validator.git cd ten-validator
-
Configure Azure Subscription: Ensure your Azure subscription is set correctly:
az account set --subscription "your-subscription-name"
-
Navigate to the Terraform directory:
cd terraform
-
Copy the example
terraform.tfvars
file and edit it:cp terraform.tfvars.example terraform.tfvars # Edit terraform.tfvars with your preferred settings
-
Initialize Terraform:
terraform init
-
Apply the Terraform configuration:
terraform apply
Follow the prompts to confirm the infrastructure changes.
-
Retrieve SSH Key and Login Script:
chmod +x get-key.sh ./get-key.sh
- Run the installation script:
chmod +x install-ten.sh ./install-ten.sh
You will need to provide the following information:
- Host ID (public key of the validator node wallet)
- Private Key (private key of the validator node wallet)
- Host Public P2P Address (public IP address or DNS name of the validator node)
- Host ssh username (default is tenuser)*
- Host ssh password or path to ssh key file*
- L1 WS URL (geth client, Infura, etc.websocket URL of the L1 node)
- Postgres DB Host (leave blank if unsure or want to provision a new one)
* Note: If you used terraform to provision the VM, you can just press enter and choose the default values.
-
Clear Terraform State: If you need to destroy the infrastructure and clear the Terraform state, run:
chmod +x clear.sh ./clear.sh
-
Environment Variables: Ensure that all necessary environment variables are set as per the
ansible/files/node.env.example
file. -
Network Configuration: The network settings are defined in
ansible/files/network_vars.yml
and should not be changed unless necessary.
- Ensure all dependencies are installed and accessible in your system's PATH.
- Verify that your Azure CLI is authenticated and set to the correct subscription.
- Check that your
terraform.tfvars
andhosts.ini
files are correctly configured.
For further assistance, refer to the official documentation of each tool or reach out to the project maintainers.