Skip to content

feat: add getaddednodeinfo rpc#1114

Open
jaoleal wants to merge 5 commits into
getfloresta:masterfrom
jaoleal:rpc/getaddednodeinfo
Open

feat: add getaddednodeinfo rpc#1114
jaoleal wants to merge 5 commits into
getfloresta:masterfrom
jaoleal:rpc/getaddednodeinfo

Conversation

@jaoleal

@jaoleal jaoleal commented Jun 2, 2026

Copy link
Copy Markdown
Member

Description and Notes

add get addednodeinfo rpc that returns info about the nodes that were manually added and their addresses and wheter theyre connected.

Split of #916

How to verify the changes you have done?

I tried to cover the basic cases so:
Read & Run integration tests.

@jaoleal jaoleal self-assigned this Jun 2, 2026
@jaoleal jaoleal added the rpc Issues related to the JSON-RPC interface, including API behavior, compatibility and implementation. label Jun 2, 2026
@jaoleal jaoleal added this to Floresta Jun 2, 2026
@jaoleal jaoleal added this to the Q2/2026 milestone Jun 2, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Floresta Jun 2, 2026
@jaoleal jaoleal moved this from Backlog to Needs review in Floresta Jun 2, 2026
let ip = addr_str
.parse::<IpAddr>()
.map_err(|_| JsonRpcError::InvalidAddress)?;
(ip, 8333)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I need #1116 landed to fix this.

@jaoleal

jaoleal commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

Ill rebase after #1114 (comment)

@jaoleal
jaoleal requested a review from Davidson-Souza June 3, 2026 16:02
@jaoleal
jaoleal marked this pull request as draft June 3, 2026 17:59
@jaoleal jaoleal moved this from Needs review to In progress in Floresta Jun 3, 2026
@jaoleal
jaoleal requested a review from moisesPompilio June 3, 2026 18:00
@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch 2 times, most recently from a9319c4 to 71aadb4 Compare June 9, 2026 16:31
@jaoleal

jaoleal commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Rebased

  • Moved wire logic to use BitcoinSocketAddress.
  • Moved to Corepctype variant.

@jaoleal
jaoleal marked this pull request as ready for review June 9, 2026 16:40
Comment thread crates/floresta-wire/src/p2p_wire/node/peer_man.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node/peer_man.rs Outdated
Comment thread crates/floresta-wire/src/p2p_wire/node_interface.rs Outdated
Comment thread crates/floresta-node/src/json_rpc/network.rs Outdated
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/test_framework/rpc/base.py Outdated
@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch 2 times, most recently from 9c7f455 to 8b3d462 Compare June 15, 2026 19:11
@jaoleal

jaoleal commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

@Davidson-Souza done

@Davidson-Souza

Copy link
Copy Markdown
Member

Needs rebase.

Comment on lines +1 to +3
# `getaddednodeinfo`

Return information about nodes that were manually added.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: docs in a doc commit

@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from 8b3d462 to e91e5a7 Compare June 16, 2026 12:35
@jaoleal

jaoleal commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Rebased and made a commit only for the md documentation

@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from e91e5a7 to 0b97c15 Compare June 18, 2026 17:23
@jaoleal

jaoleal commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Rebased and fixed the problem with the docs

@jaoleal
jaoleal requested a review from Davidson-Souza June 18, 2026 19:22
@jaoleal jaoleal moved this from In progress to Needs review in Floresta Jun 18, 2026
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated


@pytest.mark.rpc
def test_get_added_node_info_empty(florestad_node):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In this case, keeping the tests separated makes the test suite slower, since each test has to start a new node instance, and the startup time is greater than the time spent running the actual test logic. I think it's better to group them into a single test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in 1ce4316

@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from 0b97c15 to 1ce4316 Compare June 22, 2026 17:48
@jaoleal
jaoleal requested a review from moisesPompilio June 22, 2026 17:50
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
"""
Passing an invalid address as the node filter should return an error.
"""
resp = make_request(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think using rpc.noraise_request directly is cleaner than using make_request, since it makes it more explicit where the request is being performed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done in daab2d5

@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch 2 times, most recently from daab2d5 to 392bcd4 Compare June 24, 2026 15:00
@jaoleal

jaoleal commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

typo solved on 392bcd4

Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/floresta-cli/getaddednodeinfo.py Outdated
Comment thread tests/conftest.py
@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch 2 times, most recently from 71bc304 to fde9587 Compare July 2, 2026 20:55
@jaoleal

jaoleal commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

Done @moisesPompilio

@moisesPompilio moisesPompilio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ACK fde9587

@jaoleal
jaoleal requested a review from Micah-Shallom July 3, 2026 15:15
@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from fde9587 to 6c5fc2c Compare July 9, 2026 16:10
@jaoleal

jaoleal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from 6c5fc2c to ccf5adc Compare July 9, 2026 16:13
@jaoleal

jaoleal commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

CI failed

@csgui csgui modified the milestones: Q2/2026, Q3/2026 Jul 9, 2026
jaoleal added 5 commits July 21, 2026 12:06
Add the wire-layer plumbing for the getaddednodeinfo RPC:
- AddedNodeInfo struct in node_interface
- UserRequest::GetAddedNodeInfo and NodeResponse::GetAddedNodeInfo variants
- get_added_node_info() method on NodeInterface
- handle_get_added_node_info() implementation in peer_man
- Match arm in perform_user_request()
Register the getaddednodeinfo RPC endpoint in the JSON-RPC server:
- Add get_added_node_info() handler in network.rs
- Register "getaddednodeinfo" route in server.rs
Add getaddednodeinfo to the FlorestaRPC trait and its blanket
implementation for JSON-RPC clients. Wire the new method into
the floresta-cli binary as a subcommand.
Add Python integration test verifying getaddednodeinfo returns
correct information about manually added nodes, and add the
get_added_node_info() wrapper to the test framework.
@jaoleal
jaoleal force-pushed the rpc/getaddednodeinfo branch from ccf5adc to 01a48ee Compare July 21, 2026 15:06
@jaoleal

jaoleal commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

Rebased

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

Labels

rpc Issues related to the JSON-RPC interface, including API behavior, compatibility and implementation.

Projects

Status: Needs review

Development

Successfully merging this pull request may close these issues.

5 participants