#!/bin/bash
curl -s localhost:2117/stats | python3 -c "
import sys,json
d=json.load(sys.stdin)
pool = d.get('pool',{})
net = d.get('network',{})
cfg = d.get('config',{})
print(f'Lethean Mining Pool')
print(f'  Coin:         {cfg.get(\"coin\",\"?\")}')
print(f'  Algorithm:    ProgPoWZ')
print(f'  Pool hash:    {pool.get(\"hashrate\",0)} H/s')
print(f'  Miners:       {pool.get(\"miners\",0)}')
print(f'  Blocks found: {pool.get(\"totalBlocks\",0)}')
print(f'  Net height:   {net.get(\"height\",\"?\")}')
print(f'  Net diff:     {net.get(\"difficulty\",\"?\")}')
print(f'  Stratum:      stratum+tcp://localhost:5555')
"
