types

package
v0.0.0-...-9faecf3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Solo = iota
	Pbft
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IConsensusEngine

type IConsensusEngine interface {
	Run(key *secp256k1.PrivateKey) (*types.Block, error)
	ReceiveMsg(peer *PeerInfo, t uint64, buf []byte)
}

type IPeerInfo

type IPeerInfo interface {
	GetMsgRW() p2p.MsgReadWriter
	//String() string
	IP() string
	Equal(ipeer IPeerInfo) bool
	ID() string
}

type PeerInfo

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

业务层peer

func NewPeerInfo

func NewPeerInfo(peer *p2p.Peer, rw p2p.MsgReadWriter) *PeerInfo

func (*PeerInfo) Equal

func (pi *PeerInfo) Equal(pi2 IPeerInfo) bool

func (*PeerInfo) GetMsgRW

func (pi *PeerInfo) GetMsgRW() p2p.MsgReadWriter

获取读写句柄

func (*PeerInfo) ID

func (pi *PeerInfo) ID() string

func (*PeerInfo) IP

func (pi *PeerInfo) IP() string

Jump to

Keyboard shortcuts

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