overlay-engine

module
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0

README

overlay-engine

The Go overlay host: go-overlay-services v1.3.8 (one-patch fork) on its own storage (a Pebble or SQLite index and BEEF blobs as files, pkg/store), with overlay-bridge pkg/spv as the only verifier and the bridge's header store as the chain tracker. It replaces the TypeScript host (overlay-blueprints) path for path: BRC-22 POST /submit and BRC-24 POST /lookup at the root, the same wire shapes, /healthz, /readyz, /metrics.

Status: P3 of the Go engine migration (1bsv-ops docs/integration/overlay/go-engine-migration.md): storage per ruling R-h (index/blob split, MongoDB retired), application modules on the bcommon contract: the reference module anytx, bsecret's Go module (modules/bsecret, from github.com/lightwebinc/bsecret/module) and bstore's (modules/bstore, from github.com/lightwebinc/bstore/module), blogs' (modules/blogs, from github.com/lightwebinc/blogs/module) and bfinger's (modules/finger, from github.com/lightwebinc/bfinger/module), bbox's (modules/bbox, from github.com/lightwebinc/bbox/module), borg's (modules/borg, from github.com/lightwebinc/borg/module) and bchat's (modules/bchat, from github.com/lightwebinc/bchat/module), mounted together with OVERLAY_MODULES=anytx,bbox,bchat,blogs,borg,bsecret,bstore,finger (docs/modules.md). Catch-up: GASP between hosts, pulling what a host missed from OVERLAY_GASP_PEERS every interval and serving the two peer routes, on every topic but the replay-only chains (docs/catch-up.md).

make build            # ./overlay-engine
make verify           # gofmt, vet, unit tests under -race, license file current
make integration      # the whole host end to end, file-backed store, no daemon
./overlay-engine store stats   # look inside a store (docs/storage.md)
  • docs/configuration.md: environment, ports, responses
  • docs/storage.md: the store, durability, retention (by block depth, and of anytx topics), checkpoints with the modules' state and restore, gc, the CLI
  • docs/catch-up.md: GASP catch-up between hosts, what it carries and never carries
  • docs/metrics.md: overlay_go_*, R1 to R3, storage, catch-up
  • docs/modules.md: writing a topic manager / lookup module
  • docs/bridge-trust.md: the bridge's SPV marker, what an accepted one skips (the scripts) and what still runs
  • Upstream behavior the host works around or records: 1bsv-ops docs/integration/overlay/go-engine-migration.md §13
  • third_party/FORK.md: the one-patch engine fork

Private modules

Some modules the host mounts live in private repositories (today bstore and blogs). Nothing of theirs is copied here; go fetches them from GitHub.

  • Locally: your own git credentials for github.com (for example gh auth setup-git) and GOPRIVATE=github.com/lightwebinc/*, which the Makefile sets; go env -w it for plain go commands.
  • CI: .github/workflows/ci.yml lists the repositories in private-modules. Each job mints a token from the org's read-only CI App (INFRA_APP_ID / INFRA_APP_PRIVATE_KEY), Contents read on exactly those repositories, revoked when the job ends. A new private module needs its repository added to that App's installation (an org owner) and to the list.

License: Apache-2.0 (LICENSE). Third-party licenses: NOTICE, LICENSE-THIRD-PARTY.

Directories

Path Synopsis
cmd
overlay-engine command
Command overlay-engine is the Go overlay host: go-overlay-services' engine (pinned, one-patch fork) on this repository's own storage (pkg/store: a Pebble or SQLite index and BEEF blobs as files), with overlay-bridge's pkg/spv as the only verifier and the bridge's header store as the chain tracker.
Command overlay-engine is the Go overlay host: go-overlay-services' engine (pinned, one-patch fork) on this repository's own storage (pkg/store: a Pebble or SQLite index and BEEF blobs as files), with overlay-bridge's pkg/spv as the only verifier and the bridge's header store as the chain tracker.
internal
bridgetrust
Package bridgetrust judges overlay-bridge's SPV trust marker on POST /submit: when to believe that the bridge on this machine has already run the scripts of the exact bytes submitted (overlay-bridge pkg/spv, marker.go, and docs/spv.md "The trust boundary").
Package bridgetrust judges overlay-bridge's SPV trust marker on POST /submit: when to believe that the bridge on this machine has already run the scripts of the exact bytes submitted (overlay-bridge pkg/spv, marker.go, and docs/spv.md "The trust boundary").
catchup
Package catchup is the host's GASP catch-up (BRC-88's sync, in the shape the shipped engines speak: since-score lists of unspent outputs, then one node per transaction): it serves the two peer routes a peer pulls from (Server), and pulls from its configured peers what this host is missing (Syncer), on every carried topic but the replay-only ones (ReplayOnly).
Package catchup is the host's GASP catch-up (BRC-88's sync, in the shape the shipped engines speak: since-score lists of unspent outputs, then one node per transaction): it serves the two peer routes a peer pulls from (Server), and pulls from its configured peers what this host is missing (Syncer), on every carried topic but the replay-only ones (ReplayOnly).
config
Package config reads the host's configuration from the environment.
Package config reads the host's configuration from the environment.
host
Package host wires the whole Go overlay host: storage, chain tracker, modules, the engine, the pipeline, readiness, root reconciliation, retention, GASP catch-up and the HTTP surface.
Package host wires the whole Go overlay host: storage, chain tracker, modules, the engine, the pipeline, readiness, root reconciliation, retention, GASP catch-up and the HTTP surface.
httpapi
Package httpapi is the host's HTTP surface, path for path and shape for shape with the TypeScript host it replaces (overlay-blueprints src/http.ts):
Package httpapi is the host's HTTP surface, path for path and shape for shape with the TypeScript host it replaces (overlay-blueprints src/http.ts):
metrics
Package metrics is the host's Prometheus registry: the admission stage histogram (R1), the per-object work histograms (R2), CPU attribution (R3) and the submit/lookup counters, all under the overlay_go_ prefix.
Package metrics is the host's Prometheus registry: the admission stage histogram (R1), the per-object work histograms (R2), CPU attribution (R3) and the submit/lookup counters, all under the overlay_go_ prefix.
pipeline
Package pipeline is one BRC-22 submission through the host: parse, SPV with overlay-bridge pkg/spv, the fee floor, then the engine's admission (topic managers, the BEEF blob, the index rows), each stage timed for R1 and each object's work counted for R2.
Package pipeline is one BRC-22 submission through the host: parse, SPV with overlay-bridge pkg/spv, the fee floor, then the engine's admission (topic managers, the BEEF blob, the index rows), each stage timed for R1 and each object's work counted for R2.
reconcile
Package reconcile drives engine.Storage.ReconcileMerkleRoot per topic from the BRC-135 header lane (ruling #55): every time the bridge's header store reports a new tip, the roots of the last Depth heights are re-read and handed to storage for every carried topic, so an output proven in a block that left the best chain becomes Invalidated and one whose root matches becomes Validated.
Package reconcile drives engine.Storage.ReconcileMerkleRoot per topic from the BRC-135 header lane (ruling #55): every time the bridge's header store reports a new tip, the roots of the last Depth heights are re-read and handed to storage for every carried topic, so an output proven in a block that left the best chain becomes Invalidated and one whose root matches becomes Validated.
testutil
Package testutil builds BEEF objects and a stand-in for overlay-bridge's header read API, for the host's tests.
Package testutil builds BEEF objects and a stand-in for overlay-bridge's header read API, for the host's tests.
tracker
Package tracker is the host's chain tracker: overlay-bridge's header store, read over the bridge's header API (default :9178) through the bridge's own Go client, with the two questions every admission asks answered from memory for a moment.
Package tracker is the host's chain tracker: overlay-bridge's header store, read over the bridge's header API (default :9178) through the bridge's own Go client, with the two questions every admission asks answered from memory for a moment.
modules
anytx
Package anytx is the reference module: tm_anytx admits every output of every object, and ls_anytx answers by outpoint from the engine's storage.
Package anytx is the reference module: tm_anytx admits every output of every object, and ls_anytx answers by outpoint from the engine's storage.
bbox
Package bbox mounts the bbox application's Go module (github.com/lightwebinc/bbox/module) in this engine: tm_bbox_<office> for each office BBOX_OFFICES names and ls_bbox for all of them, with its terms route on BBOX_LISTEN (where history is sold) and its outpoint rows and payment ledger under BBOX_STATE_DIR.
Package bbox mounts the bbox application's Go module (github.com/lightwebinc/bbox/module) in this engine: tm_bbox_<office> for each office BBOX_OFFICES names and ls_bbox for all of them, with its terms route on BBOX_LISTEN (where history is sold) and its outpoint rows and payment ledger under BBOX_STATE_DIR.
bchat
Package bchat mounts the bchat application's Go module (github.com/lightwebinc/bchat/module) in this engine: tm_bchat_<ws> for each workspace BCHAT_WORKSPACES names and ls_bchat for all of them, with its terms route on BCHAT_LISTEN (where history, export, chain and search are sold) and its rows journal, admission counter and payment ledger under BCHAT_STATE_DIR.
Package bchat mounts the bchat application's Go module (github.com/lightwebinc/bchat/module) in this engine: tm_bchat_<ws> for each workspace BCHAT_WORKSPACES names and ls_bchat for all of them, with its terms route on BCHAT_LISTEN (where history, export, chain and search are sold) and its rows journal, admission counter and payment ledger under BCHAT_STATE_DIR.
blogs
Package blogs mounts the blogs application's Go module (github.com/lightwebinc/blogs/module) in this engine: tm_log_<stream> for each stream BLOGS_STREAMS names and ls_log for all of them.
Package blogs mounts the blogs application's Go module (github.com/lightwebinc/blogs/module) in this engine: tm_log_<stream> for each stream BLOGS_STREAMS names and ls_log for all of them.
borg
Package borg mounts the borg application's Go module (github.com/lightwebinc/borg/module) in this engine: tm_borg_<hall> for each hall BORG_HALLS names and ls_borg for all of them, with its terms route on BORG_LISTEN (where history is sold) and its rows journal and payment ledger under BORG_STATE_DIR.
Package borg mounts the borg application's Go module (github.com/lightwebinc/borg/module) in this engine: tm_borg_<hall> for each hall BORG_HALLS names and ls_borg for all of them, with its terms route on BORG_LISTEN (where history is sold) and its rows journal and payment ledger under BORG_STATE_DIR.
bsecret
Package bsecret mounts the bsecret application's Go module (github.com/lightwebinc/bsecret/module) in this engine: tm_bsecret_<crypt> for each crypt BSECRET_CRYPTS names and ls_bsecret for all of them, with its terms route on BSECRET_LISTEN and its state under BSECRET_STATE_DIR.
Package bsecret mounts the bsecret application's Go module (github.com/lightwebinc/bsecret/module) in this engine: tm_bsecret_<crypt> for each crypt BSECRET_CRYPTS names and ls_bsecret for all of them, with its terms route on BSECRET_LISTEN and its state under BSECRET_STATE_DIR.
bstore
Package bstore mounts the bstore application's Go module (github.com/lightwebinc/bstore/module) in this engine: tm_bstore_<bucket> for each bucket BSTORE_BUCKETS names, tm_bstoreblob_<bucket> where OVERLAY_TOPICS names one (it refuses everything: a host holds no pieces), and ls_bstore for all of them, with its terms route on BSTORE_LISTEN (8294 on a Go host) and its state under BSTORE_STATE_DIR.
Package bstore mounts the bstore application's Go module (github.com/lightwebinc/bstore/module) in this engine: tm_bstore_<bucket> for each bucket BSTORE_BUCKETS names, tm_bstoreblob_<bucket> where OVERLAY_TOPICS names one (it refuses everything: a host holds no pieces), and ls_bstore for all of them, with its terms route on BSTORE_LISTEN (8294 on a Go host) and its state under BSTORE_STATE_DIR.
finger
Package finger mounts the bfinger application's Go module (github.com/lightwebinc/bfinger/module) in this engine: tm_finger and ls_finger.
Package finger mounts the bfinger application's Go module (github.com/lightwebinc/bfinger/module) in this engine: tm_finger and ls_finger.
pkg
module
Package module is how an application mounts its topic managers and lookup services in the Go overlay engine.
Package module is how an application mounts its topic managers and lookup services in the Go overlay engine.
store
Package store is the Go overlay engine's own storage: an INDEX store (the outpoint index, small, hot, updated on spend) and a BEEF BLOB store (large, written once per transaction, read on lookup and GASP, unlinked by retention), behind one URL-scheme factory, Teranode-style.
Package store is the Go overlay engine's own storage: an INDEX store (the outpoint index, small, hot, updated on spend) and a BEEF BLOB store (large, written once per transaction, read on lookup and GASP, unlinked by retention), behind one URL-scheme factory, Teranode-style.

Jump to

Keyboard shortcuts

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