-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: get list of ConnectionInfo
s or an individual node's ConnectionInfo
#1435
Conversation
ZOMG I WANT THIS. Howeve, given that you had to censor the screenshot, I'd say right off the bat we should go with listing by |
Can we use short NodeIDs, like we do for doc & author ids in the console? We could also do this in a follow-up.
|
iroh/src/commands.rs
Outdated
Self::Connections => { | ||
let mut connections = client.server_streaming(ConnectionsRequest).await?; | ||
println!("Connections:"); | ||
while let Some(Ok(Ok(ConnectionsResponse { node_info }))) = connections.next().await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rklaehn can I get some RPC help?
I don't understand how I ended up with double Result
s. Did I do something incorrectly, or is expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how I ended up with double Results. Did I do something incorrectly, or is expected?
This is expected behavior. The first Result
is around a connection error while reading the response, and the second Result
is the RpcResult
that you are sending as Item
in the stream.
If you write out one example of how you think it should look, I'll just do it, because it doesn't look right yet but i don't know how to adjust it. |
? |
zomg you fast. the problem is you're not doing one entry per line. aim for a table layout:
Huge win here is each row will be a constant-ish length except for the last value (latency), which makes the formatting much easier, just use latency should be displayed in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Maybe let's add a node connection NODE_ID
command as well that shows all details for a single node id, including IP addresses. This info is available at the node, so I think it makes sense to expose it in some way. Useful for debugging etc.
iroh/src/commands.rs
Outdated
Self::Connections => { | ||
let mut connections = client.server_streaming(ConnectionsRequest).await?; | ||
println!("Connections:"); | ||
while let Some(Ok(Ok(ConnectionsResponse { node_info }))) = connections.next().await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how I ended up with double Results. Did I do something incorrectly, or is expected?
This is expected behavior. The first Result
is around a connection error while reading the response, and the second Result
is the RpcResult
that you are sending as Item
in the stream.
https://github.com/manlge/human-time makes nicer timestamps |
https://github.com/Nukesor/comfy-table can render easy very nice tables :) |
lets add this to the repl for sure |
We should add this to the |
iroh node connections
command to list connection info for all known nodesConnectionInfo
s on the iroh client, CLI, & console
0be217a
to
7a1cbe8
Compare
…on we know about
…o the DERP region id
7a1cbe8
to
15ddf87
Compare
ConnectionInfo
s on the iroh client, CLI, & consoleConnectionInfo
s or an individual node's ConnectionInfo
adds `connection_info(node_id: PublicKey)` method to the client & adds `node connection NODE_ID` to the repl also adjusts some formatting
Description
Display connection information for all nodes we have connected with or have supplied our node with addresses for.
Display connection information on a particular node, using its node id.
Change checklist