This repo will help deploy and register multiple SKALE nodes in the cloud automatically.
NOTE: This is for QA and testing purposes only.
- Terraform >= 0.12
- Python >= 3.6
- AWS
- Copy contents of the
terraform.tfvars.template
to theterraform.tfvars
and fill all variables - Set following variables to the environment:
PROVIDER - Cloud provider: `do` or `aws`
ENDPOINT - Endpoint of the ETH network with manager contract
NODES - Number of nodes to be created
SKALE_AMOUNT - Amount of SKALE tokens to transfer
ETH_AMOUNT- Amount of ETH to transfer
ETH_PRIVATE_KEY - Base ETH private key to send funds
bash run.sh
Ansible directory contains ansible provision for setuping skale node system.
Steps to run provision
- Firstly you should create two nodes and attach external volume to it.
- Install ansible on your machine.
- Then you should copy inventory template from inventory/dev and fill it with absent fields.
- Also you should add information about host that you cerated before
- Run
ansible-playbook -i path-to-your-inventory main.yaml
Recreates accounts from which sgx key will be configured.
ansible-playbook -i path-to-your-inventory wallet.yaml
Setups node on remove server:
- Uploads sources.
- Reinstalls skale-cli.
- Runs skale node init.
- Registers node on manager.
ansible-playbook -i path-to-your-inventory setup.yaml
Installs needed dependecies and setups os configs.
ansible-playbook -i path-to-your-inventory base.yaml
Destroys all containers, removes .skale, reruns setup.yaml steps.
ansible-playbook -i path-to-your-inventory restart.yaml
Destroys all containers, removes .skale, reruns setup.yaml steps.
ansible-playbook -i path-to-your-inventory restart.yaml
Recreates accounts and runs restart.yaml steps.
ansible-playbook -i path-to-your-inventory restart.yaml
Required variables in the inventory:
manager_tag=''
eth_private_key=''
endpoint=''
deploy_gas_price=''
aws_key='' # for S3 upload
aws_secret='' # for S3 upload
Deploy and upload ABIs to AWS S3:
ansible-playbook -i inventory deploy_contracts.yaml
Deploy only:
ansible-playbook -i inventory deploy_contracts.yaml --tags deploy_contracts
Upload only (from helper-scripts/contracts_data/manager.json
):
ansible-playbook -i inventory deploy_contracts.yaml --tags upload_contracts
- Copy
cert.pem
andprivkey.pem
files to theansible/files
directory - Run:
ansible-playbook -i path-to-your-inventory ssl.yaml
- add
authorized_keys
file with all id_rsa.pub what you want to add for access on nodes to theansible/files
directory - Run:
ansible-playbook -i path-to-your-inventory upload_authorized_keys.yaml
ansible-playbook -i inventory main.yaml --skip-tags deploy_ima,upload_ima
- Create if not exists virtual env for python 3.7 or higher in root of project and activate she before script start
- Run from root of roject:
pip install -r skale-nodes/ansible/requirements.txt
- copy
inventory-template
likeinventory
and filldev
file with absent fields. - Add
node_ips.json
file with all ips what you want (example{"node_name": "node_ip", ..., "node_name": "node_ip"}
) to theansible/files
directory - Go to
skale-nodes/ansible
dir and run:
bash utils/generate_hosts.sh
ansible-playbook -i inventory run_monitor.yaml