#!/bin/bash
curl -s localhost:46941/json_rpc \
  -d '{"jsonrpc":"2.0","id":"0","method":"get_all_alias_details"}' \
  -H 'Content-Type: application/json' | python3 -c "
import sys,json
aliases=json.load(sys.stdin)['result']['aliases']
print(f'{len(aliases)} aliases registered on-chain:')
print()
for a in aliases:
    name = a['alias']
    comment = a.get('comment','')
    print(f'  @{name:12s}  {comment[:50]}')
"
