protocol

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_NumPrimeBlocksToDownload = 10
)
View Source
const (
	// ProtocolVersion is the current version of the Quai protocol
	ProtocolVersion protocol.ID = "/quai/1.0.0"
)

Variables

This section is empty.

Functions

func QuaiProtocolHandler

func QuaiProtocolHandler(stream network.Stream, node QuaiP2PNode)

QuaiProtocolHandler handles all the incoming requests and responds with corresponding data

Types

type QuaiP2PNode

type QuaiP2PNode interface {
	// Search for a block in the node's cache, or query the consensus backend if it's not found in cache.
	// Returns nil if the block is not found.
	GetWorkObject(hash common.Hash, location common.Location) *types.WorkObject
	GetWorkObjectsFrom(hash common.Hash, location common.Location, count int) []*types.WorkObjectBlockView
	GetBlockHashByNumber(number *big.Int, location common.Location) *common.Hash
	GetRequestManager() requestManager.RequestManager
	GetBandwidthCounter() libp2pmetrics.Reporter

	Connect(peer.AddrInfo) error
	GetStream(peer.ID) (network.Stream, error)
}

interface required to join the quai protocol network

Directories

Path Synopsis
Package mock_protocol is a generated GoMock package.
Package mock_protocol is a generated GoMock package.

Jump to

Keyboard shortcuts

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