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 — bitcoind's RPC is loopback-only on this box — and no privileged operation anywhere: the password is read from the staging board, which the admin user can read by group.
Index ¶
Constants ¶
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 FormatSize ¶
FormatSize renders a byte count the way the status screen shows data-directory sizes ("12.3 GB").
func GetSubversion ¶
GetSubversion identifies the running daemon through its authenticated RPC.
Types ¶
type BlockchainIdentity ¶
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 no privileged
// du of the data dir is needed for the status screen.
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 ¶
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.