mirror of
https://github.com/ipfs/kubo.git
synced 2025-12-15 22:22:28 +08:00
fix: run tests in "dht server" mode
Otherwise, we'd need to wait a delay on start for nodes to start becoming servers.
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/ipfs/go-ipfs/core/bootstrap"
|
||||
"github.com/ipfs/go-ipfs/core/coreapi"
|
||||
mock "github.com/ipfs/go-ipfs/core/mock"
|
||||
"github.com/ipfs/go-ipfs/core/node/libp2p"
|
||||
"github.com/ipfs/go-ipfs/keystore"
|
||||
"github.com/ipfs/go-ipfs/repo"
|
||||
|
||||
@@ -78,6 +79,7 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int)
|
||||
}
|
||||
|
||||
node, err := core.NewNode(ctx, &core.BuildCfg{
|
||||
Routing: libp2p.DHTServerOption,
|
||||
Repo: r,
|
||||
Host: mock.MockHostOption(mn),
|
||||
Online: fullIdentity,
|
||||
|
||||
@@ -91,6 +91,7 @@ func MockPublicNode(ctx context.Context, mn mocknet.Mocknet) (*core.IpfsNode, er
|
||||
cfg.Datastore = config.Datastore{}
|
||||
return core.NewNode(ctx, &core.BuildCfg{
|
||||
Online: true,
|
||||
Routing: libp2p2.DHTServerOption,
|
||||
Repo: &repo.Mock{
|
||||
C: *cfg,
|
||||
D: ds,
|
||||
|
||||
Reference in New Issue
Block a user