GithubHelp home page GithubHelp logo

jorgecuesta / relay_counter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pokt-network/relay_counter

0.0 1.0 0.0 134 KB

A simple tool that counts relays (and which nodes did for what application) during a time period.

License: MIT License

Go 100.00%

relay_counter's Introduction

relay_counter

A simple tool that counts relays during a time period

How To Use

  1. Ensure golang 1.13+ environment is properly installed
  2. Sync (RC-0.5.2.9) Pocket Core Instance (ensure completely synced)
  3. go get github.com/pokt-network/relay_counter
  4. cd /src/github.com/pokt-network/relay_counter
  5. Edit configuration file (See details below)
  6. go run ./...
  7. check /src/github.com/pokt-network/relay_counter/result for the result file

Config File

Found in /config/config.json

{
  "timeline": {
    "start": -4,
    "end": -1, // can be 0 for latest
    "unit": "days" // blocks, sessions, min, weeks, hours
  },
  "endpoint": "http://localhost:8081/v1",
  "http_retry": 3, // if rpc not responsive
  "params": {
    "blocks_per_session": 4, // needed for sessions
    "approx_block_time_in_min": 15
  }
}

TL;DR how it works

With a simple config file, relay_counter uses binary search to find the nearest blocks to the start/end, then tallies up the relays using valid claims and proofs transactions.

You can pass arguments like a different config file path or a results file path. Also you can override on the fly with arguments any of the parameters that exists into the config.json.

go run ./... -config=test/config.json -results test/result.json -endpoint=https://some.node.com/v1

In any case you can use -h to see all the available options.

Config.json | CLI args

Config File Option CLI Arg Description Options/Default
- -config config file path config/config.json
- -results results file path result/.json
selector -selector Use this to point which method will you use to select block timeline, byClock
timeline.start -timelineStart used only when selector=timeline
timeline.end -timelineEnd used only when selector=timeline
timeline.unit -timelineUnit used only when selector=timeline block[s],session[s],minute[s],hour[s],day[s],week[s]
byBlock.start -startBlock used only when selector=byBlock
byBlock.end -endBlock used only when selector=byBlock
endpoint -endpoint endpoint must be pocket-core version endpoint
http_retry -httpRetry how much retries will be done in case some endpoint fail
params.block_per_session -blocksPerSession
parms.approx_block_time_in_min -blockTimeInMin approximate time before next block height been generated

relay_counter's People

Contributors

jorgecuesta avatar

Watchers

 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.