Documentation ¶
Index ¶
- func TagForCommittee(kind scheduler.CommitteeKind) string
- type AccessPolicy
- type CommitteeInfo
- type EpochSnapshot
- func (e *EpochSnapshot) GetEpochHeight() int64
- func (e *EpochSnapshot) GetEpochNumber() beacon.EpochTime
- func (e *EpochSnapshot) GetExecutorCommittee() *CommitteeInfo
- func (e *EpochSnapshot) GetRuntime() *registry.Runtime
- func (e *EpochSnapshot) IsExecutorBackupWorker() bool
- func (e *EpochSnapshot) IsExecutorMember() bool
- func (e *EpochSnapshot) IsExecutorWorker() bool
- func (e *EpochSnapshot) IsValid() bool
- func (e *EpochSnapshot) Node(_ context.Context, id signature.PublicKey) (*node.Node, error)
- func (e *EpochSnapshot) Nodes() nodes.NodeDescriptorLookup
- type Group
- type KeyManagerClientWrapper
- type Node
- func (n *Node) AddHooks(hooks NodeHooks)
- func (n *Node) Cleanup()
- func (n *Node) GetMinRepublishInterval() time.Duration
- func (n *Node) GetRuntime() runtimeRegistry.Runtime
- func (n *Node) GetStatus() (*api.Status, error)
- func (n *Node) Initialized() <-chan struct{}
- func (n *Node) Name() string
- func (n *Node) NewRuntimeHostHandler() protocol.Handler
- func (n *Node) NewRuntimeHostNotifier(ctx context.Context, host host.Runtime) protocol.Notifier
- func (n *Node) PublishTx(ctx context.Context, tx []byte) error
- func (n *Node) Quit() <-chan struct{}
- func (n *Node) Start() error
- func (n *Node) Stop()
- type NodeHooks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TagForCommittee ¶ added in v0.2012.0
func TagForCommittee(kind scheduler.CommitteeKind) string
TagForCommittee returns node lookup tag for scheduler committee kind.
Types ¶
type AccessPolicy ¶
AccessPolicy defines a list of actions that are allowed by the policy.
func (AccessPolicy) AddPublicKeyPolicy ¶
func (ap AccessPolicy) AddPublicKeyPolicy(policy *accessctl.Policy, pubKey signature.PublicKey)
AddPublicKeyPolicy augments the given policy by allowing actions in the current AccessPolicy to given TLS public key.
func (AccessPolicy) AddRulesForNodeRoles ¶
func (ap AccessPolicy) AddRulesForNodeRoles( policy *accessctl.Policy, nodes []*node.Node, roles node.RolesMask, )
AddRulesForNodeRoles augments the given policy by allowing actions in the current AccessPolicy for the nodes that have the given roles mask.
func (AccessPolicy) AddRulesForNodes ¶ added in v0.2200.0
func (ap AccessPolicy) AddRulesForNodes(policy *accessctl.Policy, nodes []*node.Node)
AddRulesForNodes augments the given policy by allowing actions in the current AccessPolicy for the specified list of nodes.
type CommitteeInfo ¶
type CommitteeInfo struct { Indices []int Roles []scheduler.Role Committee *scheduler.Committee PublicKeys map[signature.PublicKey]struct{} Peers map[signature.PublicKey]struct{} }
CommitteeInfo contains information about a committee of nodes.
type EpochSnapshot ¶
type EpochSnapshot struct {
// contains filtered or unexported fields
}
EpochSnapshot is an immutable snapshot of epoch state.
func (*EpochSnapshot) GetEpochHeight ¶ added in v0.2200.0
func (e *EpochSnapshot) GetEpochHeight() int64
GetEpochHeight returns the consensus height corresponding to the epoch transition.
func (*EpochSnapshot) GetEpochNumber ¶
func (e *EpochSnapshot) GetEpochNumber() beacon.EpochTime
GetEpochNumber returns the sequential number of the epoch.
func (*EpochSnapshot) GetExecutorCommittee ¶ added in v0.2010.0
func (e *EpochSnapshot) GetExecutorCommittee() *CommitteeInfo
GetExecutorCommittee returns the current executor committee.
func (*EpochSnapshot) GetRuntime ¶
func (e *EpochSnapshot) GetRuntime() *registry.Runtime
GetRuntime returns the current runtime descriptor.
func (*EpochSnapshot) IsExecutorBackupWorker ¶
func (e *EpochSnapshot) IsExecutorBackupWorker() bool
IsExecutorBackupWorker checks if the current node is a backup worker of the executor committee in the current epoch.
func (*EpochSnapshot) IsExecutorMember ¶
func (e *EpochSnapshot) IsExecutorMember() bool
IsExecutorMember checks if the current node is a member of the executor committee in the current epoch.
func (*EpochSnapshot) IsExecutorWorker ¶
func (e *EpochSnapshot) IsExecutorWorker() bool
IsExecutorWorker checks if the current node is a worker of the executor committee in the current epoch.
func (*EpochSnapshot) IsValid ¶ added in v0.2200.0
func (e *EpochSnapshot) IsValid() bool
IsValid checks whether the given epoch snapshot is valid (represents an actual epoch).
func (*EpochSnapshot) Nodes ¶
func (e *EpochSnapshot) Nodes() nodes.NodeDescriptorLookup
Nodes returns a node descriptor lookup interface.
type Group ¶
Group encapsulates communication with a group of nodes in the runtime committees.
func NewGroup ¶
func NewGroup( ctx context.Context, identity *identity.Identity, runtime runtimeRegistry.Runtime, consensus consensus.Backend, ) (*Group, error)
NewGroup creates a new group.
func (*Group) EpochTransition ¶
EpochTransition processes an epoch transition that just happened.
func (*Group) GetEpochSnapshot ¶
func (g *Group) GetEpochSnapshot() *EpochSnapshot
GetEpochSnapshot returns a snapshot of the currently active epoch.
func (*Group) RoundTransition ¶
func (g *Group) RoundTransition()
RoundTransition processes a round transition that just happened.
type KeyManagerClientWrapper ¶ added in v0.2201.5
type KeyManagerClientWrapper struct {
// contains filtered or unexported fields
}
KeyManagerClientWrapper is a wrapper for the key manager P2P client that handles deferred initialization after the key manager runtime ID is known.
It also handles peer feedback propagation from EnclaveRPC in the runtime.
func NewKeyManagerClientWrapper ¶ added in v0.2201.7
func NewKeyManagerClientWrapper(p2p p2p.Service, consensus consensus.Backend, chainContext string, logger *logging.Logger) *KeyManagerClientWrapper
NewKeyManagerClientWrapper creates a new key manager client wrapper.
func (*KeyManagerClientWrapper) CallEnclave ¶ added in v0.2201.5
func (km *KeyManagerClientWrapper) CallEnclave( ctx context.Context, data []byte, nodes []signature.PublicKey, kind enclaverpc.Kind, pf *enclaverpc.PeerFeedback, ) ([]byte, signature.PublicKey, error)
CallEnclave implements runtimeKeymanager.Client.
func (*KeyManagerClientWrapper) Initialized ¶ added in v0.2201.5
func (km *KeyManagerClientWrapper) Initialized() <-chan struct{}
Initialized returns a channel that gets closed when the client is initialized.
func (*KeyManagerClientWrapper) SetKeyManagerID ¶ added in v0.2201.7
func (km *KeyManagerClientWrapper) SetKeyManagerID(id *common.Namespace)
SetKeyManagerID configures the key manager runtime ID to use.
type Node ¶
type Node struct { *runtimeRegistry.RuntimeHostNode ChainContext string Runtime runtimeRegistry.Runtime HostNode control.NodeController Identity *identity.Identity KeyManager keymanager.Backend KeyManagerClient *KeyManagerClientWrapper Consensus consensus.Backend LightClient consensus.LightClient Group *Group P2P p2pAPI.Service TxPool txpool.TransactionPool // Mutable and shared between nodes' workers. // Guarded by .CrossNode. CrossNode sync.Mutex CurrentBlock *block.Block CurrentBlockHeight int64 CurrentConsensusBlock *consensus.LightBlock CurrentDescriptor *registry.Runtime CurrentEpoch beacon.EpochTime // contains filtered or unexported fields }
Node is a committee node.
func NewNode ¶
func NewNode( chainContext string, hostNode control.NodeController, runtime runtimeRegistry.Runtime, identity *identity.Identity, keymanager keymanager.Backend, consensus consensus.Backend, lightClient consensus.LightClient, p2pHost p2pAPI.Service, txPoolCfg tpConfig.Config, ) (*Node, error)
func (*Node) Cleanup ¶
func (n *Node) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Node) GetMinRepublishInterval ¶ added in v0.2200.0
GetMinRepublishInterval returns the minimum republish interval that needs to be respected by the caller when publishing the same message. If Publish is called for the same message more quickly, the message may be dropped and not published.
func (*Node) GetRuntime ¶
func (n *Node) GetRuntime() runtimeRegistry.Runtime
GetRuntime implements RuntimeHostHandlerFactory.
func (*Node) Initialized ¶
func (n *Node) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the node is initialized and ready to service requests.
func (*Node) NewRuntimeHostHandler ¶
NewRuntimeHostHandler implements RuntimeHostHandlerFactory.
func (*Node) NewRuntimeHostNotifier ¶ added in v0.2103.0
NewRuntimeHostNotifier implements RuntimeHostHandlerFactory.
type NodeHooks ¶
type NodeHooks interface { // Guarded by CrossNode. HandleNewBlockEarlyLocked(*runtime.BlockInfo) // Guarded by CrossNode. HandleNewBlockLocked(*runtime.BlockInfo) // Guarded by CrossNode. HandleRuntimeHostEventLocked(*host.Event) // Initialized returns a channel that will be closed when the worker is initialized and ready // to service requests. Initialized() <-chan struct{} }
NodeHooks defines a worker's duties at common events. These are called from the runtime's common node's worker.