A simple tool that counts relays during a time period
- Ensure golang 1.13+ environment is properly installed
- Sync (RC-0.5.2.9) Pocket Core Instance (ensure completely synced)
- go get github.com/pokt-network/relay_counter
- cd /src/github.com/pokt-network/relay_counter
- Edit configuration file (See details below)
- go run ./...
- check /src/github.com/pokt-network/relay_counter/result for the result 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
}
}
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.