Skip to content

Commit

Permalink
update dht dep and support closing the experimental client
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed May 13, 2021
1 parent 476444c commit 66b11ea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
9 changes: 6 additions & 3 deletions core/node/libp2p/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func BaseRouting(experimentalDHTClient bool) interface{} {
}

if dr != nil && experimentalDHTClient {
ctx := helpers.LifecycleCtx(mctx, lc)
cfg, err := in.Repo.Config()
if err != nil {
return out, err
Expand All @@ -79,7 +78,7 @@ func BaseRouting(experimentalDHTClient bool) interface{} {
return out, err
}

expClient, err := fullrt.NewFullRT(ctx, in.Host,
expClient, err := fullrt.NewFullRT(in.Host,
dht.DefaultPrefix,
fullrt.DHTOption(
dht.Validator(in.Validator),
Expand All @@ -92,7 +91,11 @@ func BaseRouting(experimentalDHTClient bool) interface{} {
return out, err
}

// TODO: Start/Stop exp client
lc.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return expClient.Close()
},
})

return processInitialRoutingOut{
Router: Router{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ require (
github.com/libp2p/go-libp2p-core v0.8.5
github.com/libp2p/go-libp2p-discovery v0.5.0
github.com/libp2p/go-libp2p-http v0.2.0
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210512190004-57eeffeacd66
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210513065107-ff66a31ed04b
github.com/libp2p/go-libp2p-kbucket v0.4.7
github.com/libp2p/go-libp2p-loggables v0.1.0
github.com/libp2p/go-libp2p-mplex v0.4.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ github.com/libp2p/go-libp2p-interface-connmgr v0.0.4/go.mod h1:GarlRLH0LdeWcLnYM
github.com/libp2p/go-libp2p-interface-connmgr v0.0.5/go.mod h1:GarlRLH0LdeWcLnYM/SaBykKFl9U5JFnbBGruAk/D5k=
github.com/libp2p/go-libp2p-interface-pnet v0.0.1/go.mod h1:el9jHpQAXK5dnTpKA4yfCNBZXvrzdOU75zz+C6ryp3k=
github.com/libp2p/go-libp2p-kad-dht v0.11.1/go.mod h1:5ojtR2acDPqh/jXf5orWy8YGb8bHQDS+qeDcoscL/PI=
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210512190004-57eeffeacd66 h1:bgny9dF7iwddusH2nkqPSbWSehRtbe+AxBox8BTBRrA=
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210512190004-57eeffeacd66/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0=
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210513065107-ff66a31ed04b h1:cXCr40TRjPQED65saU5U32JLDLhkRGqiRb74TGJ49XI=
github.com/libp2p/go-libp2p-kad-dht v0.11.2-0.20210513065107-ff66a31ed04b/go.mod h1:zdQYru1c7dnluMpZls4i9Fj2TwYXS7YyDkJ1Yahv0w0=
github.com/libp2p/go-libp2p-kbucket v0.3.1/go.mod h1:oyjT5O7tS9CQurok++ERgc46YLwEpuGoFq9ubvoUOio=
github.com/libp2p/go-libp2p-kbucket v0.4.7 h1:spZAcgxifvFZHBD8tErvppbnNiKA5uokDu3CV7axu70=
github.com/libp2p/go-libp2p-kbucket v0.4.7/go.mod h1:XyVo99AfQH0foSf176k4jY1xUJ2+jUJIZCSDm7r2YKk=
Expand Down

0 comments on commit 66b11ea

Please sign in to comment.