node

package
v0.2202.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Overview

Package node implements the Oasis node.

Index

Constants

View Source
const (
	// 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

Flags has the configuration flags.

Functions

func Register

func Register(parentCmd *cobra.Command)

Register registers the node maintenance sub-commands and all of it's children.

func Run

func Run(cmd *cobra.Command, args []string)

Run runs the Oasis node.

Types

type Node

type Node struct {
	NodeController  controlAPI.NodeController
	DebugController controlAPI.DebugController

	Consensus consensusAPI.Backend

	Upgrader upgradeAPI.Backend
	Genesis  genesisAPI.Provider
	Identity *identity.Identity
	Sentry   sentryAPI.LocalBackend
	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
	ConsensusWorker    *workerConsensusRPC.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

func NewNode() (node *Node, err error)

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) Cleanup

func (n *Node) Cleanup()

Cleanup cleans up after the node has terminated.

func (*Node) GetIdentity

func (n *Node) GetIdentity() *identity.Identity

GetIdentity implements control.ControlledNode.

func (*Node) GetKeymanagerStatus added in v0.2202.0

func (n *Node) GetKeymanagerStatus(ctx context.Context) (*keymanagerWorker.Status, error)

GetKeymanagerStatus implements control.ControlledNode.

func (*Node) GetPendingUpgrades added in v0.2100.0

func (n *Node) GetPendingUpgrades(ctx context.Context) ([]*upgrade.PendingUpgrade, error)

GetPendingUpgrades implements control.ControlledNode.

func (*Node) GetRegistrationStatus

func (n *Node) GetRegistrationStatus(ctx context.Context) (*control.RegistrationStatus, error)

GetRegistrationStatus implements control.ControlledNode.

func (*Node) GetRuntimeStatus added in v0.2010.0

func (n *Node) GetRuntimeStatus(ctx context.Context) (map[common.Namespace]control.RuntimeStatus, error)

GetRuntimeStatus implements control.ControlledNode.

func (*Node) Ready

func (n *Node) Ready() <-chan struct{}

Ready implements control.ControlledNode.

func (*Node) RegistrationStopped

func (n *Node) RegistrationStopped()

RegistrationStopped implements registration.Delegate.

func (*Node) RequestShutdown

func (n *Node) RequestShutdown() (<-chan struct{}, error)

RequestShutdown implements control.ControlledNode.

func (*Node) Stop

func (n *Node) Stop()

Stop gracefully terminates the node.

func (*Node) Wait

func (n *Node) Wait()

Wait waits for the node to gracefully terminate. Callers MUST call Cleanup() after wait returns.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL