frostfs-node/modules/node/peerstore.go
alexvanin dadfd90dcd Initial commit
Initial public review release v0.10.0
2020-07-10 17:45:00 +03:00

28 lines
534 B
Go

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,
})
}