neblet

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: LGPL-3.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNebletAlreadyRunning throws when the neblet is already running.
	ErrNebletAlreadyRunning = errors.New("neblet is already running")

	// ErrIncompatibleStorageSchemeVersion throws when the storage schema has been changed
	ErrIncompatibleStorageSchemeVersion = errors.New("incompatible storage schema version, pls migrate your storage")
)
View Source
var (
	ErrConfigShouldHasChain = errors.New("config not has chain")
)

all error should in only file

Functions

func CreateDefaultConfigFile added in v1.0.0

func CreateDefaultConfigFile(filename string)

CreateDefaultConfigFile create a default config file.

func LoadConfig

func LoadConfig(file string) *nebletpb.Config

LoadConfig loads configuration from the file.

Types

type Neblet

type Neblet struct {
	// contains filtered or unexported fields
}

Neblet manages life cycle of blockchain services.

func New

func New(config *nebletpb.Config) (*Neblet, error)

New returns a new neblet.

func (*Neblet) AccountManager

func (n *Neblet) AccountManager() core.AccountManager

AccountManager returns account manager reference.

func (*Neblet) BlockChain

func (n *Neblet) BlockChain() *core.BlockChain

BlockChain returns block chain reference.

func (*Neblet) Config

func (n *Neblet) Config() *nebletpb.Config

Config returns neblet configuration.

func (*Neblet) Consensus added in v1.0.0

func (n *Neblet) Consensus() core.Consensus

Consensus returns consensus reference.

func (*Neblet) Dip

func (n *Neblet) Dip() core.Dip

Dip return the dip

func (*Neblet) EventEmitter added in v1.0.0

func (n *Neblet) EventEmitter() *core.EventEmitter

EventEmitter returns eventEmitter reference.

func (*Neblet) Genesis added in v1.0.0

func (n *Neblet) Genesis() *corepb.Genesis

Genesis returns genesis conf.

func (*Neblet) IsActiveSyncing added in v1.0.0

func (n *Neblet) IsActiveSyncing() bool

IsActiveSyncing return if the neb is syncing blocks

func (*Neblet) NetService

func (n *Neblet) NetService() nebnet.Service

NetService returns p2p manager reference.

func (*Neblet) Nr

func (n *Neblet) Nr() core.NR

NR return the nr

func (*Neblet) Nvm added in v1.0.0

func (n *Neblet) Nvm() core.NVM

Nvm return nvm engine

func (*Neblet) SetGenesis added in v1.0.0

func (n *Neblet) SetGenesis(g *corepb.Genesis)

SetGenesis set genesis conf

func (*Neblet) Setup added in v1.0.0

func (n *Neblet) Setup()

Setup setup neblet

func (*Neblet) Start

func (n *Neblet) Start()

Start starts the services of the neblet.

func (*Neblet) StartPprof added in v1.0.0

func (n *Neblet) StartPprof(listen string) error

StartPprof start pprof http listen

func (*Neblet) Stop

func (n *Neblet) Stop()

Stop stops the services of the neblet.

func (*Neblet) Storage added in v1.0.0

func (n *Neblet) Storage() storage.Storage

Storage returns storage reference.

func (*Neblet) SyncService added in v1.0.0

func (n *Neblet) SyncService() *nsync.Service

SyncService return sync service

func (*Neblet) TryStartProfiling added in v1.0.0

func (n *Neblet) TryStartProfiling()

TryStartProfiling try start pprof

func (*Neblet) TryStopProfiling added in v1.0.0

func (n *Neblet) TryStopProfiling()

TryStopProfiling try stop pprof

Directories

Path Synopsis
Package nebletpb is a generated protocol buffer package.
Package nebletpb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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