forked from TrueCloudLab/frostfs-node
[#15] Use api-go definition of NodeInfo in node
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
f0ee275ce6
commit
ee9551992c
4 changed files with 20 additions and 120 deletions
|
@ -25,13 +25,16 @@ func bootstrapNode(c *cfg) {
|
|||
cli, err := netmap.New(staticClient)
|
||||
fatalOnErr(err)
|
||||
|
||||
peerInfo := new(netmap.PeerInfo)
|
||||
peerInfo := new(netmap.NodeInfo)
|
||||
peerInfo.SetAddress(c.cfgNodeInfo.address)
|
||||
peerInfo.SetPublicKey(crypto.MarshalPublicKey(&c.key.PublicKey))
|
||||
// todo: add attributes as opts
|
||||
|
||||
rawInfo, err := peerInfo.StableMarshal(nil)
|
||||
fatalOnErr(err)
|
||||
|
||||
args := new(netmap.AddPeerArgs)
|
||||
args.SetInfo(*peerInfo)
|
||||
args.SetInfo(rawInfo)
|
||||
err = cli.AddPeer(*args)
|
||||
fatalOnErr(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue