rawpeer

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package rawpeer provides low level access to a bitcoin p2p node. It provides connect/handshake/disconnect and read/write commands.

Most implementations should not use this package directly.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHandshakeNotComplete = errors.New("handshake not complete")
)

Functions

This section is empty.

Types

type RawPeer

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

func New

func New(network wire.BitcoinNet, id int, address string) (*RawPeer, error)

func NewFromConn

func NewFromConn(conn net.Conn, network wire.BitcoinNet, protocolVersion uint32, id int) (*RawPeer, error)

func (*RawPeer) Close

func (r *RawPeer) Close() error

func (*RawPeer) Connect

func (r *RawPeer) Connect(ctx context.Context) error

func (*RawPeer) HasService

func (r *RawPeer) HasService(f wire.ServiceFlag) bool

func (*RawPeer) Id

func (r *RawPeer) Id() int

func (*RawPeer) IsConnected

func (r *RawPeer) IsConnected() bool

func (*RawPeer) Read

func (r *RawPeer) Read(timeout time.Duration) (wire.Message, []byte, error)

func (*RawPeer) RemoteVersion

func (r *RawPeer) RemoteVersion() (*wire.MsgVersion, error)

func (*RawPeer) String

func (r *RawPeer) String() string

func (*RawPeer) Write

func (r *RawPeer) Write(timeout time.Duration, msg wire.Message) error

Jump to

Keyboard shortcuts

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