forked from TrueCloudLab/frostfs-node
[#11] Trim the old functionality
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
783ec72d56
commit
a87fdab324
235 changed files with 39 additions and 36211 deletions
|
@ -1,37 +1,10 @@
|
|||
package wrapper
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/core/netmap"
|
||||
contract "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
// NodeInfo groups information about NeoFS storage node.
|
||||
type NodeInfo struct{}
|
||||
|
||||
// AddPeer registers peer in NeoFS network through
|
||||
// Netmap contract call.
|
||||
func (w *Wrapper) AddPeer(nodeInfo netmap.Info) error {
|
||||
// prepare invocation arguments
|
||||
args := contract.AddPeerArgs{}
|
||||
|
||||
info := contract.PeerInfo{}
|
||||
info.SetPublicKey(nodeInfo.PublicKey())
|
||||
info.SetAddress([]byte(nodeInfo.Address()))
|
||||
|
||||
opts := nodeInfo.Options()
|
||||
binOpts := make([][]byte, 0, len(opts))
|
||||
|
||||
for i := range opts {
|
||||
binOpts = append(binOpts, []byte(opts[i]))
|
||||
}
|
||||
|
||||
info.SetOptions(binOpts)
|
||||
|
||||
args.SetInfo(info)
|
||||
|
||||
// invoke smart contract call
|
||||
//
|
||||
// Note: errors.Wrap returns nil on nil error arg.
|
||||
return errors.Wrap(
|
||||
w.client.AddPeer(args),
|
||||
"could not invoke smart contract",
|
||||
)
|
||||
func (w *Wrapper) AddPeer(nodeInfo NodeInfo) error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue