diff --git a/node/builder.go b/node/builder.go index 0520d62dd..6425b21d9 100644 --- a/node/builder.go +++ b/node/builder.go @@ -19,7 +19,6 @@ import ( "github.com/libp2p/go-libp2p-core/peerstore" "github.com/libp2p/go-libp2p-core/routing" dht "github.com/libp2p/go-libp2p-kad-dht" - "github.com/libp2p/go-libp2p-peerstore/pstoremem" pubsub "github.com/libp2p/go-libp2p-pubsub" record "github.com/libp2p/go-libp2p-record" "github.com/libp2p/go-libp2p/p2p/net/conngater" @@ -170,7 +169,7 @@ var LibP2P = Options( Override(new(dtypes.Bootstrapper), dtypes.Bootstrapper(false)), // Host dependencies - Override(new(peerstore.Peerstore), pstoremem.NewPeerstore), + Override(new(peerstore.Peerstore), lp2p.Peerstore), Override(PstoreAddSelfKeysKey, lp2p.PstoreAddSelfKeys), Override(StartListeningKey, lp2p.StartListening(config.DefaultFullNode().Libp2p.ListenAddresses)), diff --git a/node/modules/lp2p/host.go b/node/modules/lp2p/host.go index 66c45297a..982d9f4cd 100644 --- a/node/modules/lp2p/host.go +++ b/node/modules/lp2p/host.go @@ -10,6 +10,7 @@ import ( "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peerstore" dht "github.com/libp2p/go-libp2p-kad-dht" + "github.com/libp2p/go-libp2p-peerstore/pstoremem" record "github.com/libp2p/go-libp2p-record" routedhost "github.com/libp2p/go-libp2p/p2p/host/routed" mocknet "github.com/libp2p/go-libp2p/p2p/net/mock" @@ -33,6 +34,10 @@ type P2PHostIn struct { type RawHost host.Host +func Peerstore() (peerstore.Peerstore, error) { + return pstoremem.NewPeerstore() +} + func Host(mctx helpers.MetricsCtx, lc fx.Lifecycle, params P2PHostIn) (RawHost, error) { pkey := params.Peerstore.PrivKey(params.ID) if pkey == nil {