node

package
v0.0.0-...-71e40f4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCommitteeMember

type ApiCommitteeMember struct {
	Name        string        `json:"name"`
	Address     meter.Address `json:"addr"`
	PubKey      string        `json:"pubKey"`
	VotingPower int64         `json:"votingPower"`
	NetAddr     string        `json:"netAddr"`
	CsPubKey    string        `json:"csPubKey"`
	CsIndex     int           `json:"csIndex"`
	InCommittee bool          `json:"inCommittee"`
}

type Consensus

type Consensus interface {
	Committee() []*consensus.ApiCommitteeMember
}

type Network

type Network interface {
	PeersStats() []*comm.PeerStats
}

type Node

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

func New

func New(nw Network, pubKey string) *Node

func (*Node) Mount

func (n *Node) Mount(root *mux.Router, pathPrefix string)

func (*Node) PeersStats

func (n *Node) PeersStats() []*PeerStats

type PeerStats

type PeerStats struct {
	Name        string        `json:"name"`
	BestBlockID meter.Bytes32 `json:"bestBlockID"`
	TotalScore  uint64        `json:"totalScore"`
	PeerID      string        `json:"peerID"`
	NetAddr     string        `json:"netAddr"`
	Inbound     bool          `json:"inbound"`
	Duration    uint64        `json:"duration"`
}

func ConvertPeersStats

func ConvertPeersStats(ss []*comm.PeerStats) []*PeerStats

Jump to

Keyboard shortcuts

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