Skip to content

miloskriz/1k-validators-be

Repository files navigation

To apply to the Thousand Validator Program - sign up here

The Thousand Validator Program is a joint initiative between Web3 Foundation and Parity to help prospective validators achieve nominations to join the active set.

Requirements for prospective validators:

  • 50 KSM.
  • Signed up on the form and has received approval.
  • Connection to the private telemetry.
  • Seven days of online sentry and validator infrastructure.

Please see the blog post for more information and requirements for entering the program.

What is this repository?

The 1k-validator-be repository houses the backend code for the services that run the nomination process of the programme. It handles the configuration of adding new validators to the program, and keeping track that they perform their duties correctly. It performs the nomination of the validators on the basis of a CronJob that is run every 24 hours. It is also planned to contain a Matrix notification service that will bubble up the issues that it finds with different validators and will explain the reason why they were skipped from nomination.

Components

  • Database - A simple persistence layer that can store information across restarts of the service.
  • Monitor - Routinely checks the latest release that is tagged on GitHub and ensures that all connected validators have updated. If they have not, it marks them as not good until they upgrade.
  • Nominator - A wrapper class over the nominating logic.
  • Scorekeeper - The orchestrator of the other components that spawns nominators and has the ability to start and end nomination rounds, incrementing or decreasing the scores of validators in the programme.
  • Server - Exposes a REST API for getting stats about the validators and nominators in the programme.
  • Telemetry - Logic for connecting to the telemetry backend and handling new connections.

Tests

The tests are run using yarn and the testing framework AVA. After installing the dependencies, run yarn test to run the unit tests.

Docker

The entire system can be spun up using a custom "fast" build of Polkadot that starts a new Era every 6 minutes. Move the config.sample.json to config.json and start the proccesses using yarn docker.

Matrix Bot

To enable the matrix bot you will need to create an account on Riot.im or a similar service and acquire an access token. Enter the access token in the configuration file and specify the room that the bot should send the messages in. Make sure you invite the bot to the room before you start the services.

About

Thousand Validators Program backend.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.1%
  • CSS 2.3%
  • JavaScript 1.7%
  • Shell 0.5%
  • HTML 0.3%
  • Dockerfile 0.1%