Documentation ¶
Overview ¶
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
Index ¶
- Constants
- func InitNodesBanService() error
- func IsNodePaused() bool
- func NodeDoneUpdatingBlockchain()
- func PauseNodeActivity(pt PauseType)
- type NodeActualizer
- type NodePaused
- type NodeRelevanceService
- type NodesBanService
- func (nbs *NodesBanService) FilterBannedHosts(hosts []string) (goodHosts []string, err error)
- func (nbs *NodesBanService) FilterHosts(hosts []string) ([]string, []string, error)
- func (nbs *NodesBanService) IsBanned(node syspar.HonorNode) bool
- func (nbs *NodesBanService) RegisterBadBlock(node syspar.HonorNode, badBlockId, blockTime int64, reason string, ...) error
- type PauseType
Constants ¶
const DefaultBlockchainGap int64 = 10
DefaultBlockchainGap is default value for the number of lagging blocks
Variables ¶
This section is empty.
Functions ¶
func InitNodesBanService ¶
func InitNodesBanService() error
InitNodesBanService initializing nodes ban storage
func IsNodePaused ¶
func IsNodePaused() bool
func NodeDoneUpdatingBlockchain ¶
func NodeDoneUpdatingBlockchain()
func PauseNodeActivity ¶
func PauseNodeActivity(pt PauseType)
Types ¶
type NodeActualizer ¶
type NodeActualizer struct {
// contains filtered or unexported fields
}
func NewNodeActualizer ¶
func NewNodeActualizer(availableBlockchainGap int64) NodeActualizer
func (*NodeActualizer) Run ¶
func (n *NodeActualizer) Run(ctx context.Context)
Run is starting node monitoring
type NodePaused ¶
type NodePaused struct { PauseType PauseType // contains filtered or unexported fields }
func (*NodePaused) Get ¶
func (np *NodePaused) Get() PauseType
func (*NodePaused) IsSet ¶
func (np *NodePaused) IsSet() bool
func (*NodePaused) Set ¶
func (np *NodePaused) Set(pt PauseType)
func (*NodePaused) Unset ¶
func (np *NodePaused) Unset()
type NodeRelevanceService ¶
type NodeRelevanceService struct {
// contains filtered or unexported fields
}
func NewNodeRelevanceService ¶
func NewNodeRelevanceService() *NodeRelevanceService
func (*NodeRelevanceService) Run ¶
func (n *NodeRelevanceService) Run(ctx context.Context)
Run is starting node monitoring
type NodesBanService ¶
type NodesBanService struct {
// contains filtered or unexported fields
}
func GetNodesBanService ¶
func GetNodesBanService() *NodesBanService
GetNodesBanService is returning nodes ban service
func (*NodesBanService) FilterBannedHosts ¶
func (nbs *NodesBanService) FilterBannedHosts(hosts []string) (goodHosts []string, err error)
func (*NodesBanService) FilterHosts ¶
func (nbs *NodesBanService) FilterHosts(hosts []string) ([]string, []string, error)
func (*NodesBanService) IsBanned ¶
func (nbs *NodesBanService) IsBanned(node syspar.HonorNode) bool
IsBanned is allows to check node ban (local or global)
func (*NodesBanService) RegisterBadBlock ¶
func (nbs *NodesBanService) RegisterBadBlock(node syspar.HonorNode, badBlockId, blockTime int64, reason string, register bool) error
RegisterBadBlock is set node to local ban and saving bad block to global registry