[#84] Run netmap service in neofs-node app

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-08 16:17:50 +03:00 committed by Alex Vanin
parent 20c27d0542
commit dee1d81b04
4 changed files with 41 additions and 13 deletions

View file

@ -1,12 +1,9 @@
package main
import (
v2netmap "github.com/nspcc-dev/neofs-api-go/v2/netmap"
crypto "github.com/nspcc-dev/neofs-crypto"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
"github.com/pkg/errors"
)
func initMorphComponents(c *cfg) {
@ -31,13 +28,3 @@ func initMorphComponents(c *cfg) {
c.cfgObject.netMapStorage = wrap
c.cfgNetmap.wrapper = wrap
}
func bootstrapNode(c *cfg) {
peerInfo := new(v2netmap.NodeInfo)
peerInfo.SetAddress(c.localAddr.String())
peerInfo.SetPublicKey(crypto.MarshalPublicKey(&c.key.PublicKey))
peerInfo.SetAttributes(c.cfgNodeInfo.attributes)
err := c.cfgNetmap.wrapper.AddPeer(peerInfo)
fatalOnErr(errors.Wrap(err, "bootstrap error"))
}