network

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddNewCorePeer = "addNewCorePeer"
	GetNewTx       = "getNewTx"
)
View Source
const (
	DurShort = 3 * time.Second
	DurLong  = 10 * time.Second
)
View Source
const (
	ForceSyncInterval = 10 * time.Second
	ReconnectInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

func GetConnectResult

func GetConnectResult() bool

func SetConnectResult

func SetConnectResult(success bool)

Types

type DialManager

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

func NewDialManager

func NewDialManager(coreNodeID *p2p.NodeID, coreNodeEndpoint string) *DialManager

func (*DialManager) Dial

func (dm *DialManager) Dial()

Dial run dial

type LatestStatus

type LatestStatus struct {
	CurHeight uint32
	CurHash   common.Hash

	StaHeight uint32
	StaHash   common.Hash
}

LatestStatus latest peer's status

type ProtocolHandshake

type ProtocolHandshake struct {
	ChainID      uint16
	GenesisHash  common.Hash
	NodeVersion  uint32
	LatestStatus LatestStatus
}

ProtocolHandshake protocol handshake

func (*ProtocolHandshake) Bytes

func (phs *ProtocolHandshake) Bytes() []byte

Bytes object to bytes

type ProtocolManager

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

func NewProtocolManager

func NewProtocolManager(chainID uint16, coreNodeID *p2p.NodeID, coreNodeEndpoint string, chain coreNetwork.BlockChain) *ProtocolManager

func (*ProtocolManager) Start

func (pm *ProtocolManager) Start()

Start

func (*ProtocolManager) Stop

func (pm *ProtocolManager) Stop()

Stop

Jump to

Keyboard shortcuts

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