GithubHelp home page GithubHelp logo

greymass / eosio-failover Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 11.0 154 KB

An EOSIO failover solution which rotates through potential signing public keys and unregisters when needed.

Dockerfile 6.45% Makefile 6.39% TypeScript 87.15%

eosio-failover's Introduction

Best Practices

Your various block producer nodes...

  • SHOULD all have unique keys, with each public key loaded into the failover solution
  • SHOULD NOT run on the same server as the failover
  • SHOULD NOT all be in the same data center

This failover solution...

  • SHOULD specify the most reliable API endpoint possible (load balanced API when available)
  • SHOULD be integrated with notification methods your organization uses
  • SHOULD NOT run in the same server or data center as the API endpoint being used
  • SHOULD NOT run in the same server or data center as your block production node
  • SHOULD NOT be run with an regproducer_key which is either a active or owner key

Configuration

Establish your configuration file by copying the default configuration and then modifying it.

cp config/default.toml config/local.toml

Edit config/local.toml with the appropriate values for your producer. This file is ignored by git and will retain your settings through upgrades.

  • name: Internal name of the application for bunyan logging
  • api: EOSIO API (standard) from which to retrieve information.
  • rounds_missed_threshold: The number of rounds the script will tolerate before moving to the next key.
  • regproducer_key: The private key which can sign both eosio::regproducer and eosio::unregprod.
  • producer_account: The producer account to monitor and issue failover commands for.
  • producer_permission: The permission name of the private key associated with regproducer_key.
  • producer_website: The website address of the producer you'd like to broadcast with eosio::regproducer.
  • producer_location: The numeric country code of the producer you'd like to broadcast with eosio::regproducer.
  • producer_signing_pubkeys: An array of valid public keys assigned to different production nodes.
  • slack (OPTIONAL): Object containing a url of a Slack Webhook to broadcast messages, a channel to specify the target, and a chain to identify which blockchain the messages are in regards to.
  • level (OPTIONAL): The output level of the logger.
  • out (OPTIONAL): The output method of the logger.

Running

After the configuration has been set and the example values replaced, there are multiple ways to run this service:

nodejs

In order to run this script, you will have to compile the TypeScript and then run the resulting javascript.

make lib
node lib/app.js

You should be able to run this script with any nodejs based process handler or from within a tmux session.

docker + docker-compose

A docker and docker-compose configuration has been provided to make deployment as simple as possible.

If you need to install either, refer to the following guides:

To run the failover script within docker using docker-compose, navigate into the root folder of this repository and run:

docker-compose build
docker-compose up -d

Verify its running:

docker-compose ps

Tailing the logs:

docker-compose logs -f --tail="200"

To stop the script:

docker-compose down

Upgrading

The upgrade process from the latest version on github.com should be simple as:

docker-compose stop
git pull
docker-compose build

Development

To develop with this repository, setup the configuration as shown above and then run:

make dev

eosio-failover's People

Contributors

aaroncox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.