Skip to content

Commit

Permalink
Merge pull request #2 from wetware/addDHT
Browse files Browse the repository at this point in the history
Add DHT
  • Loading branch information
lthibault authored May 29, 2024
2 parents b3a7122 + 3c81785 commit 847e6df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/run/run.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package run

import (
"context"
"net/http"

"github.com/ipfs/kubo/client/rpc"
iface "github.com/ipfs/kubo/core/coreiface"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-kad-dht"
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"
ma "github.com/multiformats/go-multiaddr"
"github.com/thejerf/suture/v4"
Expand Down Expand Up @@ -60,6 +62,12 @@ func run() cli.ActionFunc {
}
defer h.Close()

dht, err := dht.New(context.Background(), h)
if err != nil {
return err
}
defer dht.Close()

wetware := suture.New("ww", suture.Spec{
EventHook: util.EventHook,
})
Expand All @@ -69,7 +77,7 @@ func run() cli.ActionFunc {
NS: s,
IPFS: node,
Host: routedhost.Wrap(h, node.Routing()),
// Router: /* TODO: assign DHT here */,
Router: dht,
}.Build(c.Context))
}

Expand Down

0 comments on commit 847e6df

Please sign in to comment.