Documentation ¶
Index ¶
- Constants
- Variables
- type ChainContext
- func (cc *ChainContext) Accounts() []*types.Account
- func (cc *ChainContext) AllServices() ([]common.Service, error)
- func (cc *ChainContext) Config() (*config.Config, error)
- func (cc *ChainContext) ConfigFile() string
- func (cc *ChainContext) ConfigManager(opts ...Option) (*config.CfgManager, error)
- func (cc *ChainContext) Destroy() error
- func (cc *ChainContext) EventBus() event.EventBus
- func (cc *ChainContext) FeedEventBus() *event.FeedEventBus
- func (cc *ChainContext) GetBandwidthStats() *topic.EventBandwidthStats
- func (cc *ChainContext) GetConnectPeersInfo() []*types.PeerInfo
- func (cc *ChainContext) GetOnlinePeersInfo() []*types.PeerInfo
- func (cc *ChainContext) GetPeersPool() map[string]string
- func (cc *ChainContext) HasService(name string) bool
- func (cc *ChainContext) Id() string
- func (cc *ChainContext) Init(fn func() error) error
- func (cc *ChainContext) IsPoVDone() bool
- func (cc *ChainContext) P2PSyncState() topic.SyncState
- func (cc *ChainContext) PoVState() topic.SyncState
- func (cc *ChainContext) Register(name string, service common.Service) error
- func (cc *ChainContext) ReloadService(name string) error
- func (*ChainContext) RestartAll() error
- func (cc *ChainContext) Service(name string) (common.Service, error)
- func (cc *ChainContext) SetAccounts(accounts []*types.Account)
- func (cc *ChainContext) Start() error
- func (cc *ChainContext) Status() int32
- func (cc *ChainContext) Stop() error
- func (cc *ChainContext) UnRegister(name string) error
- func (cc *ChainContext) WaitForever()
- type Option
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) 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) 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
Click to show internal directories.
Click to hide internal directories.