server

package
v0.0.0-...-0167ef5 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HpbNodeCheckpointInterval = 200
)

Variables

View Source
var DefaultConfig = &Config{}

Functions

This section is empty.

Types

type CheckPointHeap

type CheckPointHeap []uint64

func (CheckPointHeap) Len

func (h CheckPointHeap) Len() int

func (CheckPointHeap) Less

func (h CheckPointHeap) Less(i, j int) bool

func (*CheckPointHeap) Pop

func (h *CheckPointHeap) Pop() interface{}

func (*CheckPointHeap) Push

func (h *CheckPointHeap) Push(x interface{})

func (CheckPointHeap) Swap

func (h CheckPointHeap) Swap(i, j int)

type Config

type Config struct {
	NodeEndpoint string
	ScanEndpoint string
	HttpURL      string
	HttpPort     string
	StartBlock   int64
	EndBlock     int64
}

func (*Config) Valid

func (c *Config) Valid() error

type LostBlockInfo

type LostBlockInfo struct {
	// contains filtered or unexported fields
}

type LostBlockInfos

type LostBlockInfos []*LostBlockInfo

type MinerState

type MinerState struct {
	ConsensusStats States
	Round          uint64
}

type MinerStates

type MinerStates []MinerState

func (MinerStates) Len

func (h MinerStates) Len() int

func (MinerStates) Less

func (h MinerStates) Less(i, j int) bool

func (MinerStates) Swap

func (h MinerStates) Swap(i, j int)

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewMonitor

func NewMonitor(c *Config, sigKillChan chan os.Signal) *Monitor

func (*Monitor) CalculateMiner

func (m *Monitor) CalculateMiner(Signers []common.Address, parentBlockMiner common.Address, hardwareRandom []byte) *common.Address

func (*Monitor) HttpServer

func (m *Monitor) HttpServer()

func (*Monitor) LatestCheckPointNumber

func (m *Monitor) LatestCheckPointNumber(number int64) uint64

func (*Monitor) Loop

func (m *Monitor) Loop(c *cli.Context) error

func (*Monitor) PrintMinerState

func (m *Monitor) PrintMinerState(w http.ResponseWriter, r *http.Request)

func (*Monitor) ShutDown

func (m *Monitor) ShutDown()

func (*Monitor) Start

func (m *Monitor) Start(c *cli.Context) error

type SortMap

type SortMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*SortMap) Get

func (m *SortMap) Get(point uint64) map[common.Address]rpc.Node

func (*SortMap) GetByAddr

func (m *SortMap) GetByAddr(point uint64, addr common.Address) rpc.Node

func (*SortMap) Put

func (m *SortMap) Put(point uint64, nodes map[common.Address]rpc.Node)

type State

type State struct {
	Node           rpc.Node
	LostBlockCount uint64
}

type States

type States []State

func (States) Len

func (h States) Len() int

func (States) Less

func (h States) Less(i, j int) bool

func (States) Swap

func (h States) Swap(i, j int)

Jump to

Keyboard shortcuts

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