context

package
v1.4.2-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LedgerService       = "ledgerService"
	WalletService       = "walletService"
	BootNodeHttpService = "bootNodeHttpService"
	P2PService          = "P2PService"
	ConsensusService    = "consensusService"
	RPCService          = "rpcService"
	PovService          = "povService"
	MinerService        = "minerService"
	AutoReceiveService  = "autoReceiveService"
	MetricsService      = "metricsService"
	ChainManageService  = "chainManageService"
	LogService          = "logService"
	ResendBlockService  = "resendBlockService"
	PrivacyService      = "privacyService"
	PermissionService   = "permissionService"
)

Variables

View Source
var ErrPoVNotFinish = errors.New("pov sync is not finished, please check it")

Functions

This section is empty.

Types

type ChainContext

type ChainContext struct {
	common.ServiceLifecycle
	// contains filtered or unexported fields
}

func NewChainContext

func NewChainContext(cfgFile string) *ChainContext

func NewChainContextFromOriginal

func NewChainContextFromOriginal(cc *ChainContext) *ChainContext

func (*ChainContext) Accounts

func (cc *ChainContext) Accounts() []*types.Account

func (*ChainContext) AllServices

func (cc *ChainContext) AllServices() ([]common.Service, error)

func (*ChainContext) Config

func (cc *ChainContext) Config() (*config.Config, error)

func (*ChainContext) ConfigFile

func (cc *ChainContext) ConfigFile() string

func (*ChainContext) ConfigManager

func (cc *ChainContext) ConfigManager(opts ...Option) (*config.CfgManager, error)

func (*ChainContext) Destroy

func (cc *ChainContext) Destroy() error

func (*ChainContext) EventBus

func (cc *ChainContext) EventBus() event.EventBus

func (*ChainContext) FeedEventBus added in v1.4.0

func (cc *ChainContext) FeedEventBus() *event.FeedEventBus

func (*ChainContext) GetBandwidthStats added in v1.4.0

func (cc *ChainContext) GetBandwidthStats() *topic.EventBandwidthStats

func (*ChainContext) GetConnectPeersInfo added in v1.4.0

func (cc *ChainContext) GetConnectPeersInfo() []*types.PeerInfo

func (*ChainContext) GetOnlinePeersInfo added in v1.4.0

func (cc *ChainContext) GetOnlinePeersInfo() []*types.PeerInfo

func (*ChainContext) GetPeersPool added in v1.4.0

func (cc *ChainContext) GetPeersPool() map[string]string

func (*ChainContext) HasService

func (cc *ChainContext) HasService(name string) bool

func (*ChainContext) Id

func (cc *ChainContext) Id() string

func (*ChainContext) Init

func (cc *ChainContext) Init(fn func() error) error

func (*ChainContext) IsPoVDone added in v1.4.0

func (cc *ChainContext) IsPoVDone() bool

func (*ChainContext) P2PSyncState added in v1.4.0

func (cc *ChainContext) P2PSyncState() topic.SyncState

func (*ChainContext) PoVState added in v1.4.0

func (cc *ChainContext) PoVState() topic.SyncState

func (*ChainContext) Register

func (cc *ChainContext) Register(name string, service common.Service) error

func (*ChainContext) ReloadService

func (cc *ChainContext) ReloadService(name string) error

func (*ChainContext) RestartAll

func (*ChainContext) RestartAll() error

func (*ChainContext) Service

func (cc *ChainContext) Service(name string) (common.Service, error)

func (*ChainContext) SetAccounts

func (cc *ChainContext) SetAccounts(accounts []*types.Account)

func (*ChainContext) Start

func (cc *ChainContext) Start() error

func (*ChainContext) Status

func (cc *ChainContext) Status() int32

func (*ChainContext) Stop

func (cc *ChainContext) Stop() error

func (*ChainContext) UnRegister

func (cc *ChainContext) UnRegister(name string) error

func (*ChainContext) WaitForever

func (cc *ChainContext) WaitForever()

type Option

type Option func(cm *config.CfgManager) error

Jump to

Keyboard shortcuts

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