-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add libp2p service and configuration #282
Conversation
I see, thank you! Is this specified by libp2p? For multicast sockets it's usually an exception to re-bind to the same port via |
Aha! Excellent question! This helped me to fix some of my incorrect assumptions. Thank you! Going back to your failed attempt to run two nodes on your local machine with mDNS: I was wrong. The cause of the panic was actually the QUIC port! I dug into the libp2p code to look for the port reuse option and ended up finding it here (their mDNS docs are very sparse and do not mention this, or the port Let me clean up the code and commit it. P.s. I'm really sorry that this PR has become so big and complicated -_- |
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 great! ✨ Thank you for all the extra changes. I think it's good to go 👍🏻
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.
This is a great PR and represents a huge amount of very thorough research, thanks so much for guiding and grounding this complex area of work. We have a network!!!!
Just some small comments in this review, i agreed with all the points @adzialocha already made. One extra thing is that I wonder if we need some more info in the README specifically about the network layer. This can happen in a follow-up PR and once we have the other pieces in place.
Also, maybe i'm doing something wrong, but should i be getting any chatter when running two nodes locally? Like mDNS or ping? I don't see anything in the logs when i run:
RUST_LOG=aquadoggo=debug cargo run
and then:
RUST_LOG=aquadoggo=debug cargo run -- --http-port 2021 --quic-port 2023
I'd just like to check this point and the small comments i made then I'm very happy to approve and merge.
Agreed that it will be good to write something in the |
I'll put together a simple doc on Laub with details of what we have in the networking layer thus far. That can inform the |
Thanks so much for the review! 🖤 Loads of awesome teamwork and sharing has made this possible. I have removed the
You need one small addition to your second invocation to specify a non-default base path. That results in a separate peer ID being created for the second node. The way you tried it before meant that both nodes were running with the same ID and therefore
You should see something like this in the log output:
Note that the |
That's a new pattern: Nodes have key pairs now 🤯 |
Ah, thanks, yeh that did the trick! I see discovery happening now :-) |
@mycognosist I had a look at doing the rebase again, but I'm not seeing any problem in my local git commit history, so hoping this is just something weird here in the web ui. Let's merge! You wanna do it? We normally squash. |
* main: Update breaking API calls for new `p2panda-rs` version (#293) Update Cargo.lock as well Use released p2panda-rs version 0.7.0 Migrate CLI from `structopt` to `clap` (#289) Increase timeout for failing materializer test Introduce requeue flag (#286) Do transactions correctly (#285) Add libp2p service and configuration (#282)
Implements a minimal networking layer using the
libp2p
library, including transport establishment, networking configuration and network behaviour composition.Relates to #278
To Do
README
Notes
aquadoggo
currently usesenvy
to parse environment variables and overlay them onto the default configuration parameters. However, it does not currently handle nestedstruct
s. This means that it is not possible to tune libp2p configuration parameters given the current code structure (the same applies toReplicationConfig
). I will need to use theflatten
attribute fromserde
(docs) to achieve this.Out of Scope
I'm noting this down here for future iterations on the networking layer functionality.
TOML
configuration file for the application📋 Checklist
CHANGELOG.md