p2p

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: AGPL-3.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPNode

type HTTPNode struct {
	mocks.MockNetwork
	host.Host
	// contains filtered or unexported fields
}

HTTPNode is a mock network node that uses libp2p and http.

func MakeHTTPNode

func MakeHTTPNode(tb testing.TB) *HTTPNode

MakeHTTPNode returns a new P2PHTTPNode node.

func (*HTTPNode) GetGenesisID

func (p *HTTPNode) GetGenesisID() string

GetGenesisID returns genesisID

func (*HTTPNode) GetHTTPPeer

func (p *HTTPNode) GetHTTPPeer() network.Peer

GetHTTPPeer returns the http peer for connecting to this node

func (*HTTPNode) GetPeers

func (p *HTTPNode) GetPeers(options ...network.PeerOption) []network.Peer

GetPeers returns peers

func (*HTTPNode) RegisterHTTPHandler

func (p *HTTPNode) RegisterHTTPHandler(path string, handler http.Handler)

RegisterHTTPHandler registers a http handler with a given path.

func (*HTTPNode) RegisterHandlers

func (p *HTTPNode) RegisterHandlers(dispatch []network.TaggedMessageHandler)

RegisterHandlers not implemented.

func (*HTTPNode) SetGenesisID

func (p *HTTPNode) SetGenesisID(genesisID string)

SetGenesisID sets genesisID

func (*HTTPNode) SetPeers

func (p *HTTPNode) SetPeers(other *HTTPNode)

SetPeers sets peers

func (*HTTPNode) Start

func (p *HTTPNode) Start() error

Start starts http service

func (*HTTPNode) Stop

func (p *HTTPNode) Stop()

Stop stops http service

Jump to

Keyboard shortcuts

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