feat: addpeeraddress rpc#1117
Draft
jaoleal wants to merge 5 commits into
Draft
Conversation
Extract the network-to-default-P2P-port mapping from add_node() into a reusable default_network_port() method on RpcImpl, so other RPC handlers can resolve the default port without duplicating the match.
Add the wire-layer plumbing for the addpeeraddress RPC: - UserRequest::AddPeerAddress and NodeResponse::AddPeerAddress variants - add_peer_address() method on NodeInterface - handle_add_peer_address() implementation in peer_man - address_count() helper on AddressMan - Match arm in perform_user_request()
Register the addpeeraddress RPC endpoint in the JSON-RPC server: - Add add_peer_address() handler in network.rs - Register "addpeeraddress" route in server.rs with address, optional port (defaults to network P2P port), and optional tried parameters - Add RPC documentation
Add addpeeraddress to the FlorestaRPC trait and its blanket implementation for JSON-RPC clients. Wire the new method into the floresta-cli binary as a subcommand with address, port, and optional tried parameters.
Add Python integration test verifying addpeeraddress correctly adds addresses to the address manager, and add the add_peer_address() wrapper to the test framework.
97a2837 to
99fd546
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description and Notes
addpeeraddress Is a simple hidden RPC that adds an address into the Address Manager.
This PR implements the addpeeraddress rpc, with docs and integration tests.
Depends on #1116
How to verify the changes you have done?
The tests use the getaddrmaninfo rpc to assert the addresses are correctly handled.