node

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

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

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() *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

type PauseType

type PauseType int
const (
	NoPause PauseType = 0

	PauseTypeUpdatingBlockchain PauseType = 1 + iota
	PauseTypeStopingNetwork
)

func NodePauseType

func NodePauseType() PauseType

func (PauseType) String

func (p PauseType) String() string

Jump to

Keyboard shortcuts

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