New internal/store package wraps modernc.org/sqlite (pure Go, no CGO) with a BlockStore that exposes Open/Close/InsertBlock/ Recent. The aggregator now accepts an optional *store.BlockStore; on Run() it loads up to maxBlockHistory rows from the store before the first refresh, and each ingested block gets written to the DB before being appended to the in-memory ring. main.go opens the store at cfg.DBPath and logs a warning + falls back to in-memory-only if the file can't be created — a broken data volume shouldn't stop the pool from running. InsertBlock uses INSERT OR IGNORE on the height primary key so replayed log events after a restart are harmless.
18 lines
527 B
AMPL
18 lines
527 B
AMPL
module github.com/kamadopool/kamado-api
|
|
|
|
go 1.22
|
|
|
|
require modernc.org/sqlite v1.34.5
|
|
|
|
require (
|
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
|
github.com/google/uuid v1.6.0 // indirect
|
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
|
github.com/ncruces/go-strftime v0.1.9 // indirect
|
|
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
|
golang.org/x/sys v0.22.0 // indirect
|
|
modernc.org/libc v1.55.3 // indirect
|
|
modernc.org/mathutil v1.6.0 // indirect
|
|
modernc.org/memory v1.8.0 // indirect
|
|
)
|