-
Notifications
You must be signed in to change notification settings - Fork 141
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
refactor: Use iroh_net::PeerAddr
more
#1493
Conversation
49d5165
to
426314c
Compare
* Extend Iroh client surface * Split Iroh client struct into node, blobs, docs * Use Iroh client in CLI (no more raw RPC calls) * Improve naming consistency throughout the RPC interface * Use `iroh_net::NodeAddr` in ticket and get commands
426314c
to
07fdf17
Compare
0295ba5
to
ce57963
Compare
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 actually did more or less just this in #1488 based on #1486 with a different take, since I need to serialize the (derp_region, endpoints)
by itself (just like gossip does), thus using it there as well.
Can you take a look? I think in principle our object is the same and I would then add the convenience methods you created like with_derp_region
to extend the api in the same fashion
Alright, yes this is pretty similar. We can bikeshed if we want to keep the So it would be one of these two: MagicEndpoint::connect(&self, node_id: PublicKey, addr_info: AddrInfo, alpn: &[u8]);
MagicEndpoint::connect(&self, addr: NodeAddr, alpn: &[u8]) I still kinda like the latter, because in most situations you will get the full But let's maybe get #1488 in first and then I can update this PR afterwards. |
## Description - Adds a `AddrInfo` that contains the addressing information of peers. This is necessary as it's own type since it's serialized both in gossip and in #1488 - Renames `NodeAddr` to `PeerData` (better name suggestions are well received) this helps consolidate the "peer" terminology already present throughout gossip, sync, downloader, and many other places - Use this type in different parts of the code. Some other types that can be replaced by this are left to #1493 ## Notes & open questions This applies the suggestion of doing `connect` using the full type. It's debatable if this is better than `connect(PublicKey, AddrInfo)` but both are imo an improvement over the current way since the idea if "what does iroh need to connect to a peer" is now fully described in a type ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] Tests if relevant.
c2bd15a
to
add7df9
Compare
add7df9
to
c896b8c
Compare
NodeAddr
moreiroh_net::PeerAddr
more
Description
Replaces custom types with
iroh_net::PeerAddr
Notes & open questions
na
Change checklist