-
Notifications
You must be signed in to change notification settings - Fork 10
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: add peering support #194
Conversation
WS1-1328 Add peering support
This will be a counterpart to the Kubo peering implementation so that specific peers can stay reliably swarm connected.
DOD:
|
Looks like libp2p has deprecated some stuff and Clippy is complaining:
|
ffa5fd1
to
8ad0ab9
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.
Looks great, gave it a complete review now. Just a few small recommendations.
4515681
to
598664b
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.
long, | ||
use_value_delimiter = true, | ||
value_delimiter = ',', | ||
env = "CERAMIC_ONE_EXTRA_BOOTSTRAP_ADDRESSES" |
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.
should we call these "bootstrap" addresses or something like "peering" addresses? We're starting to have more people ask about running ComposeDB with a high availability setup. For one user to run multiple nodes in an HA cluster, they'll need to make sure all of those nodes are well connected, so I imagine we'll be starting to tell people to use this option soon, so want to be aligned on the best terminology here.
I feel like the hard coded ones are "bootstrap" addresses because they're the main way you discover the rest of the network, but if you're manually setting other addresses to connect to, that's more like a "peering" address (which I think is also the terminology that kubo uses?)
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.
Rust-ceramic doesn't distinguish between bootstrap vs peering. I don't have a preference for which term we use, however we should only use one.
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'm also cool either way, if you have a preference for marking them all either "bootstrap" or "peering", @stbrody.
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.
Okay, if we feel like we want to keep the same term for both the hard-coded and user-provided peers then I don't feel strongly which one we use. Fine to keep things as-is
This PR adds support for dialing bootstrap peers with exponential backoff in case of connection or dial failures.
Also, somehow, support for injecting bootstrap addresses got removed from the code, so I added it back.