api_bitwindowd

package
v0.0.0-...-5a53b6d Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryToProto

func EntryToProto(entry *addressbook.Entry) *pb.AddressBookEntry

Types

type Server

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

func New

func New(
	onShutdown func(ctx context.Context),
	db *sql.DB,
	validator *service.Service[validatorrpc.ValidatorServiceClient],
	wallet *service.Service[validatorrpc.WalletServiceClient],
	bitcoind *service.Service[corerpc.BitcoinServiceClient],
	walletEngine *engines.WalletEngine,
	config config.Config,
	recycle func(ctx context.Context, network config.Network) error,
) *Server

New creates a new Server. recycle hot-swaps bitwindowd's per-network runtime (DB, engines, sub-handlers) in-process when UpdateNetwork is called — bitwindowd never exits across a network swap.

func (*Server) CancelDenial

func (*Server) CreateDenial

func (*Server) GetFireplaceStats

GetFireplaceStats implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) GetNetworkStats

func (*Server) GetSyncInfo

GetSyncInfo implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) ListAddressBook

func (*Server) MineBlocks

func (*Server) PauseDenial

func (*Server) ResumeDenial

func (*Server) SetTransactionNote

SetTransactionNote implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) Stop

Stop implements drivechainv1connect.DrivechainServiceHandler.

func (*Server) UpdateNetwork

UpdateNetwork swaps bitcoind to a new network and recycles bitwindowd's per-network runtime in-process — bitwindowd never exits.

Sequence:

  1. Forward to orchestratord's SetBitcoinConfigNetwork. orchestratord rewrites bitcoin.conf, restarts bitcoind on the new chain, and atomically rebuilds its hosted bitcoin proxy. All `service.Service` reconnect loops (bitcoind, enforcer, wallet) reconverge automatically.
  2. Hand off to recycle: closes the old DB, opens a new network-scoped one, rebuilds engines + sub-handlers, atomic-swaps the listener mux. The HTTP server stays bound to the same port across the swap.
  3. Return success.

Jump to

Keyboard shortcuts

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