zmq

package
v0.0.0-...-420fffb Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package zmq reference is taken from https://github.com/joakimofv/go-bitcoindclient which is a go wrapper around official zmq package https://github.com/pebbe/zmq4

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client manages ZMQ subscriptions and communication with a Bitcoin node. It handles ZMQ message routing and provides thread-safe access to subscriptions. Must be created with New() and cleaned up with Close().

func New

func New(
	parentLogger zerolog.Logger,
	zeromqEndpoint string,
	blockEventsChannel chan *btctypes.BlockEvent,
	rpcClient *rpcclient.Client,
) (*Client, error)

New creates a new zmq client

func (*Client) Close

func (c *Client) Close() error

Close closes the zmq connections to the bitcoin node

func (*Client) SubscribeSequence

func (c *Client) SubscribeSequence() error

SubscribeSequence subscribes to ZMQ "sequence" messages. Call cancel to unsubscribe.

type SequenceMessage

type SequenceMessage struct {
	Hash  [32]byte // use encoding/hex.EncodeToString() to get it into the RPC method string format.
	Event btctypes.EventType
}

SequenceMessage denotes the message struct received from zmq

type Subscriptions

type Subscriptions struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Subscriptions keeps track of the zmq connection state

Jump to

Keyboard shortcuts

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