wrapper

package
v0.27.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteConfig added in v0.26.0

func WriteConfig(dst ConfigWriter, iterator func(func(key, val []byte) error) error) error

WriteConfig writes NeoFS network configuration received via iterator.

Returns iterator's errors directly.

Types

type AddPeerPrm added in v0.27.0

type AddPeerPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

AddPeerPrm groups parameters of AddPeer operation.

func (*AddPeerPrm) SetNodeInfo added in v0.27.0

func (a *AddPeerPrm) SetNodeInfo(nodeInfo *netmap.NodeInfo)

SetNodeInfo sets new peer NodeInfo.

type ConfigWriter added in v0.26.0

type ConfigWriter interface {
	UnknownParameter(string, []byte)
	MaxObjectSize(uint64)
	BasicIncomeRate(uint64)
	AuditFee(uint64)
	EpochDuration(uint64)
	ContainerFee(uint64)
	ContainerAliasFee(uint64)
	EigenTrustIterations(uint64)
	EigenTrustAlpha(float64)
	InnerRingCandidateFee(uint64)
	WithdrawFee(uint64)
}

ConfigWriter is an interface of NeoFS network config writer.

type Option added in v0.25.0

type Option func(*opts)

Option allows to set an optional parameter of Wrapper.

func AsAlphabet added in v0.25.0

func AsAlphabet() Option

AsAlphabet returns option to sign main TX of notary requests with client's private key.

Considered to be used by IR nodes only.

func TryNotary added in v0.25.0

func TryNotary() Option

TryNotary returns option to enable notary invocation tries.

type SetConfigPrm added in v0.27.0

type SetConfigPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

SetConfigPrm groups parameters of SetConfig operation.

func (*SetConfigPrm) SetID added in v0.27.0

func (s *SetConfigPrm) SetID(id []byte)

SetID sets ID of the config value.

func (*SetConfigPrm) SetKey added in v0.27.0

func (s *SetConfigPrm) SetKey(key []byte)

SetKey sets key of the config value.

func (*SetConfigPrm) SetValue added in v0.27.0

func (s *SetConfigPrm) SetValue(value interface{})

SetValue sets value of the config value.

type UpdateIRPrm added in v0.27.0

type UpdateIRPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

UpdateIRPrm groups parameters of UpdateInnerRing invocation.

func (*UpdateIRPrm) SetKeys added in v0.27.0

func (u *UpdateIRPrm) SetKeys(keys keys.PublicKeys)

SetKeys sets new inner ring keys.

type UpdatePeerPrm added in v0.27.0

type UpdatePeerPrm struct {
	client.InvokePrmOptional
	// contains filtered or unexported fields
}

UpdatePeerPrm groups parameters of UpdatePeerState operation.

func (*UpdatePeerPrm) SetKey added in v0.27.0

func (u *UpdatePeerPrm) SetKey(key []byte)

SetKey sets public key.

func (*UpdatePeerPrm) SetState added in v0.27.0

func (u *UpdatePeerPrm) SetState(state netmap.NodeState)

SetState sets node state.

type Wrapper

type Wrapper struct {
	internal.StaticClient
	// 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 NewFromMorph added in v0.21.0

func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Wrapper, error)

NewFromMorph returns the wrapper instance from the raw morph client.

func (*Wrapper) AddPeer

func (w *Wrapper) AddPeer(prm AddPeerPrm) error

AddPeer registers peer in NeoFS network through Netmap contract call.

func (*Wrapper) AuditFee added in v0.19.0

func (w *Wrapper) AuditFee() (uint64, error)

AuditFee returns audit fee configuration value from network config in netmap contract.

func (*Wrapper) BasicIncomeRate added in v0.19.0

func (w *Wrapper) BasicIncomeRate() (uint64, error)

BasicIncomeRate returns basic income rate configuration value from network config in netmap contract.

func (*Wrapper) ContainerAliasFee added in v0.26.0

func (w *Wrapper) ContainerAliasFee() (uint64, error)

ContainerAliasFee returns additional fee paid by container owner to each alphabet node for container nice name registration.

func (*Wrapper) ContainerFee added in v0.19.0

func (w *Wrapper) ContainerFee() (uint64, error)

ContainerFee returns fee paid by container owner to each alphabet node for container registration.

func (*Wrapper) EigenTrustAlpha added in v0.19.0

func (w *Wrapper) EigenTrustAlpha() (float64, error)

EigenTrustAlpha returns global configuration value of alpha parameter. It receives the alpha as a string and tries to convert it to float.

func (*Wrapper) EigenTrustIterations added in v0.19.0

func (w *Wrapper) EigenTrustIterations() (uint64, error)

EigenTrustIterations returns global configuration value of iteration cycles for EigenTrust algorithm per epoch.

func (*Wrapper) Epoch added in v0.12.0

func (w *Wrapper) Epoch() (uint64, error)

Epoch receives number of current NeoFS epoch through the Netmap contract call.

func (*Wrapper) EpochDuration added in v0.19.0

func (w *Wrapper) EpochDuration() (uint64, error)

EpochDuration returns number of sidechain blocks per one NeoFS epoch.

func (Wrapper) GetCandidates added in v0.22.1

func (w Wrapper) GetCandidates() (*netmap.Netmap, error)

GetCandidates receives information list about candidates for the next epoch network map through the Netmap contract call, composes network map from them and returns it.

func (*Wrapper) GetInnerRingList added in v0.23.0

func (w *Wrapper) GetInnerRingList() (keys.PublicKeys, error)

GetInnerRingList return current IR list.

func (Wrapper) GetNetMap

func (w Wrapper) GetNetMap(diff uint64) (*netmap.Netmap, error)

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

func (w Wrapper) GetNetMapByEpoch(epoch uint64) (*netmap.Netmap, error)

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) InnerRingCandidateFee added in v0.19.0

func (w *Wrapper) InnerRingCandidateFee() (uint64, error)

InnerRingCandidateFee returns global configuration value of fee paid by node to be in inner ring candidates list.

func (*Wrapper) IterateConfigParameters added in v0.26.0

func (w *Wrapper) IterateConfigParameters(f func(key, value []byte) error) error

IterateConfigParameters iterates over configuration parameters stored in Netmap contract and passes them to f.

Returns f's errors directly.

func (*Wrapper) LastEpochBlock added in v0.23.0

func (w *Wrapper) LastEpochBlock() (uint32, error)

LastEpochBlock receives block number of current NeoFS epoch through the Netmap contract call.

func (*Wrapper) MaxObjectSize added in v0.12.0

func (w *Wrapper) MaxObjectSize() (uint64, error)

MaxObjectSize receives max object size configuration value through the Netmap contract call.

func (Wrapper) Morph added in v0.25.0

func (w Wrapper) Morph() *client.Client

Morph returns raw morph client.

func (*Wrapper) NewEpoch

func (w *Wrapper) NewEpoch(e uint64) error

NewEpoch updates NeoFS epoch number through Netmap contract call.

func (*Wrapper) SetConfig added in v0.22.0

func (w *Wrapper) SetConfig(prm SetConfigPrm) error

SetConfig sets config field.

func (*Wrapper) Snapshot added in v0.22.0

func (w *Wrapper) Snapshot() (*netmap.Netmap, error)

Snapshot returns current netmap node infos. Consider using pkg/morph/client/netmap for this.

func (*Wrapper) UpdateInnerRing added in v0.23.0

func (w *Wrapper) UpdateInnerRing(prm UpdateIRPrm) error

UpdateInnerRing updates inner ring keys.

func (*Wrapper) UpdatePeerState

func (w *Wrapper) UpdatePeerState(prm UpdatePeerPrm) error

UpdatePeerState changes peer status through Netmap contract call.

func (*Wrapper) WithdrawFee added in v0.19.0

func (w *Wrapper) WithdrawFee() (uint64, error)

WithdrawFee returns global configuration value of fee paid by user to withdraw assets from NeoFS contract.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL