core

package
v0.0.0-...-2935fa7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CooldownTime           = 1000 * time.Millisecond
	ServerShutdownTimeout  = 5000 * time.Millisecond
	LoggingCallerDepth     = 5
	AccountsRingMutexCount = 100
	HiveSmartChainDBName   = "hsc_state"
)
View Source
const (
	ProfilingProcessName   = "Profiling"
	DatabaseProcessName    = "Database"
	NoConsensusProcessName = "NoConsensusExecution"
	TendermintProcessName  = "Tendermint"
	StartupProcessName     = "StartupAnnouncer"
	Web3ProcessName        = "rpcConfig/web3"
	InfoProcessName        = "rpcConfig/info"
	GRPCProcessName        = "rpcConfig/GRPC"
	MetricsProcessName     = "rpcConfig/metrics"
	BridgeHIVEProcessName  = "Bridges"
)

Variables

This section is empty.

Functions

func Bridges

func Bridges(kern *Kernel) process.Launcher

func DatabaseLauncher

func DatabaseLauncher(kern *Kernel) process.Launcher

func DefaultProcessLaunchers

func DefaultProcessLaunchers(kern *Kernel, rpcConfig *rpc.RPCConfig, keysConfig *keys.KeysConfig) []process.Launcher

func GRPCLauncher

func GRPCLauncher(kern *Kernel, conf *rpc.ServerConfig, keyConfig *keys.KeysConfig) process.Launcher

func InfoLauncher

func InfoLauncher(kern *Kernel, conf *rpc.ServerConfig) process.Launcher

func MetricsLauncher

func MetricsLauncher(kern *Kernel, conf *rpc.MetricsConfig) process.Launcher

func NoConsensusLauncher

func NoConsensusLauncher(kern *Kernel) process.Launcher

Run a single uncoordinated local state

func ProfileLauncher

func ProfileLauncher(kern *Kernel, conf *rpc.ServerConfig) process.Launcher

func StartupLauncher

func StartupLauncher(kern *Kernel) process.Launcher

func TendermintLauncher

func TendermintLauncher(kern *Kernel) process.Launcher

func Web3Launcher

func Web3Launcher(kern *Kernel, conf *rpc.ServerConfig) process.Launcher

Types

type Kernel

type Kernel struct {
	// Expose these public-facing interfaces to allow programmatic extension of the Kernel by other projects
	Emitter    *event.Emitter
	Service    *rpc.Service
	EthService *web3.EthService
	Launchers  []process.Launcher
	State      *state.State
	Blockchain *bcm.Blockchain
	Node       *tendermint.Node
	Transactor *execution.Transactor
	RunID      simpleuuid.UUID // Time-based UUID randomly generated each time HiveSmartChain is started
	Logger     *logging.Logger

	Hive *bridges.HiveBridge
	// contains filtered or unexported fields
}

Kernel is the root structure of HiveSmartChain

func LoadKernelFromConfig

func LoadKernelFromConfig(conf *config.BurrowConfig) (*Kernel, error)

LoadKernelFromConfig builds and returns a Kernel based solely on the supplied configuration

func NewKernel

func NewKernel(dbDir string) (*Kernel, error)

NewKernel initializes an empty kernel

func (*Kernel) AddExecutionOptions

func (kern *Kernel) AddExecutionOptions(opts ...execution.Option)

AddExecutionOptions extends our execution options

func (*Kernel) AddProcesses

func (kern *Kernel) AddProcesses(pl ...process.Launcher)

AddProcesses extends the services that we launch at boot

func (*Kernel) Boot

func (kern *Kernel) Boot() (err error)

Boot the kernel starting Tendermint and RPC layers

func (*Kernel) GRPCListenAddress

func (kern *Kernel) GRPCListenAddress() net.Addr

func (*Kernel) GetNodeView

func (kern *Kernel) GetNodeView() (*tendermint.NodeView, error)

GetNodeView builds and returns a wrapper of our tendermint node

func (*Kernel) InfoListenAddress

func (kern *Kernel) InfoListenAddress() net.Addr

func (*Kernel) LoadDump

func (kern *Kernel) LoadDump(genesisDoc *genesis.GenesisDoc, restoreFile string, silent bool) (err error)

LoadDump restores chain state from the given dump file

func (*Kernel) LoadExecutionOptionsFromConfig

func (kern *Kernel) LoadExecutionOptionsFromConfig(conf *execution.ExecutionConfig) error

LoadExecutionOptionsFromConfig builds the execution options for the kernel

func (*Kernel) LoadKeysFromConfig

func (kern *Kernel) LoadKeysFromConfig(conf *keys.KeysConfig) (err error)

LoadKeysFromConfig sets the keyClient & keyStore based on the given config

func (*Kernel) LoadLoggerFromConfig

func (kern *Kernel) LoadLoggerFromConfig(conf *logconfig.LoggingConfig) error

LoadLoggerFromConfig adds a logging configuration to the kernel

func (*Kernel) LoadState

func (kern *Kernel) LoadState(genesisDoc *genesis.GenesisDoc) (err error)

LoadState starts from scratch or previous chain

func (*Kernel) LoadTendermintFromConfig

func (kern *Kernel) LoadTendermintFromConfig(conf *config.BurrowConfig, privVal tmTypes.PrivValidator) (err error)

LoadTendermintFromConfig loads our consensus engine into the kernel

func (*Kernel) MetricsListenAddress

func (kern *Kernel) MetricsListenAddress() net.Addr

func (*Kernel) Panic

func (kern *Kernel) Panic(err error)

func (*Kernel) PrivValidator

func (kern *Kernel) PrivValidator(validator crypto.Address) (tmTypes.PrivValidator, error)

Generates an in-memory Tendermint PrivValidator (suitable for passing to LoadTendermintFromConfig)

func (*Kernel) SetKeyClient

func (kern *Kernel) SetKeyClient(client keys.KeyClient)

SetKeyClient explicitly sets the key client

func (*Kernel) SetKeyStore

func (kern *Kernel) SetKeyStore(store *keys.FilesystemKeyStore)

SetKeyStore explicitly sets the key store

func (*Kernel) SetLogger

func (kern *Kernel) SetLogger(logger *logging.Logger)

SetLogger initializes the kernel with the provided logger

func (*Kernel) Shutdown

func (kern *Kernel) Shutdown(ctx context.Context) (err error)

Shutdown stops the kernel allowing for a graceful shutdown of components in order

func (*Kernel) ShutdownAndExit

func (kern *Kernel) ShutdownAndExit()

func (*Kernel) String

func (kern *Kernel) String() string

func (*Kernel) WaitForShutdown

func (kern *Kernel) WaitForShutdown()

Wait for a graceful shutdown

Jump to

Keyboard shortcuts

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