Documentation
¶
Overview ¶
Package config reads the host's configuration from the environment. The names follow the TypeScript host's (OVERLAY_*) wherever the meaning is the same, so one EnvironmentFile reads the same to an operator on either host. It refuses rather than guesses: a malformed value stops the host before the port opens.
Index ¶
Constants ¶
const ( GenesisMain = "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" GenesisTest = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943" )
Genesis block hashes of the networks the scope can default.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Listen string
Port int
// Topics the host carries (OVERLAY_TOPICS).
Topics []string
// Modules mounted, by registered name (OVERLAY_MODULES, default anytx).
Modules []string
// IndexURL and BlobsURL name the two halves of storage (pkg/store):
// pebble:///dir or sqlite:///file.db, and file:///dir.
IndexURL string
BlobsURL string
// WALSync is the Pebble write-ahead log sync interval; 0 syncs every
// batch. Loss on power failure is bounded by it (ruling R-j).
WALSync time.Duration
// BlobFsync fsyncs each BEEF file before its rename.
BlobFsync bool
// StoreCacheMB is the index cache.
StoreCacheMB int
// RetentionBlocks unlinks the BEEF of spent-and-proven outputs this many
// blocks below the tip; 0 is off.
RetentionBlocks uint32
RetentionEvery time.Duration
// BackupDir is where POST /admin/checkpoint (loopback only) writes
// index checkpoints; empty disables the route.
BackupDir string
// ChainTrackerURL is the overlay-bridge header API origin.
ChainTrackerURL string
// Network selects pkg/spv's activation heights and names the storage scope.
Network spv.Network
GenesisHash string
Finality spv.FinalityPolicy
VerifyTimeout time.Duration
MinFeeSatPerKB uint64
// TrustBridgeVerify honors overlay-bridge's SPV marker on POST /submit
// (internal/bridgetrust): a loopback submission whose marker checks
// under the key in BridgeMarkerKeyFile skips the scripts only.
TrustBridgeVerify bool
BridgeMarkerKeyFile string
// SigVerifier is the secp256k1 ECDSA verifier behind go-sdk's hooks:
// decred (overlay-bridge pkg/secpverify, the default) or sdk (go-sdk's
// built-in crypto/ecdsa path).
SigVerifier string
ReconcileDepth uint32
ReconcileEvery time.Duration
// PprofListen serves net/http/pprof (with block and mutex profiling at
// low rates) on this loopback host:port; empty is off.
PprofListen string
// GASP catch-up (internal/catchup). GASPPeers are the hosts this one
// pulls from, as origins (http://host:port); none leaves the sync loop
// off, and the peer routes are still served to GASPAllow.
GASPPeers []string
GASPInterval time.Duration
GASPConcurrency int
// GASPAllow is who may call the peer routes: OVERLAY_GASP_ALLOW, or
// loopback and the peers' addresses when it is unset.
GASPAllow []netip.Prefix
// GASPServePerSec is the requests a second each allowed address may
// make of the peer routes (a burst of twice that); all of them together
// get twice the rate.
GASPServePerSec int
// GASPShedURL is the bridge's /metrics. When set, a sync round also runs
// right after a burst of sheds ends.
GASPShedURL string
// Replay is ordered replay for the topics GASP never carries (R-o),
// from the same peers on the same schedule (OVERLAY_REPLAY, on by
// default); ReplayQuestions and ReplayObjects bound one call of a
// module's replayer, ReplayRoundQuestions one topic from one peer in a
// round.
Replay bool
ReplayQuestions int
ReplayObjects int
ReplayRoundQuestions int
}
Config is the host's whole configuration.