Hi everybody.
I’m trying to make my Kubo node use Bitswap client, only.
The reason is we moved our Bitswap server to a dedicated service, which just uses:
import "github.com/ipfs/boxo/bitswap/server"
...
s := server.New(ctx, network, bstore, opts)
My strategy so far consists of using a Fx plugin to inject the client as exchange.Interface
:
import "github.com/ipfs/boxo/bitswap/client"
...
type onlineExchangeIn struct {
fx.In
Mctx helpers.MetricsCtx `optional:"true"`
Host host.Host `optional:"true"`
Rt irouting.ProvideManyRouter `optional:"true"`
Bs blockstore.GCBlockstore `optional:"true"`
}
func (i *ExchangePlugin) Options(info core.FXNodeInfo) ([]fx.Option, error) {
return append(info.FXOptions, fx.Decorate(func(lc fx.Lifecycle, in onlineExchangeIn, bs blockstore.Blockstore) exchange.Interface {
// ...
// return client.New(helpers.LifecycleCtx(in.Mctx, lc), bitswapNetwork, in.Bs, opts...)
The injection works but… when I try to fetch a CID (via api/v0/cat or get, for example) that’s not stored in the local blockstore, I always get a timeout.
It seems to hang up at: boxo/bitswap/client/internal/getter/getter.go at main · ipfs/boxo · GitHub