Code Monkey home page Code Monkey logo

node-provisioning's Introduction

SKALE Node Provisoning

Discord

This repo will help deploy and register multiple SKALE nodes in the cloud automatically.

NOTE: This is for QA and testing purposes only.

Host requirements

  • Terraform >= 0.12
  • Python >= 3.6

Supported providers

  • AWS

Usage

Secrets preparation

  1. Copy contents of the terraform.tfvars.template to the terraform.tfvars and fill all variables
  2. 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

Provision SKALE nodes in the cloud

bash run.sh

Setup on existent nodes from sources

Ansible directory contains ansible provision for setuping skale node system.

Steps to run provision

  1. Firstly you should create two nodes and attach external volume to it.
  2. Install ansible on your machine.
  3. Then you should copy inventory template from inventory/dev and fill it with absent fields.
  4. Also you should add information about host that you cerated before
  5. Run ansible-playbook -i path-to-your-inventory main.yaml

Other options

Recreates accounts from which sgx key will be configured.

ansible-playbook -i path-to-your-inventory wallet.yaml

Setups node on remove server:

  1. Uploads sources.
  2. Reinstalls skale-cli.
  3. Runs skale node init.
  4. 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 

Tasks

Deploy SM

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

Upload SSL certificates

  1. Copy cert.pem and privkey.pem files to the ansible/files directory
  2. Run:
ansible-playbook -i path-to-your-inventory ssl.yaml 

Upload authorized_keys to nodes

  1. add authorized_keys file with all id_rsa.pub what you want to add for access on nodes to the ansible/files directory
  2. Run:
ansible-playbook -i path-to-your-inventory upload_authorized_keys.yaml 

Run main script without IMA deployment

ansible-playbook -i inventory main.yaml --skip-tags deploy_ima,upload_ima

Run skaled monitor

  1. Create if not exists virtual env for python 3.7 or higher in root of project and activate she before script start
  2. Run from root of roject:
pip install -r skale-nodes/ansible/requirements.txt
  1. copy inventory-template like inventory and fill dev file with absent fields.
  2. Add node_ips.json file with all ips what you want (example {"node_name": "node_ip", ..., "node_name": "node_ip"}) to the ansible/files directory
  3. Go to skale-nodes/ansible dir and run:
bash utils/generate_hosts.sh
ansible-playbook -i inventory run_monitor.yaml

node-provisioning's People

Contributors

alexgex avatar badrogger avatar cstrangedk avatar dependabot[bot] avatar dmytrotkk avatar elvisgiv avatar oleksandersalamatov avatar oleksandrsydorenkoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

natebolam

node-provisioning's Issues

Update deprecated AWS provider

Scripts for deploying on AWS were abandoned a long time ago and needs to be updated.
The procedure should the same as for DigitalOcean.

Ideally should be done alongside with #6

Upgrade python version on the nodes

Python 3.6 is not supported since 21 Dec 2021. We need to make sure that all nodes are operating available.
We need to add corresponding tasks in node provision as well as clear instruction how to upgrade python version on validators machine.

Provisioning improvements

Currently provisioning in default state is not working properly, so a bunch of fixes and improvements should be introduced such as:

  • Automate tfstate.backup management
  • Automate node-info management (node wallets)
  • Fix pip installation
  • Automate domain name addition/cleanup to Digital Ocean

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.