Documentation ¶
Index ¶
- Variables
- func CreateDefaultConfigFile(filename string)
- func LoadConfig(file string) *nebletpb.Config
- type Neblet
- func (n *Neblet) AccountManager() core.AccountManager
- func (n *Neblet) BlockChain() *core.BlockChain
- func (n *Neblet) Config() *nebletpb.Config
- func (n *Neblet) Consensus() core.Consensus
- func (n *Neblet) Dip() core.Dip
- func (n *Neblet) EventEmitter() *core.EventEmitter
- func (n *Neblet) Genesis() *corepb.Genesis
- func (n *Neblet) IsActiveSyncing() bool
- func (n *Neblet) NetService() nebnet.Service
- func (n *Neblet) Nr() core.NR
- func (n *Neblet) Nvm() core.NVM
- func (n *Neblet) SetGenesis(g *corepb.Genesis)
- func (n *Neblet) Setup()
- func (n *Neblet) Start()
- func (n *Neblet) StartPprof(listen string) error
- func (n *Neblet) Stop()
- func (n *Neblet) Storage() storage.Storage
- func (n *Neblet) SyncService() *nsync.Service
- func (n *Neblet) TryStartProfiling()
- func (n *Neblet) TryStopProfiling()
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 (*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) 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
IsActiveSyncing return if the neb is syncing blocks
func (*Neblet) NetService ¶
NetService returns p2p manager reference.
func (*Neblet) SetGenesis ¶ added in v1.0.0
func (n *Neblet) SetGenesis(g *corepb.Genesis)
SetGenesis set genesis conf
func (*Neblet) StartPprof ¶ added in v1.0.0
StartPprof start pprof http listen
func (*Neblet) SyncService ¶ added in v1.0.0
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
Click to show internal directories.
Click to hide internal directories.