#!/bin/bash
curl -s localhost:3335/api/get_info | python3 -c "
import sys,json
try:
    d=json.load(sys.stdin)
    print('Block Explorer')
    print(f'  Height:      {d.get(\"height\",0):,}')
    print(f'  PoW diff:    {d.get(\"pow_difficulty\",0):,}')
    print(f'  Aliases:     {d.get(\"alias_count\",0)}')
    print(f'  TX count:    {d.get(\"tx_count\",0):,}')
    print(f'  Hashrate:    {d.get(\"current_network_hashrate_350\",0):,} H/s')
    print(f'  URL:         http://localhost:3335')
except:
    print('Explorer: connecting...')
"
