dpos

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DumpPeersInfoInterval = 10 * time.Minute

Variables

This section is empty.

Functions

func NewDposNetwork

func NewDposNetwork(cfg NetworkConfig) (*network, error)

Types

type Arbitrator

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

func NewArbitrator

func NewArbitrator(account account.Account, cfg Config) (*Arbitrator, error)

func (*Arbitrator) GetArbiterPeersInfo added in v0.3.0

func (a *Arbitrator) GetArbiterPeersInfo() []*dp2p.PeerInfo

func (*Arbitrator) GetCurrentArbitrators added in v0.7.0

func (a *Arbitrator) GetCurrentArbitrators() []*state.ArbiterInfo

func (*Arbitrator) GetCurrentCRCs added in v0.7.0

func (a *Arbitrator) GetCurrentCRCs() []*state.ArbiterInfo

func (*Arbitrator) GetNextArbitrators added in v0.7.0

func (a *Arbitrator) GetNextArbitrators() []*state.ArbiterInfo

func (*Arbitrator) GetNextCRCs added in v0.7.0

func (a *Arbitrator) GetNextCRCs() [][]byte

func (*Arbitrator) OnBlockReceived added in v0.3.0

func (a *Arbitrator) OnBlockReceived(b *types.Block, confirmed bool)

func (*Arbitrator) OnCipherAddr added in v0.3.2

func (a *Arbitrator) OnCipherAddr(pid peer.PID, cipher []byte)

OnCipherAddr will be invoked when an address cipher received.

func (*Arbitrator) OnConfirmReceived added in v0.3.0

func (a *Arbitrator) OnConfirmReceived(p *mempool.ConfirmInfo)

func (*Arbitrator) OnIllegalBlockTxReceived added in v0.3.0

func (a *Arbitrator) OnIllegalBlockTxReceived(p *payload.DPOSIllegalBlocks)

func (*Arbitrator) OnInactiveArbitratorsTxReceived added in v0.3.0

func (a *Arbitrator) OnInactiveArbitratorsTxReceived(
	p *payload.InactiveArbitrators)

func (*Arbitrator) OnPeersChanged added in v0.3.0

func (a *Arbitrator) OnPeersChanged(peers []peer.PID)

func (*Arbitrator) OnSidechainIllegalEvidenceReceived added in v0.3.0

func (a *Arbitrator) OnSidechainIllegalEvidenceReceived(
	data *payload.SidechainIllegalData)

func (*Arbitrator) Start

func (a *Arbitrator) Start()

func (*Arbitrator) Stop

func (a *Arbitrator) Stop() error

type Config added in v0.3.0

type Config struct {
	EnableEventLog bool
	Chain          *blockchain.BlockChain
	Arbitrators    state.Arbitrators
	Server         elanet.Server
	TxMemPool      *mempool.TxPool
	BlockMemPool   *mempool.BlockPool
	ChainParams    *config.Params
	Broadcast      func(msg p2p.Message)
	AnnounceAddr   func()
}

type NetworkConfig added in v0.5.0

type NetworkConfig struct {
	ChainParams *config.Params
	Account     account.Account
	MedianTime  dtime.MedianTimeSource
	Listener    manager.NetworkEventListener
}

type PeerInfo added in v0.7.0

type PeerInfo struct {
	OwnerPublicKey string `json:"ownerpublickey"`
	NodePublicKey  string `json:"nodepublickey"`
	IP             string `json:"ip"`
	ConnState      string `json:"connstate"`
}

func (*PeerInfo) String added in v0.7.0

func (p *PeerInfo) String() string

Directories

Path Synopsis
p2p
hub
Conn is a wrapper of the origin network connection.
Conn is a wrapper of the origin network connection.
msg

Jump to

Keyboard shortcuts

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