项目作者: skalenetwork

项目描述 :
SKALE SLA Agent - decentralized SLA metrics and part of the SKALE Node Monitoring Service (NMS)
高级语言: Python
项目地址: git://github.com/skalenetwork/sla-agent.git
创建时间: 2020-04-03T15:19:50Z
项目社区:https://github.com/skalenetwork/sla-agent

开源协议:GNU Affero General Public License v3.0

下载


Test
Build and publish
codecov
Codacy Badge
Discord

SKALE SLA Agent

SKALE SLA Agent is a part of each SKALE Node, and together is part of the SKALE Node Monitoring Service (NMS).

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.

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 (e.g. node downtime, latency, container health), logs these measurements, and sends average metrics per epoch to SMC (once for every epoch).

An important note about production readiness

SLA Agent 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.

Development

Requirements

Python ≥ 3.6.5

Install Dependencies

  1. pip install -r requirements.txt
  2. pip install -r requirements-dev.txt

Run tests locally

Requirements for tests

You have to change the name of .env_template file to .env and fill it out with your environment variables.
Then run:

  1. bash ./scripts/create_environment.sh

The script above:
1) runs MySQL docker container with required database and tables created
2) runs Ganache docker container and deploys SKALE Manager contracts to it

Then run following script to create and enable a test validator and to make some additional preparations for tests:

  1. python tests/prepare_validator.py

Run tests

  1. py.test -v tests/

Build

For building SLA agent docker image locally:

  1. docker build -t your-sla-image-name .

Documentation

in process

For more information

Learn more about the SKALE community over on Discord.

Contributing

If you have any questions please ask our development community on Discord.
Discord

License

License

Copyright (C) 2018-present SKALE Labs