feat: add getaddednodeinfo rpc#1114
Conversation
| let ip = addr_str | ||
| .parse::<IpAddr>() | ||
| .map_err(|_| JsonRpcError::InvalidAddress)?; | ||
| (ip, 8333) |
|
Ill rebase after #1114 (comment) |
a9319c4 to
71aadb4
Compare
|
Rebased
|
9c7f455 to
8b3d462
Compare
|
@Davidson-Souza done |
|
Needs rebase. |
| # `getaddednodeinfo` | ||
|
|
||
| Return information about nodes that were manually added. |
There was a problem hiding this comment.
nit: docs in a doc commit
8b3d462 to
e91e5a7
Compare
|
Rebased and made a commit only for the md documentation |
e91e5a7 to
0b97c15
Compare
|
Rebased and fixed the problem with the docs |
|
|
||
|
|
||
| @pytest.mark.rpc | ||
| def test_get_added_node_info_empty(florestad_node): |
There was a problem hiding this comment.
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.
0b97c15 to
1ce4316
Compare
| """ | ||
| Passing an invalid address as the node filter should return an error. | ||
| """ | ||
| resp = make_request( |
There was a problem hiding this comment.
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.
daab2d5 to
392bcd4
Compare
|
typo solved on 392bcd4 |
71bc304 to
fde9587
Compare
|
Done @moisesPompilio |
fde9587 to
6c5fc2c
Compare
6c5fc2c to
ccf5adc
Compare
|
CI failed |
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.
ccf5adc to
01a48ee
Compare
|
Rebased |
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.