Documentation ¶
Index ¶
- type ImmutableState
- func (s *ImmutableState) AllRuntimes(ctx context.Context) ([]*registry.Runtime, error)
- func (s *ImmutableState) AnyRuntime(ctx context.Context, id common.Namespace) (rt *registry.Runtime, err error)
- func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*registry.ConsensusParameters, error)
- func (s *ImmutableState) Entities(ctx context.Context) ([]*entity.Entity, error)
- func (s *ImmutableState) Entity(ctx context.Context, id signature.PublicKey) (*entity.Entity, error)
- func (s *ImmutableState) GetEntityNodes(ctx context.Context, id signature.PublicKey) ([]*node.Node, error)
- func (s *ImmutableState) HasEntityNodes(ctx context.Context, id signature.PublicKey) (bool, error)
- func (s *ImmutableState) HasEntityRuntimes(ctx context.Context, id signature.PublicKey) (bool, error)
- func (s *ImmutableState) Node(ctx context.Context, id signature.PublicKey) (*node.Node, error)
- func (s *ImmutableState) NodeByConsensusAddress(ctx context.Context, address []byte) (*node.Node, error)
- func (s *ImmutableState) NodeBySubKey(ctx context.Context, key signature.PublicKey) (*node.Node, error)
- func (s *ImmutableState) NodeIDByConsensusAddress(ctx context.Context, address []byte) (signature.PublicKey, error)
- func (s *ImmutableState) NodeStatus(ctx context.Context, id signature.PublicKey) (*registry.NodeStatus, error)
- func (s *ImmutableState) Nodes(ctx context.Context) ([]*node.Node, error)
- func (s *ImmutableState) Runtime(ctx context.Context, id common.Namespace) (*registry.Runtime, error)
- func (s *ImmutableState) Runtimes(ctx context.Context) ([]*registry.Runtime, error)
- func (s *ImmutableState) SignedEntities(ctx context.Context) ([]*entity.SignedEntity, error)
- func (s *ImmutableState) SignedNodes(ctx context.Context) ([]*node.MultiSignedNode, error)
- func (s *ImmutableState) SuspendedRuntime(ctx context.Context, id common.Namespace) (*registry.Runtime, error)
- func (s *ImmutableState) SuspendedRuntimes(ctx context.Context) ([]*registry.Runtime, error)
- type MutableState
- func (s *MutableState) RemoveEntity(ctx context.Context, id signature.PublicKey) (*entity.Entity, error)
- func (s *MutableState) RemoveNode(ctx context.Context, node *node.Node) error
- func (s *MutableState) ResumeRuntime(ctx context.Context, id common.Namespace) error
- func (s *MutableState) SetConsensusParameters(ctx context.Context, params *registry.ConsensusParameters) error
- func (s *MutableState) SetEntity(ctx context.Context, ent *entity.Entity, sigEnt *entity.SignedEntity) error
- func (s *MutableState) SetNode(ctx context.Context, existingNode, node *node.Node, ...) error
- func (s *MutableState) SetNodeStatus(ctx context.Context, id signature.PublicKey, status *registry.NodeStatus) error
- func (s *MutableState) SetRuntime(ctx context.Context, rt *registry.Runtime, suspended bool) error
- func (s *MutableState) SuspendRuntime(ctx context.Context, id common.Namespace) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImmutableState ¶
type ImmutableState struct {
// contains filtered or unexported fields
}
ImmutableState is the immutable registry state wrapper.
func NewImmutableState ¶
func NewImmutableState(ctx context.Context, state abciAPI.ApplicationQueryState, version int64) (*ImmutableState, error)
func (*ImmutableState) AllRuntimes ¶
AllRuntimes returns a list of all registered runtimes (suspended included).
func (*ImmutableState) AnyRuntime ¶
func (s *ImmutableState) AnyRuntime(ctx context.Context, id common.Namespace) (rt *registry.Runtime, err error)
AnyRuntime looks up either an active or suspended runtime by its identifier and returns it.
func (*ImmutableState) ConsensusParameters ¶
func (s *ImmutableState) ConsensusParameters(ctx context.Context) (*registry.ConsensusParameters, error)
ConsensusParameters returns the registry consensus parameters.
func (*ImmutableState) Entity ¶
func (s *ImmutableState) Entity(ctx context.Context, id signature.PublicKey) (*entity.Entity, error)
Entity looks up a registered entity by its identifier.
func (*ImmutableState) GetEntityNodes ¶ added in v0.2100.0
func (s *ImmutableState) GetEntityNodes(ctx context.Context, id signature.PublicKey) ([]*node.Node, error)
GetEntityNodes returns nodes registered by given entity. Note that this returns both active and expired nodes.
func (*ImmutableState) HasEntityNodes ¶
HasEntityNodes checks whether an entity has any registered nodes.
func (*ImmutableState) HasEntityRuntimes ¶
func (s *ImmutableState) HasEntityRuntimes(ctx context.Context, id signature.PublicKey) (bool, error)
HasEntityRuntimes checks whether an entity has any registered runtimes.
func (*ImmutableState) NodeByConsensusAddress ¶
func (s *ImmutableState) NodeByConsensusAddress(ctx context.Context, address []byte) (*node.Node, error)
NodeByConsensusAddress looks up a specific node by its consensus address.
func (*ImmutableState) NodeBySubKey ¶
func (s *ImmutableState) NodeBySubKey(ctx context.Context, key signature.PublicKey) (*node.Node, error)
NodeBySubKey looks up a specific node by its consensus, P2P or TLS key.
func (*ImmutableState) NodeIDByConsensusAddress ¶ added in v0.2100.0
func (s *ImmutableState) NodeIDByConsensusAddress(ctx context.Context, address []byte) (signature.PublicKey, error)
NodeIDByConsensusAddress looks up a specific node ID by its consensus address.
If you need to get the actual node descriptor, use NodeByConsensusAddress instead.
func (*ImmutableState) NodeStatus ¶
func (s *ImmutableState) NodeStatus(ctx context.Context, id signature.PublicKey) (*registry.NodeStatus, error)
NodeStatus returns a specific node status.
func (*ImmutableState) Runtime ¶
func (s *ImmutableState) Runtime(ctx context.Context, id common.Namespace) (*registry.Runtime, error)
Runtime looks up a runtime by its identifier and returns it.
This excludes any suspended runtimes, use SuspendedRuntime to query suspended runtimes only.
func (*ImmutableState) Runtimes ¶
Runtimes returns a list of all registered runtimes.
This excludes any suspended runtimes.
func (*ImmutableState) SignedEntities ¶
func (s *ImmutableState) SignedEntities(ctx context.Context) ([]*entity.SignedEntity, error)
SignedEntities returns a list of all registered entities (signed).
func (*ImmutableState) SignedNodes ¶
func (s *ImmutableState) SignedNodes(ctx context.Context) ([]*node.MultiSignedNode, error)
SignedNodes returns a list of all registered nodes (in signed form).
func (*ImmutableState) SuspendedRuntime ¶
func (s *ImmutableState) SuspendedRuntime(ctx context.Context, id common.Namespace) (*registry.Runtime, error)
SuspendedRuntime looks up a suspended runtime by its identifier and returns it.
func (*ImmutableState) SuspendedRuntimes ¶
SuspendedRuntimes returns a list of all suspended runtimes.
type MutableState ¶
type MutableState struct { *ImmutableState // contains filtered or unexported fields }
MutableState is a mutable registry state wrapper.
func NewMutableState ¶
func NewMutableState(tree mkvs.KeyValueTree) *MutableState
NewMutableState creates a new mutable registry state wrapper.
func (*MutableState) RemoveEntity ¶
func (s *MutableState) RemoveEntity(ctx context.Context, id signature.PublicKey) (*entity.Entity, error)
RemoveEntity removes a previously registered entity.
func (*MutableState) RemoveNode ¶
RemoveNode removes a registered node.
func (*MutableState) ResumeRuntime ¶
ResumeRuntime resumes a previously suspended runtime.
func (*MutableState) SetConsensusParameters ¶
func (s *MutableState) SetConsensusParameters(ctx context.Context, params *registry.ConsensusParameters) error
SetConsensusParameters sets registry consensus parameters.
NOTE: This method must only be called from InitChain/EndBlock contexts.
func (*MutableState) SetEntity ¶
func (s *MutableState) SetEntity(ctx context.Context, ent *entity.Entity, sigEnt *entity.SignedEntity) error
SetEntity sets a signed entity descriptor for a registered entity.
func (*MutableState) SetNode ¶
func (s *MutableState) SetNode(ctx context.Context, existingNode, node *node.Node, signedNode *node.MultiSignedNode) error
SetNode sets a signed node descriptor for a registered node.
func (*MutableState) SetNodeStatus ¶
func (s *MutableState) SetNodeStatus(ctx context.Context, id signature.PublicKey, status *registry.NodeStatus) error
SetNodeStatus sets a status for a registered node.
func (*MutableState) SetRuntime ¶
SetRuntime sets a runtime descriptor for a registered runtime.
func (*MutableState) SuspendRuntime ¶
SuspendRuntime marks a runtime as suspended.