protocol

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

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 {
	GetBootPeers() []peer.AddrInfo
	// 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
	GetHeader(hash common.Hash, location common.Location) *types.WorkObject
	GetBlockHashByNumber(number *big.Int, location common.Location) *common.Hash
	GetTrieNode(hash common.Hash, location common.Location) *trie.TrieNodeResponse
	GetRequestManager() requestManager.RequestManager

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

interface required to join the quai protocol network

Directories

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

Jump to

Keyboard shortcuts

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