p2p

package
v0.0.0-...-7e562c3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

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