node

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 94 Imported by: 1

Documentation

Overview

Package node contains the main executable for go-spacemesh node

Index

Constants

View Source
const (
	ClockLogger            = "clock"
	P2PLogger              = "p2p"
	PostLogger             = "post"
	PostServiceLogger      = "postService"
	PostInfoServiceLogger  = "postInfoService"
	StateDbLogger          = "stateDb"
	ApiStateDBLogger       = "apiStateDB"
	BeaconLogger           = "beacon"
	CachedDBLogger         = "cachedDB"
	PoetDbLogger           = "poetDb"
	TrtlLogger             = "trtl"
	ATXHandlerLogger       = "atxHandler"
	ATXBuilderLogger       = "atxBuilder"
	MeshLogger             = "mesh"
	SyncLogger             = "sync"
	HareOracleLogger       = "hareOracle"
	HareLogger             = "hare"
	BlockCertLogger        = "blockCert"
	BlockGenLogger         = "blockGenerator"
	BlockHandlerLogger     = "blockHandler"
	TxHandlerLogger        = "txHandler"
	ProposalStoreLogger    = "proposalStore"
	ProposalBuilderLogger  = "proposalBuilder"
	ProposalListenerLogger = "proposalListener"
	NipostBuilderLogger    = "nipostBuilder"
	NipostValidatorLogger  = "nipostValidator"
	Fetcher                = "fetcher"
	TimeSyncLogger         = "timesync"
	VMLogger               = "vm"
	GRPCLogger             = "grpc"
	ConStateLogger         = "conState"
	ExecutorLogger         = "executor"
	MalfeasanceLogger      = "malfeasance"
	BootstrapLogger        = "bootstrap"
)

Logger names.

Variables

This section is empty.

Functions

func GetCommand

func GetCommand() *cobra.Command

func LoadConfig added in v1.7.7

func LoadConfig(cfg *config.Config, preset string, src io.Reader) error

LoadConfig loads config and preset (if provided) into the provided config. It first loads the preset and then overrides it with values from the config file.

func WithErrorUnused added in v1.5.0

func WithErrorUnused() viper.DecoderConfigOption

func WithIgnoreUntagged added in v1.4.0

func WithIgnoreUntagged() viper.DecoderConfigOption

func WithZeroFields added in v1.4.0

func WithZeroFields() viper.DecoderConfigOption

Types

type App

type App struct {
	*cobra.Command

	Config *config.Config
	// contains filtered or unexported fields
}

App is the cli app singleton.

func New

func New(opts ...Option) *App

New creates an instance of the spacemesh app.

func NewApp added in v1.3.0

func NewApp(tb testing.TB, conf *config.Config, l log.Log) *App

func (*App) Cleanup

func (app *App) Cleanup(ctx context.Context)

Cleanup stops all app services.

func (*App) Host

func (app *App) Host() *p2p.Host

func (*App) Initialize

func (app *App) Initialize() error

Initialize parses and validates the node configuration and sets up logging.

func (*App) LoadIdentities added in v1.4.0

func (app *App) LoadIdentities() error

LoadIdentities loads all existing identities from the config directory.

func (*App) Lock

func (app *App) Lock() error

Lock locks the app for exclusive use. It returns an error if the app is already locked.

func (*App) NewIdentity added in v1.4.0

func (app *App) NewIdentity() error

NewIdentity creates a new identity, saves it to `keyDir/supervisedIDKeyFileName` in the config directory and initializes app.signers with that identity.

func (*App) SetLogLevel

func (app *App) SetLogLevel(name, loglevel string) error

SetLogLevel updates the log level of an existing logger.

func (*App) Start

func (app *App) Start(ctx context.Context) error

Start starts the Spacemesh node and initializes all relevant services according to command line arguments provided.

func (*App) Started

func (app *App) Started() <-chan struct{}

func (*App) Unlock

func (app *App) Unlock()

Unlock unlocks the app. It is a no-op if the app is not locked.

type Option

type Option func(app *App)

Option to modify an App instance.

func WithConfig

func WithConfig(conf *config.Config) Option

WithConfig overwrites default App config.

func WithLog

func WithLog(logger log.Log) Option

WithLog enables logger for an App.

type TestApp added in v1.3.0

type TestApp struct {
	*App
	Conn *grpc.ClientConn
}

func NewTestNetwork added in v1.3.0

func NewTestNetwork(tb testing.TB, conf config.Config, l log.Log, size int) []*TestApp

NewTestNetwork creates a network of fully connected nodes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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