bitcoin

package
v0.7.0-rc.12 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

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

Overview

Package bitcoin talks to the local bitcoind over its JSON-RPC interface, authenticating with the node's own staged RPC credential (see internal/host/rpcauth.go). Plain HTTP to 127.0.0.1 with basic auth, because bitcoind's RPC listens only on loopback on this machine, and no privileged operation anywhere. The password is read from the staging board, which the admin user can read by group.

Index

Constants

View Source
const RPCUser = "vpn"

RPCUser is the operator RPC identity shared by the client, host provisioning and the bitcoin-cli wrapper. LND has its own independent credential.

Variables

This section is empty.

Functions

func FormatProgress

func FormatProgress(progress float64) string

func GetSubversion

func GetSubversion(rpcPort int) (string, error)

GetSubversion identifies the running daemon through its authenticated RPC.

Types

type BlockchainIdentity

type BlockchainIdentity struct {
	Chain           string
	Genesis         string
	SignetChallenge string
}

BlockchainIdentity is the minimum live evidence needed to prove that the running Core instance matches the immutable installed profile. Chain alone is insufficient for signet because public and custom signets both report "signet" and share the genesis block.

func GetBlockchainIdentity

func GetBlockchainIdentity(rpcPort int) (BlockchainIdentity, error)

type BlockchainInfo

type BlockchainInfo struct {
	Blocks   int
	Headers  int
	Progress float64
	Synced   bool
	// SizeOnDisk is bitcoind's own measure of its data
	// footprint in bytes, which is why the status screen needs
	// no privileged du of the data dir.
	SizeOnDisk int64
}

func GetBlockchainInfo

func GetBlockchainInfo(ctx context.Context, rpcPort int) (BlockchainInfo, error)

GetBlockchainInfo reports read failures separately from a valid empty chain.

type FeeEstimate

type FeeEstimate struct {
	Blocks   int
	SatPerVB float64
}

FeeEstimate retains Core's returned target, which may differ from the request.

func EstimateSmartFee

func EstimateSmartFee(ctx context.Context, rpcPort, target int) (FeeEstimate, error)

EstimateSmartFee keeps Core's default estimate mode and the existing 1 sat/vB minimum. The result is a rate suggestion, not a transaction fee quote.

Jump to

Keyboard shortcuts

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