Skip to content

Commit

Permalink
Minor refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
lthibault committed Aug 5, 2024
1 parent 5ef8f1b commit c01b775
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/ipfs/kubo/client/rpc"
iface "github.com/ipfs/kubo/core/coreiface"
"github.com/libp2p/go-libp2p"
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"
ma "github.com/multiformats/go-multiaddr"
"github.com/thejerf/suture/v4"
"github.com/urfave/cli/v2"
Expand Down Expand Up @@ -68,7 +67,7 @@ func run() cli.ActionFunc {
wetware.Add(ww.Config{
NS: ns,
IPFS: node,
Host: routedhost.Wrap(h, node.Routing()),
Host: h,
}.Build())
}

Expand Down
6 changes: 6 additions & 0 deletions ww.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/ipfs/boxo/path"
iface "github.com/ipfs/kubo/core/coreiface"
"github.com/libp2p/go-libp2p/core/host"
routedhost "github.com/libp2p/go-libp2p/p2p/host/routed"
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
"github.com/thejerf/suture/v4"
Expand Down Expand Up @@ -42,6 +43,11 @@ func (config Config) Build() Cluster {
WithCloseOnContextDone(true)
}

// Use the public IPFS DHT for routing.
config.Host = routedhost.Wrap(
config.Host,
config.IPFS.Routing())

return Cluster{
Config: config,
}
Expand Down

0 comments on commit c01b775

Please sign in to comment.