Add transaction accelerator (prioritisetransaction UI + API)
Full-stack feature for boosting transactions via bitcoind's prioritisetransaction RPC: Backend: - New accelerator package with Accelerate, Cancel, MaxFeerate, List, and background Cleanup goroutine (removes confirmed/dropped txs) - RPC wrappers: GetMempoolEntry, PrioritiseTransaction, GetRawMempoolVerbose, IsRPCError helpers - SQLite boosted_txs table for persistence across restarts - Revenue impact measured via getblocktemplate before/after comparison - Hard cap at 2000 sat/vB; MaxFeerate uses fees.base (not modified) to ignore our own prior priority adjustments Frontend: - Rocket icon in header with 10s jiggle animation - AcceleratorPage with flame-gradient border, txid input, feerate input, "Prioritize above all" button with spinner, boost list with cancel buttons, and dismissible error/success messages - Hash-based routing (#/accelerator) - SharesBar font size bump
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/kamadopool/kamado-api/internal/accelerator"
|
||||
"github.com/kamadopool/kamado-api/internal/bitcoind"
|
||||
"github.com/kamadopool/kamado-api/internal/ckpool"
|
||||
"github.com/kamadopool/kamado-api/internal/config"
|
||||
@@ -65,10 +66,16 @@ func main() {
|
||||
agg.Store = blockStore
|
||||
agg.MempoolBaseURL = cfg.MempoolBaseURL
|
||||
|
||||
// Transaction accelerator (prioritisetransaction).
|
||||
var accSvc *accelerator.Service
|
||||
if blockStore != nil {
|
||||
accSvc = accelerator.NewService(rpc, blockStore, log)
|
||||
}
|
||||
|
||||
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
|
||||
defer stop()
|
||||
|
||||
api := httpapi.New(agg, log)
|
||||
api := httpapi.New(agg, accSvc, log)
|
||||
|
||||
// Wire snapshot refreshes into the WebSocket hub so subscribers get
|
||||
// real-time updates without polling.
|
||||
@@ -130,6 +137,10 @@ func main() {
|
||||
go agg.IngestAttemptEvents(ctx, tailer.Attempts)
|
||||
go agg.IngestLatencyEvents(ctx, tailer.Latencies)
|
||||
|
||||
if accSvc != nil {
|
||||
go accSvc.Cleanup(ctx)
|
||||
}
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: cfg.ListenAddr,
|
||||
Handler: api.Handler(),
|
||||
|
||||
Reference in New Issue
Block a user