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:
@@ -10,18 +10,20 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/kamadopool/kamado-api/internal/accelerator"
|
||||
"github.com/kamadopool/kamado-api/internal/state"
|
||||
"github.com/kamadopool/kamado-api/internal/webui"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Agg *state.Aggregator
|
||||
Acc *accelerator.Service
|
||||
Hub *Hub
|
||||
Log *slog.Logger
|
||||
}
|
||||
|
||||
func New(agg *state.Aggregator, log *slog.Logger) *Server {
|
||||
return &Server{Agg: agg, Hub: NewHub(), Log: log}
|
||||
func New(agg *state.Aggregator, acc *accelerator.Service, log *slog.Logger) *Server {
|
||||
return &Server{Agg: agg, Acc: acc, Hub: NewHub(), Log: log}
|
||||
}
|
||||
|
||||
// Handler returns an http.Handler with all kamado routes mounted under
|
||||
@@ -39,6 +41,10 @@ func (s *Server) Handler() http.Handler {
|
||||
mux.HandleFunc("GET /api/ws", s.handleWS)
|
||||
mux.HandleFunc("GET /api/admin/debug-blocks", s.debugBlocks)
|
||||
mux.HandleFunc("POST /api/admin/reset-latency", s.resetLatency)
|
||||
mux.HandleFunc("POST /api/accelerate", s.accelerate)
|
||||
mux.HandleFunc("POST /api/accelerate/cancel", s.accelerateCancel)
|
||||
mux.HandleFunc("POST /api/accelerate/max", s.accelerateMax)
|
||||
mux.HandleFunc("GET /api/accelerate/list", s.accelerateList)
|
||||
mux.Handle("/", spaHandler(webui.FS()))
|
||||
return mux
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user