Closed dignifiedquire closed 6 years ago
@dignifiedquire I'm starting this story, a few clarifications.
It looks like the libp2p basichost requires an id + address to dial a peer (BasicHost.Connect takes a PeerInfo, which has both).
Thanks! Edit: edited for clarity as I rubber duckied.
For now we will want to use addresses that look the same as the ones from IPFS, but will eventually want to transition to /ip4/../p2p/$id
. Example addresss
"/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
"/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
These are (go-)multiaddrs, with additional constraints, as that we require them to have the ipfs
protocol attached.
You can see the validation of this in IPFS here: https://github.com/ipfs/go-ipfs/blob/master/repo/config/bootstrap_peers.go
Which uses go-ipfs-addr which we can reuse for now I believe.
The actual details of the bootstrapping process can be found here
The one that IPFS uses is a much simpler process, where as ethereum implements a kademlia style discovery process.
For filling this issue, only doing a periodic bootstrap like go-ipfs is sufficient, and gives us a places to improve on this at some later point if we see the need for it.
On conversion of bootstrap Multiaddr
s to PeerInfo
s, you can find some details here: https://github.com/ipfs/go-ipfs/blob/master/core/bootstrap.go#L202
Would I just call the above string a 'multiaddr string' or is there a more precise name?
Yes those are multiaddrs in their string representation
@dignifiedquire is the scope of this story to connect to bootstrap nodes as peers or is the scope of this story to connect to bootstrap nodes and query them for peers to connect to?
Reading https://github.com/ipfs/go-ipfs/blob/master/core/bootstrap.go#L35 perhaps the question boils down to: are we going to use ipfsdht for peer discovery? If not seems like the former has to be the plan; if so, then we can do the latter.
just connecting for now, we can do querying later as I am not a 100% sure how that will work
Description
Use the bootstrap nodes configuration option, to connect to the filecoin network on startup time.
Acceptance criteria
Risks + pitfalls
Where to begin