Documentation ¶
Overview ¶
Package node implements the Oasis node.
Index ¶
- Constants
- Variables
- func Register(parentCmd *cobra.Command)
- func Run(_ *cobra.Command, _ []string)
- type Node
- func (n *Node) CancelUpgrade(_ context.Context, descriptor *upgrade.Descriptor) error
- func (n *Node) Cleanup()
- func (n *Node) GetStatus(ctx context.Context) (*control.Status, error)
- func (n *Node) IsReady(ctx context.Context) (bool, error)
- func (n *Node) IsSynced(ctx context.Context) (bool, error)
- func (n *Node) RegistrationStopped()
- func (n *Node) RequestShutdown(ctx context.Context, wait bool) error
- func (n *Node) SetEpoch(ctx context.Context, epoch beacon.EpochTime) error
- func (n *Node) Stop()
- func (n *Node) UpgradeBinary(_ context.Context, descriptor *upgrade.Descriptor) error
- func (n *Node) Wait()
- func (n *Node) WaitNodesRegistered(ctx context.Context, count int) error
- func (n *Node) WaitReady(ctx context.Context) error
- func (n *Node) WaitSync(ctx context.Context) error
- type SeedNode
- func (n *SeedNode) CancelUpgrade(context.Context, *upgrade.Descriptor) error
- func (n *SeedNode) Cleanup()
- func (n *SeedNode) GetStatus(_ context.Context) (*control.Status, error)
- func (n *SeedNode) IsReady(context.Context) (bool, error)
- func (n *SeedNode) IsSynced(context.Context) (bool, error)
- func (n *SeedNode) RequestShutdown(context.Context, bool) error
- func (n *SeedNode) Stop()
- func (n *SeedNode) UpgradeBinary(context.Context, *upgrade.Descriptor) error
- func (n *SeedNode) Wait()
- func (n *SeedNode) WaitReady(context.Context) error
- func (n *SeedNode) WaitSync(context.Context) error
Constants ¶
const ( CfgDataDir = "datadir" // CfgPreserveLocalStorage exempts the untrusted local storage from // the unsafe-reset sub-command. CfgPreserveLocalStorage = "preserve.local_storage" // CfgPreserveMKVSDatabase exempts the MKVS database from the unsafe-reset // sub-command. CfgPreserveMKVSDatabase = "preserve.mkvs_database" )
Variables ¶
var Flags = flag.NewFlagSet("", flag.ContinueOnError)
Flags has the configuration flags.
Functions ¶
Types ¶
type Node ¶
type Node struct { Consensus consensusAPI.Backend LightClient consensusAPI.LightService Upgrader upgradeAPI.Backend Genesis genesisAPI.Provider Identity *identity.Identity Sentry sentryAPI.Backend IAS []iasAPI.Endpoint RuntimeRegistry runtimeRegistry.Registry CommonWorker *workerCommon.Worker ExecutorWorker *executor.Worker StorageWorker *workerStorage.Worker ClientWorker *workerClient.Worker SentryWorker *workerSentry.Worker P2P p2pAPI.Service RegistrationWorker *registration.Worker KeymanagerWorker *workerKeymanager.Worker BeaconWorker *workerBeacon.Worker // contains filtered or unexported fields }
Node is the Oasis node service.
WARNING: This is exposed for the benefit of tests and the interface is not guaranteed to be stable.
func NewNode ¶
NewNode initializes and launches the Oasis node service.
WARNING: This will misbehave iff cmd != RootCommand(). This is exposed for the benefit of tests and the interface is not guaranteed to be stable.
Note: the reason for having the named err return value here is for the deferred func below to propagate the error.
func (*Node) CancelUpgrade ¶ added in v0.2300.0
CancelUpgrade implements control.NodeController.
func (*Node) RegistrationStopped ¶
func (n *Node) RegistrationStopped()
RegistrationStopped implements registration.Delegate.
func (*Node) RequestShutdown ¶
RequestShutdown implements control.NodeController.
func (*Node) UpgradeBinary ¶ added in v0.2300.0
UpgradeBinary implements control.NodeController.
func (*Node) Wait ¶
func (n *Node) Wait()
Wait waits for the node to gracefully terminate. Callers MUST call Cleanup() after wait returns.
func (*Node) WaitNodesRegistered ¶ added in v0.2300.0
WaitNodesRegistered implements control.DebugController.
type SeedNode ¶ added in v0.2300.0
type SeedNode struct {
// contains filtered or unexported fields
}
SeedNode is the Oasis seed node service.
func NewSeedNode ¶ added in v0.2300.0
NewSeedNode initializes the seed node.
func (*SeedNode) CancelUpgrade ¶ added in v0.2300.0
CancelUpgrade implements control.NodeController.
func (*SeedNode) Cleanup ¶ added in v0.2300.0
func (n *SeedNode) Cleanup()
Cleanup cleans up after the node has terminated.
func (*SeedNode) RequestShutdown ¶ added in v0.2300.0
RequestShutdown implements control.NodeController.
func (*SeedNode) Stop ¶ added in v0.2300.0
func (n *SeedNode) Stop()
Stop gracefully terminates the seed node.
func (*SeedNode) UpgradeBinary ¶ added in v0.2300.0
UpgradeBinary implements control.NodeController.
func (*SeedNode) Wait ¶ added in v0.2300.0
func (n *SeedNode) Wait()
Wait waits for the node to gracefully terminate. Callers MUST call Cleanup() after wait returns.