Documentation
¶
Index ¶
- Variables
- type Client
- type Epoch
- type Wrapper
- func (w *Wrapper) AddPeer(nodeInfo *netmap.NodeInfo) error
- func (w *Wrapper) Epoch() (uint64, error)
- func (w Wrapper) GetNetMap(diff uint64) (*netmap.Netmap, error)
- func (w Wrapper) GetNetMapByEpoch(epoch uint64) (*netmap.Netmap, error)
- func (w *Wrapper) InnerRingKeys() ([][]byte, error)
- func (w *Wrapper) MaxObjectSize() (uint64, error)
- func (w *Wrapper) NewEpoch(e Epoch) error
- func (w *Wrapper) UpdatePeerState(key []byte, state netmap.NodeState) error
Constants ¶
This section is empty.
Variables ¶
var ErrNilWrapper = errors.New("netmap contract client wrapper is nil")
ErrNilWrapper is returned by functions that expect a non-nil Wrapper pointer, but received nil.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents the Netmap contract client.
It is a type alias of github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap.Client.
type Epoch ¶ added in v0.12.0
type Epoch struct{}
Epoch represents the NeoFS epoch. FIXME: correct the definition.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a wrapper over netmap contract client which implements:
- network map storage;
- tool for peer state updating.
Working wrapper must be created via constructor New. Using the Wrapper that has been created with new(Wrapper) expression (or just declaring a Wrapper variable) is unsafe and can lead to panic.
func New ¶
New creates, initializes and returns the Wrapper instance.
If Client is nil, netmap.ErrNilClient is returned.
func (*Wrapper) Epoch ¶ added in v0.12.0
Epoch receives number of current NeoFS epoch through the Netmap contract call.
func (Wrapper) GetNetMap ¶
GetNetMap receives information list about storage nodes through the Netmap contract call, composes network map from them and returns it. With diff == 0 returns current network map, else return snapshot of previous network map.
func (Wrapper) GetNetMapByEpoch ¶ added in v0.14.1
GetNetMapByEpoch receives information list about storage nodes through the Netmap contract call, composes network map from them and returns it. Returns snapshot of the specified epoch number.
func (*Wrapper) InnerRingKeys ¶
InnerRingKeys receives public key list of inner ring nodes through Netmap contract call and returns it.
func (*Wrapper) MaxObjectSize ¶ added in v0.12.0
MaxObjectSize receives max object size configuration value through the Netmap contract call.