popm

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// BFGWSURL specifies the URL of the BFG private websocket endpoint
	BFGWSURL string

	// BTCChainName specifies the name of the Bitcoin chain that
	// this PoP miner is operating on.
	BTCChainName string // XXX are we brave enough to rename this BTCNetwork?

	// BTCPrivateKey provides a BTC private key as a string of
	// hexadecimal digits.
	BTCPrivateKey string

	LogLevel string

	PrometheusListenAddress string

	PprofListenAddress string

	RetryMineThreshold uint

	StaticFee uint
}

func NewDefaultConfig

func NewDefaultConfig() *Config

type EventHandler added in v0.2.5

type EventHandler = func(event EventType, data any)

EventHandler is a function that can handle an event.

type EventMineKeystone added in v0.2.5

type EventMineKeystone struct {
	Keystone *hemi.L2Keystone
}

EventMineKeystone is the data for EventTypeMineKeystone.

type EventTransactionBroadcast added in v0.2.5

type EventTransactionBroadcast struct {
	Keystone *hemi.L2Keystone
	TxHash   string
}

EventTransactionBroadcast is the data for EventTypeTransactionBroadcast.

type EventType added in v0.2.5

type EventType int

EventType represents a type of event.

const (
	// EventTypeMineKeystone is an event dispatched when a L2 keystone is being
	// mined.
	EventTypeMineKeystone EventType = iota + 1

	// EventTypeTransactionBroadcast is an event dispatched when a Bitcoin
	// transaction has been broadcast to the network.
	EventTypeTransactionBroadcast
)

type L2KeystoneProcessingContainer added in v0.1.1

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

type Miner

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

func NewMiner

func NewMiner(cfg *Config) (*Miner, error)

func (*Miner) AddL2Keystone added in v0.1.1

func (m *Miner) AddL2Keystone(val hemi.L2Keystone)

func (*Miner) BitcoinBalance

func (m *Miner) BitcoinBalance(ctx context.Context, scriptHash string) (*bfgapi.BitcoinBalanceResponse, error)

func (*Miner) BitcoinInfo

func (m *Miner) BitcoinInfo(ctx context.Context) (*bfgapi.BitcoinInfoResponse, error)

func (*Miner) BitcoinUTXOs

func (m *Miner) BitcoinUTXOs(ctx context.Context, scriptHash string) (*bfgapi.BitcoinUTXOsResponse, error)

func (*Miner) Connected added in v0.2.6

func (m *Miner) Connected() bool

func (*Miner) L2Keystones

func (m *Miner) L2Keystones(ctx context.Context, count uint64) (*bfgapi.L2KeystonesResponse, error)

func (*Miner) Ping

func (m *Miner) Ping(ctx context.Context, timestamp int64) (*bfgapi.PingResponse, error)

func (*Miner) RegisterEventHandler added in v0.2.5

func (m *Miner) RegisterEventHandler(handler EventHandler)

RegisterEventHandler registers an event handler to receive all events dispatched by the miner. The dispatched events can be filtered by EventType when received.

func (*Miner) Run

func (m *Miner) Run(pctx context.Context) error

Jump to

Keyboard shortcuts

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