node

package
v0.2102.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 66 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
	RuntimeClient   runtimeClientAPI.RuntimeClientService

	CommonWorker       *workerCommon.Worker
	ExecutorWorker     *executor.Worker
	StorageWorker      *workerStorage.Worker
	SentryWorker       *workerSentry.Worker
	P2P                *p2p.P2P
	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, 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.

func NewTestNode

func NewTestNode() (*Node, error)

NewTestNode initializes and launches the (test) Oasis node service.

The test node uses a test genesis block and should only be used in unit tests.

func (*Node) Cleanup

func (n *Node) Cleanup()

Cleanup cleans up after the node has terminated.

func (*Node) GetIdentity

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

Implements control.ControlledNode.

func (*Node) GetPendingUpgrades added in v0.2100.0

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

Implements control.ControlledNode.

func (*Node) GetRegistrationStatus

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

Implements control.ControlledNode.

func (*Node) GetRuntimeStatus added in v0.2010.0

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

Implements control.ControlledNode.

func (*Node) Ready

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

Implements control.ControlledNode.

func (*Node) RegistrationStopped

func (n *Node) RegistrationStopped()

Implements registration.Delegate.

func (*Node) RequestShutdown

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

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