bitwindowd

package
v0.0.0-...-2456cfb Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 42 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,
	bitcoind *service.Service[corerpc.BitcoinServiceClient],
	walletEngine *engines.WalletEngine,
	mempoolWatcher *engines.MempoolWatcher,
	pools *miningpools.Registry,
	config config.Config,
	recycle func(ctx context.Context, network config.Network, networkID string, resetFrom uint32) 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 (s *Server) CancelDenial(
	ctx context.Context,
	req *pb.CancelDenialRequest,
) (*emptypb.Empty, error)

func (*Server) CreateDenial

func (s *Server) CreateDenial(
	ctx context.Context,
	req *pb.CreateDenialRequest,
) (*emptypb.Empty, error)

func (*Server) DeleteAddressBookEntry

func (s *Server) DeleteAddressBookEntry(ctx context.Context, req *pb.DeleteAddressBookEntryRequest) (*emptypb.Empty, error)

func (*Server) ExportLabels

func (s *Server) ExportLabels(ctx context.Context, req *emptypb.Empty) (*pb.ExportLabelsResponse, error)

ExportLabels implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) GetFireplaceStats

func (s *Server) GetFireplaceStats(ctx context.Context, req *emptypb.Empty) (*pb.GetFireplaceStatsResponse, error)

GetFireplaceStats implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) GetMempoolWatchStatus

func (s *Server) GetMempoolWatchStatus(ctx context.Context, _ *emptypb.Empty) (*pb.GetMempoolWatchStatusResponse, error)

func (*Server) GetNetworkStats

func (s *Server) GetNetworkStats(ctx context.Context, req *emptypb.Empty) (*pb.GetNetworkStatsResponse, error)

func (*Server) GetSyncInfo

func (s *Server) GetSyncInfo(ctx context.Context, req *emptypb.Empty) (*pb.GetSyncInfoResponse, error)

GetSyncInfo implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) ImportLabels

func (s *Server) ImportLabels(ctx context.Context, req *pb.ImportLabelsRequest) (*pb.ImportLabelsResponse, error)

ImportLabels implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) ListAddressBook

func (s *Server) ListAddressBook(ctx context.Context, req *emptypb.Empty) (*pb.ListAddressBookResponse, error)

func (*Server) ListBlockStats

func (s *Server) ListBlockStats(ctx context.Context, req *pb.ListBlockStatsRequest) (*pb.ListBlockStatsResponse, error)

func (*Server) ListBlocks

func (s *Server) ListBlocks(ctx context.Context, c *pb.ListBlocksRequest) (*pb.ListBlocksResponse, error)

func (*Server) ListMiningPools

func (s *Server) ListMiningPools(ctx context.Context, req *pb.ListMiningPoolsRequest) (*pb.ListMiningPoolsResponse, error)

func (*Server) ListTransactionNotes

ListTransactionNotes implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) PauseDenial

func (s *Server) PauseDenial(
	ctx context.Context,
	req *pb.PauseDenialRequest,
) (*emptypb.Empty, error)

func (*Server) ResetMempoolWatch

func (s *Server) ResetMempoolWatch(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)

func (*Server) ResumeDenial

func (s *Server) ResumeDenial(
	ctx context.Context,
	req *pb.ResumeDenialRequest,
) (*emptypb.Empty, error)

func (*Server) SetMempoolWatch

func (s *Server) SetMempoolWatch(ctx context.Context, req *pb.SetMempoolWatchRequest) (*emptypb.Empty, error)

func (*Server) SetTransactionNote

func (s *Server) SetTransactionNote(ctx context.Context, req *pb.SetTransactionNoteRequest) (*emptypb.Empty, error)

SetTransactionNote implements bitwindowdv1connect.BitwindowdServiceHandler.

func (*Server) Stop

Stop implements bitwindowdv1connect.BitwindowdServiceHandler. Stop is the window-close hook + clean-exit entry point. Relays to drivechaind.Shutdown — drivechaind is detached and drains bitcoind/enforcer in the background over ~90s — then triggers bitwindowd's own teardown. Acks the frontend in milliseconds so the window can windowManager.destroy() immediately. With skip_downstream=true the drivechaind stack stays running (only bitwindowd dies).

func (*Server) UpdateAddressBookEntry

func (s *Server) UpdateAddressBookEntry(ctx context.Context, req *pb.UpdateAddressBookEntryRequest) (*emptypb.Empty, error)

func (*Server) UpdateNetwork

func (s *Server) UpdateNetwork(ctx context.Context, req *pb.UpdateNetworkRequest) (*pb.UpdateNetworkResponse, error)

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

Sequence:

  1. Forward to drivechaind's SetBitcoinConfigNetwork. drivechaind 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