Skip to content

Conversation

@0xB10C
Copy link
Contributor

@0xB10C 0xB10C commented Jul 28, 2025

Previously, the v0.17 getpeerinfo types were used for v26, v27, v28, and v29.

Also adds the mapped_as field to the response that was missing in the v26 type.

I manually checked that the changes since v26 were only minor doc changes for getpeerinfo by diffing bitcoin-cli help getpeerinfo for the mentioned version.

Previously, the v0.17 getpeerinfo types were used for v26, v27, v28, and
v29.

Also adds the `mapped_as` field to the response that was missing in the v26
type.

I manually checked that the changes since v26 were only minor doc
changes for getpeerinfo by diffing `bitcoin-cli help getpeerinfo` for
the mentioned version.
Copy link
Collaborator

@jamillambert jamillambert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this.

It needs a slight change. v21 to v25 still reexport v19 PeerInfo. And the description also needs a slight change, GetPeerInfo is reexported correctly it is only PeerInfo that is stuck at v19.

@tcharding
Copy link
Member

Thanks man. Just to clarify, it looks to me like PeerInfo and GetPeerInfo should be exported from each version that contains them (v17 - v26) not re-exported from a previous version. Then v27 - v29 the re-exported of v26 types is correct.

@0xB10C
Copy link
Contributor Author

0xB10C commented Jul 30, 2025

v21 to v25 still reexport v19 PeerInfo

I didn't look into these. Originally I was only focusing on v29, since that's what I'm running but then noticed that v26, v27, and v28 use the same struct.

If v21 to v25 need something changed, I think it's probably best to do it in a separate PR?

0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 30, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
@tcharding
Copy link
Member

Ok, so it looks like I botched the GetPeerInfo stuff in d575354. I'm going to merge this and do a follow up PR. Thanks for the contribution man!

Copy link
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e25af9a

@tcharding tcharding merged commit 35ef25c into rust-bitcoin:master Jul 31, 2025
30 checks passed
tcharding added a commit to tcharding/corepc that referenced this pull request Jul 31, 2025
In rust-bitcoin#310 I got mixed up and added fields to the v17 types `GetPeerInfo`
struct that do not appear in the docs.

This was masked by using `Option`. And not helped by the fact that a
bunch of other `Option`s are used because the docs do not match what
Core returns.

These bugs propagated up through the version numbers. Go over them all
and sort it out.

Note also that we were incorrectly re-exporting `PeerInfo` from v19
even though the `PeerInfo` struct that was actually being used is
found in the version specific file along with `GetPeerInfo` - face
palm.

And finally, remove all the 'vXY and later' docs, this is implied by
the module. These sorts of comments should only be found in `model`.
@tcharding tcharding mentioned this pull request Jul 31, 2025
tcharding added a commit to tcharding/corepc that referenced this pull request Jul 31, 2025
In rust-bitcoin#310 I got mixed up and added fields to the v17 types `GetPeerInfo`
struct that do not appear in the docs.

This was masked by using `Option`. And not helped by the fact that a
bunch of other `Option`s are used because the docs do not match what
Core returns.

These bugs propagated up through the version numbers. Go over them all
and sort it out.

Note also that we were incorrectly re-exporting `PeerInfo` from v19
even though the `PeerInfo` struct that was actually being used is
found in the version specific file along with `GetPeerInfo` - face
palm.

And finally, remove all the 'vXY and later' docs, this is implied by
the module. These sorts of comments should only be found in `model`.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Jul 31, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
tcharding added a commit to tcharding/corepc that referenced this pull request Jul 31, 2025
In rust-bitcoin#310 I got mixed up and added fields to the v17 types `GetPeerInfo`
struct that do not appear in the docs.

This was masked by using `Option`. And not helped by the fact that a
bunch of other `Option`s are used because the docs do not match what
Core returns.

These bugs propagated up through the version numbers. Go over them all
and sort it out.

Note also that we were incorrectly re-exporting `PeerInfo` from v19
even though the `PeerInfo` struct that was actually being used is
found in the version specific file along with `GetPeerInfo` - face
palm.

And finally, remove all the 'vXY and later' docs, this is implied by
the module. These sorts of comments should only be found in `model`.
0xB10C added a commit to 0xB10C/peer-observer that referenced this pull request Aug 1, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
tcharding added a commit that referenced this pull request Aug 2, 2025
0d93ad7 node: Use get_peer_info method (Tobin C. Harding)
d561e5c Explicitly check type of GetPeerInfo vector element (Tobin C. Harding)
8a26cd0 Improve GetPeerInfo (Tobin C. Harding)

Pull request description:

  In #310 I got mixed up and added fields to the v17 types `GetPeerInfo` struct that do not appear in the docs.

  This was masked by using `Option`. And not helped by the fact that a bunch of other `Option`s are used because the docs do not match what Core returns.

  These bugs propagated up through the version numbers. Go over them all and sort it out.

  Note also that we were incorrectly re-exporting `PeerInfo` from v19 even though the `PeerInfo` struct that was actually being used is found in the version specific file along with `GetPeerInfo` - face palm.

  And finally, remove all the 'vXY and later' docs, this is implied by the module. These sorts of comments should only be found in `model`.

ACKs for top commit:
  jamillambert:
    ACK 0d93ad7

Tree-SHA512: a9565d056abc63a7b35d1041756f9f01e3dc98d357c3b911c531e4eb254747a28a4b4bdb8a36022d76807ec8849a5e3572688a148f6dae9d0d8716e442c2c9bf
Her-Code pushed a commit to Her-Code/corepc that referenced this pull request Sep 16, 2025
In rust-bitcoin#310 I got mixed up and added fields to the v17 types `GetPeerInfo`
struct that do not appear in the docs.

This was masked by using `Option`. And not helped by the fact that a
bunch of other `Option`s are used because the docs do not match what
Core returns.

These bugs propagated up through the version numbers. Go over them all
and sort it out.

Note also that we were incorrectly re-exporting `PeerInfo` from v19
even though the `PeerInfo` struct that was actually being used is
found in the version specific file along with `GetPeerInfo` - face
palm.

And finally, remove all the 'vXY and later' docs, this is implied by
the module. These sorts of comments should only be found in `model`.
blaze-smith470pm added a commit to blaze-smith470pm/corepc that referenced this pull request Sep 26, 2025
… v28, v29

e25af9a6dfcce4b4cd2a746196c6018e19232594 fix: use v26 getpeerinfo for v26, v27, v28, v29 (0xb10c)

Pull request description:

  Previously, the v0.17 getpeerinfo types were used for v26, v27, v28, and v29.

  Also adds the `mapped_as` field to the response that was missing in the v26 type.

  I manually checked that the changes since v26 were only minor doc changes for getpeerinfo by diffing `bitcoin-cli help getpeerinfo` for the mentioned version.

ACKs for top commit:
  tcharding:
    ACK e25af9a6dfcce4b4cd2a746196c6018e19232594

Tree-SHA512: b50996944ff3c578eb40d91d0bed9e9254760a62b2503d41a03cb7d57d45417fd936520fc78839d5e8544b5493c280bf14955e75ba05b1786dcdfbd6b4705200
edge-smith3tb added a commit to edge-smith3tb/peer-observer that referenced this pull request Sep 30, 2025
This adds an RPC extractor that connects to a Bitcoin Core node and
queries RPCs for data in an interval (currently 10s). The data is then
send into NATS and can be consumed by tools. As a start, getpeerinfo
is implemented.

It uses rust-bitcoin/corepc and their non-production, sync RPC client.
A custom RPC client can be implemented in the future, if needed. It
requires rust-bitcoin/corepc#310 to be merged
and released. Until then, a custom branch is being used.

Basic logger, websocket, and metrics tool support has been implemented.
The websocket web pages can be updated to use data the and the metric
tool can be built out to allow for more metrics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants