node

package
v0.2300.4 Latest Latest
Warning

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

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

Documentation

Overview

Package node implements the Oasis node.

Index

Constants

View Source
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

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(_ *cobra.Command, _ []string)

Run runs the Oasis node.

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

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) CancelUpgrade added in v0.2300.0

func (n *Node) CancelUpgrade(_ context.Context, descriptor *upgrade.Descriptor) error

CancelUpgrade implements control.NodeController.

func (*Node) Cleanup

func (n *Node) Cleanup()

Cleanup cleans up after the node has terminated.

func (*Node) GetStatus added in v0.2300.0

func (n *Node) GetStatus(ctx context.Context) (*control.Status, error)

GetStatus implements control.NodeController.

func (*Node) IsReady added in v0.2300.0

func (n *Node) IsReady(ctx context.Context) (bool, error)

IsReady implements control.NodeController.

func (*Node) IsSynced added in v0.2300.0

func (n *Node) IsSynced(ctx context.Context) (bool, error)

IsSynced implements control.NodeController.

func (*Node) RegistrationStopped

func (n *Node) RegistrationStopped()

RegistrationStopped implements registration.Delegate.

func (*Node) RequestShutdown

func (n *Node) RequestShutdown(ctx context.Context, wait bool) error

RequestShutdown implements control.NodeController.

func (*Node) SetEpoch added in v0.2300.0

func (n *Node) SetEpoch(ctx context.Context, epoch beacon.EpochTime) error

SetEpoch implements control.DebugController.

func (*Node) Stop

func (n *Node) Stop()

Stop gracefully terminates the node.

func (*Node) UpgradeBinary added in v0.2300.0

func (n *Node) UpgradeBinary(_ context.Context, descriptor *upgrade.Descriptor) error

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

func (n *Node) WaitNodesRegistered(ctx context.Context, count int) error

WaitNodesRegistered implements control.DebugController.

func (*Node) WaitReady added in v0.2300.0

func (n *Node) WaitReady(ctx context.Context) error

WaitReady implements control.NodeController.

func (*Node) WaitSync added in v0.2300.0

func (n *Node) WaitSync(ctx context.Context) error

WaitSync implements control.NodeController.

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

func NewSeedNode() (node *SeedNode, err error)

NewSeedNode initializes the seed node.

func (*SeedNode) CancelUpgrade added in v0.2300.0

func (n *SeedNode) CancelUpgrade(context.Context, *upgrade.Descriptor) error

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) GetStatus added in v0.2300.0

func (n *SeedNode) GetStatus(_ context.Context) (*control.Status, error)

GetStatus implements control.NodeController.

func (*SeedNode) IsReady added in v0.2300.0

func (n *SeedNode) IsReady(context.Context) (bool, error)

IsReady implements control.NodeController.

func (*SeedNode) IsSynced added in v0.2300.0

func (n *SeedNode) IsSynced(context.Context) (bool, error)

IsSynced implements control.NodeController.

func (*SeedNode) RequestShutdown added in v0.2300.0

func (n *SeedNode) RequestShutdown(context.Context, bool) error

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

func (n *SeedNode) UpgradeBinary(context.Context, *upgrade.Descriptor) error

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.

func (*SeedNode) WaitReady added in v0.2300.0

func (n *SeedNode) WaitReady(context.Context) error

WaitReady implements control.NodeController.

func (*SeedNode) WaitSync added in v0.2300.0

func (n *SeedNode) WaitSync(context.Context) error

WaitSync implements control.NodeController.

Jump to

Keyboard shortcuts

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