Code Monkey home page Code Monkey logo

snr's Introduction

Signum Node Reward (SNR)

Payment Application for the Signum Node Rewards (SNR)

Install

NodeJS 14+ installed

Clone this repo and install the dependencies:

git clone https://github.com/ohager/snr.git
cd snr
npm i

Initialize aka Configuration

Before using it you need to configure the tool. On installation the .env.example will be copied to .env automatically. Just edit the .env file according your needs.

Hint: You can always override the ENV vars on startup, i.e. PAYING_ACCOUNT_PASSPHRASE=secret snr pay 100 -x
Another Hint: Once the .env file exists, it won't be overwritten by the init command anymore

Usage

Just hit ./snr-cli.js --help for detailed usage

14:35 $ ./snr-cli.js 
Usage: snr-cli [options] [command]


            @@@@@@@@  @@@@@@@           
         @@@@@    @@@@@    @@@@@        
           @@@  @@@  @@@ @@@@@          
    @@@      @@@@@     @@@@       @@@   
  @@@@@@@@ &@@@  @@@@@@@@ @@@@  @@@@@@@ 
 @@@    @@@@       @@@      @@@@@    @@@
 @@@  @@@ *@@@@           @@@  @@@  @@@@
   @@@@@     @@@         @@@     @@@@@  
 @@@@  @@@  @@@           @@@@  @@@  @@@
 @@@    @@@@@      @@@       @@@@    @@@
  @@@@@@@  @@@  @@@@@@@@  @@@  @@@@@@@@ 
    @@@       @@@@     @@@@@      @@@   
           @@@@  @@@  @@@  @@@          
         @@@@@    @@@@@    @@@@@        
            @@@@@@@  @@@@@@@@    
 
           Signum Node Rewards          
      
  Author: ohager
  Version: 1.1.0
  

Options:
  -V, --version                                output the version number
  -h, --help                                   display help for command

Commands:
  init                                         Initializes the command. Use this before any other action
  pay [options] [amount]                       Pays the rewards to eligible node operators
  queue [options] <minVersion> [availability]  Checks the node operators for payment eligibility, and queues them for
                                               sending (need to use pay to execute payments)
  help [command]                               display help for command

Examples

Queue

Queuing is the process to verify if an operator is eligible. It just sets the elgibile operator to 'Queued', such that the payment can be done afterwards.

This will simulate a queue simulation for all version above '3.2' and 95% of availability and last seen today

./snr-cli.js queue "3.2" 95 

This will queue for all eligible operators with version above or equal '3.2' and 99% of availability

./snr-cli.js queue "3.2.2" 99 -x

Payment

Pays out to all 'Queued' operators.

This will simulate a payment execution using the entire balance of the payers account and disitributes to the operators

./snr-cli.js pay

This will simulate a payment execution of 10 Signa.

./snr-cli.js pay 10

This will run a real payment execution of 3.14159 Signa and alters state in the database also

./snr-cli.js pay 3.14159 -x

snr's People

Contributors

ohager avatar pir8radio 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.