node

package
v0.0.0-...-e54d674 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SFNodeBitcoinCash wire.ServiceFlag = 1 << 5
)

Variables

View Source
var (
	DefualtNodeBootstrapCount = 17

	DefaultNodeAddTimes = 4

	DefaultNodeTimeout = 5 * time.Second
)

Functions

This section is empty.

Types

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(config *NodeConfig) *Node

func (*Node) AddInvMsgTx

func (node *Node) AddInvMsgTx(txid string, msgTx *wire.MsgTx)

func (*Node) AddPeer

func (node *Node) AddPeer(conn net.Conn)

func (*Node) BroadcastTxInv

func (node *Node) BroadcastTxInv(txid string)

func (*Node) GetConnectedPeer

func (node *Node) GetConnectedPeer(addr string) *peer.Peer

func (*Node) GetConnectedPeers

func (node *Node) GetConnectedPeers() []*peer.Peer

func (*Node) GetInvMsgTx

func (node *Node) GetInvMsgTx(txid string) *wire.MsgTx

func (*Node) RemoveInvTx

func (node *Node) RemoveInvTx(txid string) error

func (*Node) Start

func (node *Node) Start()

func (*Node) Stop

func (node *Node) Stop()

type NodeConfig

type NodeConfig struct {
	IsTestnet bool
	// The target number of outbound peers. Defaults to 10.
	TargetOutbound uint32
	// UserAgentName specifies the user agent name to advertise. It is
	// highly recommended to specify this value.
	UserAgentName string
	// UserAgentVersion specifies the user agent version to advertise.  It
	// is highly recommended to specify this value and that it follows the
	// form "major.minor.revision" e.g. "2.6.41".
	UserAgentVersion string
	// Chan for Tx
	TxChan chan *types.Tx
	// Chan for Block
	BChan chan *types.Block
}

Jump to

Keyboard shortcuts

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