[RPCSAGA]: getaddrmaninforpc command#1064
Open
jaoleal wants to merge 4 commits into
Open
Conversation
Add the core plumbing for a getaddrmaninfo RPC that returns address manager statistics broken down by network type (ipv4, ipv6, onion, i2p, cjdns). Each network reports total, new (untried), and tried address counts.
Expose the getaddrmaninfo plumbing from floresta-wire as a JSON-RPC method in the floresta-node server.
Expose getaddrmaninfo through the floresta-rpc trait and the floresta-cli binary, with accompanying RPC documentation.
Add Python RPC wrapper and integration test that exercises the getaddrmaninfo RPC method, validating the response schema and the total == new + tried invariant for each network.
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
Split of #916
This pr is solely implementing
getaddrmaninforpc commandThe rpc is a read-only getter for connection statistics from the address manager, it needed some plumbing on floresta-wire but is most about data transport.
This pr adds the rpc-server internal handler, the docs and entry for the cli and integration tests.
How to verify the changes you have done?
Run the tests and the command locally, you should see something similar as:
/Floresta (rpcsaga/getaddrmaninfo) $ fcli getaddrmaninfo Compiling floresta-rpc v0.5.0 (/Users/jaoleal/Floresta/crates/floresta-rpc) Compiling floresta-cli v0.5.0 (/Users/jaoleal/Floresta/bin/floresta-cli) Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.72s Running `target/debug/floresta-cli getaddrmaninfo` { "all_networks": { "total": 44190, "new": 43450, "tried": 740 }, "ipv4": { "total": 35255, "new": 34573, "tried": 682 }, "ipv6": { "total": 8935, "new": 8877, "tried": 58 }, "onion": { "total": 0, "new": 0, "tried": 0 }, "i2p": { "total": 0, "new": 0, "tried": 0 }, "cjdns": { "total": 0, "new": 0, "tried": 0 } }