Skip to content

Adds peers rpc to the bitcoin command group#813

Merged
pinheadmz merged 2 commits into
bitcoin-dev-project:mainfrom
sr-gi:2026-07-bitcoin-peers
Jul 22, 2026
Merged

Adds peers rpc to the bitcoin command group#813
pinheadmz merged 2 commits into
bitcoin-dev-project:mainfrom
sr-gi:2026-07-bitcoin-peers

Conversation

@sr-gi

@sr-gi sr-gi commented Jul 6, 2026

Copy link
Copy Markdown
Member

Adds a peers rpc that displays the peers of a given tank.

This is really useful to check connectivity against network graphs, and just as a general sense of who's connected to who.

e.g.

warnet bitcoin peers tank-0000

manual            tank-0004
manual            tank-0005
manual            tank-0006
manual            tank-0013
manual            tank-0014
manual            tank-0015
manual            tank-0019
manual            tank-0021
inbound           tank-0001
inbound           tank-0003
inbound           tank-0007
inbound           tank-0008
inbound           tank-0016

@sr-gi
sr-gi force-pushed the 2026-07-bitcoin-peers branch from 736c3b6 to e405c7b Compare July 6, 2026 15:35
@pinheadmz

Copy link
Copy Markdown
Contributor

I'm not opposed to adding this but the bitcoin-cli table is also available via RPC:

(.venv) --> warnet bitcoin rpc tank-0000 -netinfo 4
Bitcoin Core client v27.0.0 regtest - server 70016/Satoshi:27.0.0/

<->   type   net  v  mping   ping send recv  txn  blk  hb addrp addrl  age id address          version
 in         ipv4  2      0      0   79   79                              1  1 10.1.29.32:40930 70016/Satoshi:27.0.0/
out manual  ipv4  2      1      1   79   79                              1  0 tank-0001        70016/Satoshi:27.0.0/
                        ms     ms  sec  sec  min  min                  min

         ipv4    ipv6   total   block  manual
in          1       0       1
out         1       0       1       0       1
total       2       0       2

Local addresses
0.0.0.0                      port  18444    score      2
10.1.29.29                   port  18444    score      1
::                           port  18444    score      2
fe80::4c64:5bff:fe40:552     port  18444    score      1

@sr-gi

sr-gi commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

To me, the QoL of this the tank name mapping for inbounds. If you'd like to stick with -netinfo instead, what about capturing the return and mapping the IPs to the tank names before displaying?

Adds a peers rpc that displays the peers of a given tank.

e.g.

warnet bitcoin peers tank-0000

manual            tank-0004
manual            tank-0005
manual            tank-0006
manual            tank-0013
manual            tank-0014
manual            tank-0015
manual            tank-0019
manual            tank-0021
inbound           tank-0001
inbound           tank-0003
inbound           tank-0007
inbound           tank-0008
inbound           tank-0016
@pinheadmz

Copy link
Copy Markdown
Contributor

I'm just gonna fancy this up a bit using rich tables, like the warnet status command...

(.venv) --> warnet bitcoin peers tank-0002
╭──── Peers of tank-0002 ────╮
│                            │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━┓ │
│ ┃ Connection Type ┃ Peer ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━┩ │
│ └─────────────────┴──────┘ │
│                            │
╰────────────────────────────╯
(.venv) --> warnet bitcoin peers tank-0003
╭─────── Peers of tank-0003 ───────╮
│                                  │
│ ┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ │
│ ┃ Connection Type  ┃ Peer      ┃ │
│ ┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │
│ │ block-relay-only │ tank-0004 │ │
│ └──────────────────┴───────────┘ │
│                                  │
╰──────────────────────────────────╯
(.venv) --> warnet bitcoin peers tank-0004
╭────── Peers of tank-0004 ───────╮
│                                 │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ │
│ ┃ Connection Type ┃ Peer      ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │
│ │ inbound         │ tank-0003 │ │
│ └─────────────────┴───────────┘ │
│                                 │
╰─────────────────────────────────╯
(.venv) --> warnet bitcoin peers tank-0005
╭──────── Peers of tank-0005 ─────────╮
│                                     │
│ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ │
│ ┃ Connection Type     ┃ Peer      ┃ │
│ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │
│ │ outbound-full-relay │ tank-0006 │ │
│ │ outbound-full-relay │ tank-0007 │ │
│ └─────────────────────┴───────────┘ │
│                                     │
╰─────────────────────────────────────╯
(.venv) --> warnet bitcoin peers tank-0006
╭────── Peers of tank-0006 ───────╮
│                                 │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ │
│ ┃ Connection Type ┃ Peer      ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │
│ │ inbound         │ tank-0005 │ │
│ └─────────────────┴───────────┘ │
│                                 │
╰─────────────────────────────────╯

@pinheadmz

Copy link
Copy Markdown
Contributor

Even works with warnet's internal Tor!

(.venv) --> warnet bitcoin peers tank-0000
╭───────── Peers of tank-0000 ──────────╮
│                                       │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓ │
│ ┃ Connection Type ┃ Peer            ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━┩ │
│ │ inbound         │ 127.0.0.1:34248 │ │
│ └─────────────────┴─────────────────┘ │
│                                       │
╰───────────────────────────────────────╯
(.venv) --> warnet bitcoin peers tank-0001
╭───────────────────────────────── Peers of tank-0001 ─────────────────────────────────╮
│                                                                                      │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ │
│ ┃ Connection Type ┃ Peer                                                           ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │
│ │ manual          │ pchuzhjx6qplwwdgdtzzlhm45xrmf6yk5bmcvdetdbfqm3uhelwljuad.onion │ │
│ └─────────────────┴────────────────────────────────────────────────────────────────┘ │
│                                                                                      │
╰──────────────────────────────────────────────────────────────────────────────────────╯

@pinheadmz
pinheadmz force-pushed the 2026-07-bitcoin-peers branch from e405c7b to 7da5166 Compare July 22, 2026 15:09
@pinheadmz

Copy link
Copy Markdown
Contributor

one last check, wanted to make sure tank-**** naming wasnt special

(.venv) --> warnet bitcoin peers miner
╭───────────── Peers of miner ─────────────╮
│                                          │
│ ┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┓ │
│ ┃ Connection Type ┃ Peer               ┃ │
│ ┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━┩ │
│ │ inbound         │ aries-cb-recipient │ │
│ │ inbound         │ aries-cb-router    │ │
│ │ inbound         │ aries-cb-spender   │ │
│ │ inbound         │ aries-recipient    │ │
│ │ inbound         │ aries-spender      │ │
│ └─────────────────┴────────────────────┘ │
│                                          │
╰──────────────────────────────────────────╯

@pinheadmz
pinheadmz merged commit 8a350f5 into bitcoin-dev-project:main Jul 22, 2026
16 checks passed
@sr-gi

sr-gi commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

post merge ACK. Built and tested on my local erlay-warnet branch.

Looks fresh 😎

warnet bitcoin peers tank-0025
╭──────── Peers of tank-0025 ─────────╮
│                                     │
│ ┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┓ │
│ ┃ Connection Type     ┃ Peer      ┃ │
│ ┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━┩ │
│ │ manual              │ tank-0000 │ │
│ │ manual              │ tank-0006 │ │
│ │ manual              │ tank-0007 │ │
│ │ manual              │ tank-0012 │ │
│ │ manual              │ tank-0013 │ │
│ │ manual              │ tank-0019 │ │
│ │ manual              │ tank-0021 │ │
│ │ manual              │ tank-0024 │ │
│ │ outbound-full-recon │ tank-0001 │ │
│ │ outbound-full-recon │ tank-0015 │ │
│ │ outbound-full-recon │ tank-0022 │ │
│ │ outbound-full-recon │ tank-0026 │ │
│ │ inbound             │ tank-0003 │ │
│ │ inbound             │ tank-0004 │ │
│ │ inbound             │ tank-0005 │ │
│ │ inbound             │ tank-0008 │ │
│ │ inbound             │ tank-0009 │ │
│ │ inbound             │ tank-0010 │ │
│ │ inbound             │ tank-0011 │ │
│ │ inbound             │ tank-0016 │ │
│ │ inbound             │ tank-0018 │ │
│ │ inbound             │ tank-0020 │ │
│ │ inbound             │ tank-0023 │ │
│ │ inbound             │ tank-0028 │ │
│ │ inbound             │ tank-0034 │ │
│ │ inbound             │ tank-0035 │ │
│ │ inbound             │ tank-0036 │ │
│ │ inbound             │ tank-0038 │ │
│ │ inbound             │ tank-0040 │ │
│ │ inbound             │ tank-0041 │ │
│ │ inbound             │ tank-0044 │ │
│ │ inbound             │ tank-0048 │ │
│ └─────────────────────┴───────────┘ │
│                                     │
╰─────────────────────────────────────╯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants