service

package
v0.0.0-...-8e17a21 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-2.0 Imports: 14 Imported by: 15

Documentation

Index

Constants

View Source
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(availableBlockchainGap int64, checkingInterval time.Duration) 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.FullNode) bool

IsBanned is allows to check node ban (local or global)

func (*NodesBanService) RegisterBadBlock

func (nbs *NodesBanService) RegisterBadBlock(node syspar.FullNode, badBlockId, blockTime int64, reason string) error

RegisterBadBlock is set node to local ban and saving bad block to global registry

type PauseType

type PauseType int
const (
	NoPause PauseType = 0

	PauseTypeUpdatingBlockchain PauseType = 1 + iota
	PauseTypeStopingNetwork
)

func NodePauseType

func NodePauseType() PauseType

Jump to

Keyboard shortcuts

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