chain

package
v0.2.13-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 6 Imported by: 1

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