-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Examples/bootstrapping railing #302
Examples/bootstrapping railing #302
Conversation
"fmt" | ||
"github.com/libp2p/go-libp2p" | ||
"github.com/libp2p/go-libp2p-peerstore" | ||
"github.com/ipfs/go-ipfs-addr" |
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.
It is preferred to use named import (even the same name as pkg name) if the pkg name is different than last segment of the path.
Another things is, in future we will be taking down some of the bootstrap nodes so it would be better to try connecting to few in parallel so you don't have to wait for full timeout on all of them. Also it is generally safe to resume the rest of initialisation after being connected to 2 or 3 bootstrap nodes, it would be nice if the example code reflected that. |
|
||
import ( | ||
"context" | ||
"fmt" |
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.
Please separate stdlib and ipfs imports by a empty line for clarity.
"/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd", | ||
"/ip4/178.62.61.185/tcp/4001/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3", | ||
"/ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx", | ||
} |
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.
It would also be great to add a comment here that any long running node with stable external address can be used as bootstrap node.
) | ||
|
||
//The bootstrapping nodes are just long running nodes with a static IP address. | ||
//That means you can easily have your own bootstrapping nodes. Everything you need is | ||
//a server with a static IP address. |
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.
General go style is to have a space between // and comment.
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.
@Kubuxu I added it now. Do you know why go fmt
didn't fix it?
Is there a specific reason why there is no go lib for railing like here in the JS implementation? I am willing to develop such an module for go libp2p in the case it's needed. |
We call this bootstrap in go and actually have an example in-progress (#278). Unfortunately, it's blocked on some other changes. We definitely want a separate bootstrap package. General design/requirements:
Ideally, we'd also try bootstrapping whenever we notice the user attempting to dial but we don't have events in place for that (yet). |
@Stebalien Perfect. I will work on the package. |
Awesome! I've wanted that for a while. |
@Stebalien in light of your refactor, do you want to merge it or hold it off? |
@Stebalien does #278 work? |
@agahEbrahimi yes. However, that's blocked on fixing some dependency issues. |
This is most likely severely outdated. Closing. |
add constructor options for timeout, stop using transport.DialTimeout
Changes
Verification
railing.go
file.