node

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KoinosP2PNode

type KoinosP2PNode struct {
	Host host.Host

	Applicator        *p2p.Applicator
	Gossip            *p2p.KoinosGossip
	ConnectionManager *p2p.ConnectionManager
	PeerErrorHandler  *p2p.PeerErrorHandler
	GossipToggle      *p2p.GossipToggle
	TransactionCache  *p2p.TransactionCache

	PeerErrorChan      chan p2p.PeerError
	DisconnectPeerChan chan peer.ID

	Options options.NodeOptions
	// contains filtered or unexported fields
}

KoinosP2PNode is the core object representing

func NewKoinosP2PNode

func NewKoinosP2PNode(ctx context.Context, listenAddr string, localRPC rpc.LocalRPC, requestHandler *koinosmq.RequestHandler, seed string, config *options.Config) (*KoinosP2PNode, error)

NewKoinosP2PNode creates a libp2p node object listening on the given multiaddress uses secio encryption on the wire listenAddr is a multiaddress string on which to listen seed is the random seed to use for key generation. Use 0 for a random seed.

func (*KoinosP2PNode) Close

func (n *KoinosP2PNode) Close() error

Close closes the node

func (*KoinosP2PNode) ConnectToPeerAddress

func (n *KoinosP2PNode) ConnectToPeerAddress(ctx context.Context, peer *peer.AddrInfo) error

ConnectToPeerAddress connects to the given peer address

func (*KoinosP2PNode) GetAddress added in v0.2.0

func (n *KoinosP2PNode) GetAddress() multiaddr.Multiaddr

GetAddress returns the peer multiaddress

func (*KoinosP2PNode) GetAddressInfo added in v0.2.0

func (n *KoinosP2PNode) GetAddressInfo() *peer.AddrInfo

GetAddressInfo returns the node's address info

func (*KoinosP2PNode) GetConnections

func (n *KoinosP2PNode) GetConnections() []network.Conn

GetConnections returns the host's current peer connections

func (*KoinosP2PNode) GetLastIrreversibleBlock added in v0.2.0

func (n *KoinosP2PNode) GetLastIrreversibleBlock() *koinos.BlockTopology

GetLastIrreversibleBlock returns last irreversible block height and block id of connected node

func (*KoinosP2PNode) PeerStringToAddress

func (n *KoinosP2PNode) PeerStringToAddress(peerAddr string) (*peer.AddrInfo, error)

PeerStringToAddress Creates a peer.AddrInfo object based on the given connection string

func (*KoinosP2PNode) Start

func (n *KoinosP2PNode) Start(ctx context.Context)

Start starts background goroutines

Jump to

Keyboard shortcuts

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