btcindexer

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: 10 Imported by: 0

Documentation

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 is a client for communicating with the nBTC indexer worker. It wraps the btcindexer API client to add retry logic.

func NewClient

func NewClient(url string, parentLogger zerolog.Logger) *Client

NewClient creates a new client for the indexer.

func (*Client) GetLatestHeight

func (c *Client) GetLatestHeight() (int64, error)

GetLatestHeight returns the latest block height known to the indexer

func (*Client) SendBlocks

func (c *Client) SendBlocks(ctx context.Context, blocks []*types.IndexedBlock) error

SendBlocks sends a batch of blocks to the indexer with a retry mechanism. TODO: this should not block the main process probably we should use CF queues

type Indexer

type Indexer interface {
	SendBlocks(ctx context.Context, blocks []*types.IndexedBlock) error
	GetLatestHeight() (int64, error)
}

Indexer is the interface for a client that sends blocks to the nBTC indexer.

Jump to

Keyboard shortcuts

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