chain

package
v0.2.14-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 6 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &BitcoinConfig{
	Host:         "localhost:8332",
	UseTLS:       false,
	HTTPPostMode: true,
}

DefaultConfig is the default config that we use to

Functions

This section is empty.

Types

type BitcoinClient

type BitcoinClient interface {
	// GetTxDetail looks up a transaction.
	GetTxDetail(txHash *chainhash.Hash) (*btcjson.TxRawResult, error)
}

BitcoinClient is an interface which represents a connection to a bitcoin client.

func NewBitcoinClient

func NewBitcoinClient(cfg *BitcoinConfig) (BitcoinClient, error)

NewBitcoinClient attempts to connect to a bitcoin rpcclient with the config provided and returns a BitcoinClient wrapper which can be used to access the chain connection.

type BitcoinConfig

type BitcoinConfig struct {
	Host         string `long:"host" description:"host:port of the bitcoind/btcd instance address"`
	User         string `long:"user" description:"bitcoind/btcd user name"`
	Password     string `long:"password" description:"bitcoind/btcd password"`
	HTTPPostMode bool   `long:"httppostmode" description:"Use HTTP POST mode? bitcoind only supports this mode"`
	UseTLS       bool   `long:"usetls" description:"Use TLS to connect? bitcoind only supports non-TLS connections"`
	TLSPath      string `long:"tlspath" description:"Path to btcd tls certificate, bitcoind only supports non-TLS connections"`
}

BitcoinConfig defines exported config options for the connection to the btcd/bitcoind backend.

Jump to

Keyboard shortcuts

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