NOTE: SKALE-NMS
is deprecated and no longer in active maintenance. Please see sla-agent and bounty-agent repos.
SKALE NMS is comprised of the SLA agent and Bounty collector, which are parts of the SKALE node.
Every SKALE node has a NMS group of N (e.g. 24) other nodes in the network randomly assigned to it. NMS groups regularly audit node downtime and latency at predetermined periods (e.g. five minutes), log these measurements to their local databases, and submit average metrics to the SKALE Manager contract (SMC) once for every reward period - epoch (e.g. 30 days). Every node is rewarded for its validation efforts, based on results sent by NMS group of this node, at the end of each epoch.
SKALE-NMS is still in active development and therefore should be regarded as alpha software. The development is still subject to security hardening, further testing, and breaking changes. This repository has not yet been reviewed or audited for security.
Code of SLA agent and Bounty collector are located in sla and bounty directories respectively.
SLA agent runs on every node of SKALE network, periodically requests a list of nodes to monitor from SKALE Manager contract, conducts monitoring of these other nodes (node downtime and latency so far), logs these measurements, and sends average metrics per epoch to SMC (once for every epoch).
Python >= 3.6.5
pip install -r sla/requirements.txt
To run tests locally, you need to have MySQL v5.7 installed and database 'db_skale' and some tables created (see below). Also you have to change the name of test_data/.env_template
to test_data/.env
and fill it out with your environment variables:
ETH_PRIVATE_KEY='YOUR_PRIVATE_KEY'
DB_ROOT_PASSWORD='YOUR_MYSQL_ROOT_PASSWORD'
DB_USER='YOUR_MYSQL_USER'
DB_PASSWORD='YOUR_MYSQL_PASSWORD'
As for using MySQL you have two options:
-
Use MySQL docker container (recommended). In this case: - install Docker CE v18.06? (if you haven't it installed) - run following command:
docker run -d --restart=always --name skale-mysql -e MYSQL_ROOT_PASSWORD=$DB_ROOT_PASSWORD -e MYSQL_DATABASE=db_skale -e MYSQL_USER=$DB_USER -e MYSQL_PASSWORD=$DB_PASSWORD -v test_data/init.sql:/docker-entrypoint-initdb.d/init.sql -p 3307:3306 mysql/mysql-server:5.7
-
If you already have MySQL v5.7 installed on your PC - create db named 'db_skale' and tables with a help of this init.sql file. Keep in mind that SLA agent uses MySQL on port 3307 (not 3306)
py.test -v tests/test_sla.py
For building SLA agent docker container and pushing it to Docker Hub use:
cd sla
sh ./build.sh
Run docker container locally:
cd sla
sh ./install.sh
Bounty agent runs on every node of SKALE network and handles the collection of the bounty over time from the SKALE Manager for its validation efforts.
Python >= 3.6.5
pip install -r bounty/requirements.txt
To run tests locally, you need to have MySQL v5.7 installed and database 'db_skale' and some tables created (see below). Also you have to change the name of test_data/.env_template
to test_data/.env
and fill it out with your environment variables:
ETH_PRIVATE_KEY='YOUR_PRIVATE_KEY'
DB_ROOT_PASSWORD='YOUR_MYSQL_ROOT_PASSWORD'
DB_USER='YOUR_MYSQL_USER'
DB_PASSWORD='YOUR_MYSQL_PASSWORD'
As for using MySQL you have two options:
-
Use MySQL docker container (recommended). In this case: - install Docker CE v18.06? (if you haven't it installed) - run following command:
docker run -d --restart=always --name skale-mysql -e MYSQL_ROOT_PASSWORD=$DB_ROOT_PASSWORD -e MYSQL_DATABASE=db_skale -e MYSQL_USER=$DB_USER -e MYSQL_PASSWORD=$DB_PASSWORD -v test_data/init.sql:/docker-entrypoint-initdb.d/init.sql -p 3307:3306 mysql/mysql-server:5.7
-
If you already have MySQL v5.7 installed on your PC - create db named 'db_skale' and tables with a help of this init.sql file. Keep in mind that SLA agent uses MySQL on port 3307 (not 3306)
py.test -v tests/test_bounty.py
For building Bounty collector docker container and pushing it to Docker Hub use:
cd bounty
sh ./build.sh
Run docker container locally:
cd bounty
sh ./install.sh
To build docker containers both for SLA agent and Bounty collector use:
sh ./build_all.sh
in process
Learn more about the SKALE community over on Discord.
If you have any questions please ask our development community on Discord.
Copyright (C) 2018-present SKALE Labs