Documentation
¶
Index ¶
- Variables
- type Config
- type Worker
- func (w *Worker) Cleanup()
- func (w *Worker) Enabled() bool
- func (w *Worker) GetConfig() Config
- func (w *Worker) GetRuntime(id common.Namespace) *committee.Node
- func (w *Worker) GetRuntimes() map[common.Namespace]*committee.Node
- func (w *Worker) Initialized() <-chan struct{}
- func (w *Worker) Name() string
- func (w *Worker) NewUnmanagedCommitteeNode(runtime runtimeRegistry.Runtime, enableP2P bool) (*committee.Node, error)
- func (w *Worker) Quit() <-chan struct{}
- func (w *Worker) Start() error
- func (w *Worker) Stop()
Constants ¶
This section is empty.
Variables ¶
var ( // CfgClientPort configures the worker client port. CfgClientPort = "worker.client.port" // CfgSentryAddresses configures addresses and public keys of sentry nodes the worker should // connect to. CfgSentryAddresses = "worker.sentry.address" // Flags has the configuration flags. Flags = flag.NewFlagSet("", flag.ContinueOnError) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ClientPort uint16
ClientAddresses []node.Address
SentryAddresses []node.TLSAddress
StorageCommitTimeout time.Duration
// contains filtered or unexported fields
}
Config contains common worker config.
type Worker ¶
type Worker struct {
HostNode control.ControlledNode
DataDir string
Identity *identity.Identity
Consensus consensus.Backend
Grpc *grpc.Server
GrpcPolicyWatcher policyAPI.PolicyWatcher
P2P *p2p.P2P
IAS ias.Endpoint
KeyManager keymanagerApi.Backend
RuntimeRegistry runtimeRegistry.Registry
GenesisDoc *genesis.Document
// contains filtered or unexported fields
}
Worker is a garbage bag with lower level services and common runtime objects.
func New ¶
func New( hostNode control.ControlledNode, dataDir string, enabled bool, identity *identity.Identity, consensus consensus.Backend, p2p *p2p.P2P, ias ias.Endpoint, keyManager keymanagerApi.Backend, runtimeRegistry runtimeRegistry.Registry, genesisDoc *genesis.Document, ) (*Worker, error)
New creates a new worker.
func (*Worker) Cleanup ¶
func (w *Worker) Cleanup()
Cleanup performs the service specific post-termination cleanup.
func (*Worker) GetRuntime ¶
GetRuntime returns a common committee node for the given runtime (if available).
In case the runtime with the specified id was not configured for this node it returns nil.
func (*Worker) GetRuntimes ¶
GetRuntimes returns a map of configured runtimes.
func (*Worker) Initialized ¶
func (w *Worker) Initialized() <-chan struct{}
Initialized returns a channel that will be closed when the transaction scheduler is initialized and ready to service requests.
func (*Worker) NewUnmanagedCommitteeNode ¶
func (w *Worker) NewUnmanagedCommitteeNode(runtime runtimeRegistry.Runtime, enableP2P bool) (*committee.Node, error)
NewUnmanagedCommitteeNode creates a new common committee node that is not managed by this worker.
Since the node is unmanaged the caller needs to ensure that the node will be properly terminated once started.
Note that this does not instruct the storage backend to watch the given runtime.