Documentation ¶
Index ¶
- func IntegerAssert(item stackitem.Item) (interface{}, error)
- func StringAssert(item stackitem.Item) (interface{}, error)
- func WriteConfig(dst ConfigWriter, iterator func(func(key, val []byte) error) error) error
- type AddPeerPrm
- type Client
- func (c *Client) AddPeer(p AddPeerPrm) error
- func (c *Client) AuditFee() (uint64, error)
- func (c *Client) BasicIncomeRate() (uint64, error)
- func (c *Client) ContainerAliasFee() (uint64, error)
- func (c *Client) ContainerFee() (uint64, error)
- func (c Client) ContractAddress() util.Uint160
- func (c *Client) EigenTrustAlpha() (float64, error)
- func (c *Client) EigenTrustIterations() (uint64, error)
- func (c *Client) Epoch() (uint64, error)
- func (c *Client) EpochDuration() (uint64, error)
- func (c *Client) GetCandidates() (*netmap.Netmap, error)
- func (c *Client) GetInnerRingList() (keys.PublicKeys, error)
- func (c *Client) GetNetMap(diff uint64) (*netmap.Netmap, error)
- func (c *Client) GetNetMapByEpoch(epoch uint64) (*netmap.Netmap, error)
- func (c *Client) InnerRingCandidateFee() (uint64, error)
- func (c *Client) IterateConfigParameters(f func(key, value []byte) error) error
- func (c *Client) LastEpochBlock() (uint32, error)
- func (c *Client) MaxObjectSize() (uint64, error)
- func (c Client) Morph() *client.Client
- func (c *Client) NetMap() ([][]byte, error)
- func (c *Client) NewEpoch(epoch uint64) error
- func (c *Client) SetConfig(p SetConfigPrm) error
- func (c *Client) Snapshot() (*netmap.Netmap, error)
- func (c *Client) UpdateInnerRing(p UpdateIRPrm) error
- func (c *Client) UpdatePeerState(p UpdatePeerPrm) error
- func (c *Client) WithdrawFee() (uint64, error)
- type ConfigWriter
- type NodeInfo
- type Option
- type SetConfigPrm
- type State
- type UpdateIRPrm
- type UpdatePeerPrm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntegerAssert ¶ added in v0.12.0
IntegerAssert converts stack item to int64.
func StringAssert ¶ added in v0.19.0
StringAssert converts stack item to string.
func WriteConfig ¶ added in v0.28.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.28.0
type AddPeerPrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
AddPeerPrm groups parameters of AddPeer operation.
func (*AddPeerPrm) SetNodeInfo ¶ added in v0.28.0
func (a *AddPeerPrm) SetNodeInfo(nodeInfo *netmap.NodeInfo)
SetNodeInfo sets new peer NodeInfo.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper over StaticClient which makes calls with the names and arguments of the NeoFS Netmap contract.
Working client must be created via constructor New. Using the Client that has been created with new(Client) expression (or just declaring a Client variable) is unsafe and can lead to panic.
func NewFromMorph ¶ added in v0.28.0
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...Option) (*Client, error)
NewFromMorph returns the wrapper instance from the raw morph client.
func (*Client) AddPeer ¶
func (c *Client) AddPeer(p AddPeerPrm) error
AddPeer registers peer in NeoFS network through Netmap contract call.
func (*Client) AuditFee ¶ added in v0.28.0
AuditFee returns audit fee configuration value from network config in netmap contract.
func (*Client) BasicIncomeRate ¶ added in v0.28.0
BasicIncomeRate returns basic income rate configuration value from network config in netmap contract.
func (*Client) ContainerAliasFee ¶ added in v0.28.0
ContainerAliasFee returns additional fee paid by container owner to each alphabet node for container nice name registration.
func (*Client) ContainerFee ¶ added in v0.28.0
ContainerFee returns fee paid by container owner to each alphabet node for container registration.
func (Client) ContractAddress ¶ added in v0.28.0
ContractAddress returns the address of the associated contract.
func (*Client) EigenTrustAlpha ¶ added in v0.28.0
EigenTrustAlpha returns global configuration value of alpha parameter. It receives the alpha as a string and tries to convert it to float.
func (*Client) EigenTrustIterations ¶ added in v0.28.0
EigenTrustIterations returns global configuration value of iteration cycles for EigenTrust algorithm per epoch.
func (*Client) Epoch ¶ added in v0.12.0
Epoch receives number of current NeoFS epoch through the Netmap contract call.
func (*Client) EpochDuration ¶ added in v0.28.0
EpochDuration returns number of sidechain blocks per one NeoFS epoch.
func (*Client) GetCandidates ¶ added in v0.28.0
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 (*Client) GetInnerRingList ¶ added in v0.28.0
func (c *Client) GetInnerRingList() (keys.PublicKeys, error)
GetInnerRingList return current IR list.
func (*Client) GetNetMap ¶ added in v0.28.0
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 (*Client) GetNetMapByEpoch ¶ added in v0.28.0
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 (*Client) InnerRingCandidateFee ¶ added in v0.28.0
InnerRingCandidateFee returns global configuration value of fee paid by node to be in inner ring candidates list.
func (*Client) IterateConfigParameters ¶ added in v0.28.0
IterateConfigParameters iterates over configuration parameters stored in Netmap contract and passes them to f.
Returns f's errors directly.
func (*Client) LastEpochBlock ¶ added in v0.23.0
LastEpochBlock receives block number of current NeoFS epoch through the Netmap contract call.
func (*Client) MaxObjectSize ¶ added in v0.28.0
MaxObjectSize receives max object size configuration value through the Netmap contract call.
func (*Client) NetMap ¶
NetMap performs the test invoke of get network map method of NeoFS Netmap contract.
func (*Client) SetConfig ¶ added in v0.22.0
func (c *Client) SetConfig(p SetConfigPrm) error
SetConfig sets config field.
func (*Client) Snapshot ¶ added in v0.12.0
Snapshot returns current netmap node infos. Consider using pkg/morph/client/netmap for this.
func (*Client) UpdateInnerRing ¶ added in v0.23.0
func (c *Client) UpdateInnerRing(p UpdateIRPrm) error
UpdateInnerRing updates inner ring keys.
func (*Client) UpdatePeerState ¶ added in v0.28.0
func (c *Client) UpdatePeerState(p UpdatePeerPrm) error
UpdatePeerState changes peer status through Netmap contract call.
func (*Client) WithdrawFee ¶ added in v0.28.0
WithdrawFee returns global configuration value of fee paid by user to withdraw assets from NeoFS contract.
type ConfigWriter ¶ added in v0.28.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 ¶
type Option func(*opts)
Option allows to set an optional parameter of Wrapper.
func AsAlphabet ¶ added in v0.28.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.
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 State ¶ added in v0.22.1
type State int64
State is an enumeration of various states of the NeoFS node.
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.28.0
type UpdatePeerPrm struct { client.InvokePrmOptional // contains filtered or unexported fields }
UpdatePeerPrm groups parameters of UpdatePeerState operation.
func (*UpdatePeerPrm) SetKey ¶ added in v0.28.0
func (u *UpdatePeerPrm) SetKey(key []byte)
SetKey sets public key.
func (*UpdatePeerPrm) SetState ¶ added in v0.28.0
func (u *UpdatePeerPrm) SetState(state netmap.NodeState)
SetState sets node state.