Commit df4b5452 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(bootstrap) reduce interface

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 7b5eff5c
......@@ -20,8 +20,8 @@ const (
)
func superviseConnections(parent context.Context,
n *IpfsNode,
route *dht.IpfsDHT,
n inet.Network,
route *dht.IpfsDHT, // TODO depend on abstract interface for testing purposes
store peer.Peerstore,
peers []*config.BootstrapPeer) error {
......@@ -29,7 +29,7 @@ func superviseConnections(parent context.Context,
ctx, _ := context.WithTimeout(parent, connectiontimeout)
// TODO get config from disk so |peers| always reflects the latest
// information
if err := bootstrap(ctx, n.Network, route, store, peers); err != nil {
if err := bootstrap(ctx, n, route, store, peers); err != nil {
log.Error(err)
}
select {
......
......@@ -185,7 +185,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (n *IpfsNode, err error) {
// an Exchange, Network, or Routing component and have the constructor
// manage the wiring. In that scenario, this dangling function is a bit
// awkward.
go superviseConnections(ctx, n, dhtRouting, n.Peerstore, n.Config.Bootstrap)
go superviseConnections(ctx, n.Network, dhtRouting, n.Peerstore, n.Config.Bootstrap)
}
// TODO(brian): when offline instantiate the BlockService with a bitswap
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment