peer

package
v0.0.0-...-0160b4d Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {

	// OnMessage is triggered when the peer receives a message
	OnMessage func(*xdr.StellarMessage)

	// PeerInfo contains information about the connected peer
	PeerInfo *xdr.Hello
	Address  string
	// contains filtered or unexported fields
}

Peer represents a connection to a peer

func Connect

func Connect(nodeInfo *nodeInfo.NodeInfo, address string) (*Peer, error)

Connect returns a peer that manages a connection to a stellar-core node

func (*Peer) AnnounceTransaction

func (peer *Peer) AnnounceTransaction(tx xdr.TransactionEnvelope)

AnnounceTransaction informs peer of a transaction

func (*Peer) GetPeerAddresses

func (peer *Peer) GetPeerAddresses()

GetPeerAddresses gets a list of peers

func (*Peer) GetScpQuorumset

func (peer *Peer) GetScpQuorumset(hash xdr.Hash)

GetScpQuorumset gets scp quorum set

func (*Peer) GetScpState

func (peer *Peer) GetScpState()

GetScpState gets the scp state

func (*Peer) GetTxSet

func (peer *Peer) GetTxSet(hash xdr.Hash)

GetTxSet gets the transaction set

func (*Peer) MustRespond

func (peer *Peer) MustRespond()

MustRespond indicates to the connection that it should expect a response soon or throw an error.

func (*Peer) Start

func (peer *Peer) Start()

Start logs the peer in to the node and starts processing messages

Jump to

Keyboard shortcuts

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