frostfs-node/modules/node/peerstore.go

29 lines
534 B
Go
Raw Normal View History

package node
import (
"crypto/ecdsa"
"github.com/multiformats/go-multiaddr"
"github.com/nspcc-dev/neofs-node/lib/peers"
"go.uber.org/dig"
"go.uber.org/zap"
)
type peerstoreParams struct {
dig.In
Logger *zap.Logger
PrivateKey *ecdsa.PrivateKey
Address multiaddr.Multiaddr
Store peers.Storage `optional:"true"`
}
func newPeerstore(p peerstoreParams) (peers.Store, error) {
return peers.NewStore(peers.StoreParams{
Storage: p.Store,
Logger: p.Logger,
Addr: p.Address,
Key: p.PrivateKey,
})
}