Skip to main content

Configuration Reference

The container is configured via two sources:

SourcePurpose
config.json (volume-mounted)Chain definitions, webhook URL, server settings
Environment variables (.env or -e flags)Secrets and deployment-specific overrides

${ENV_VAR} placeholders inside config.json values are interpolated from the process environment at startup — use this to keep secrets out of the file.

{
"chains": [...],
"webhook": {
"url": "https://my-system.example.com/events",
"headers": {
"Authorization": "Bearer ${WEBHOOK_API_TOKEN}"
}
}
}

Chain Fields​

Each entry in the chains array configures one blockchain connection.

FieldRequiredDefaultDescription
chainKeyYes—Identifies the chain — see Supported Chains
rpcUrlYes—WebSocket (wss://, ws://) or HTTP (https://, http://) RPC endpoint
registryAddressesNo[]EVM addresses of Token Registries to watch; can be managed at runtime via the Registry API
replayFromBlockNo0Block number where your registry was deployed — replay starts here on first run
replayBatchSizeNo2000Max blocks per eth_getLogs batch — lower this (e.g. 500) on free-tier RPCs with rate limits
replayDelayMsNo0Delay between replay batches in ms — add 500–1000 on free-tier RPCs
confirmationsNo1Blocks to wait before delivery (max 12) — increase to reduce reorg risk on faster chains
pollIntervalMsNochain defaultPolling interval for HTTP-transport chains (stability, astron) — omit for WebSocket chains
WebSocket vs HTTP RPCs

WebSocket URLs (wss://) are used for event subscriptions on Ethereum, Polygon, and XDC — they receive new blocks in real time. Stability and Astron use HTTP polling (https://) because they do not support WebSocket subscriptions.


Webhook Fields​

FieldRequiredDefaultDescription
urlYes—Your downstream HTTP endpoint (must accept POST)
timeoutMsNo10000Per-attempt timeout in ms
retryAttemptsNo3Retries on delivery failure (max 10)
retryBackoffMsNo1000Base backoff in ms — doubles each attempt
headersNononeExtra headers on every delivery (e.g. Authorization, X-Api-Key)
maxConcurrentDeliveriesNo10Max in-flight POSTs at the same time
maxQueueSizeNo10000In-memory event buffer — events beyond this are logged and dropped

Server Fields​

FieldRequiredDefaultDescription
portNo8080Port for the health check and Registry API
hostNo0.0.0.0Keep 0.0.0.0 when running inside Docker
workerProcessesNotrueSpawn each chain in its own OS process for fault isolation — one chain crashing does not affect others
logLevelNoinfotrace / debug / info / warn / error / fatal

Environment Variables​

VariableRequiredDescription
SIGNING_PRIVATE_KEYYesRaw 32-byte Ed25519 seed, base64-encoded — see Quick Start
CONFIG_PATHNoPath to config file inside the container (default: /app/config.json)
DB_HOSTNoDatabase hostname — enables state persistence and distributed leasing
DB_DIALECTNoDatabase type: postgres (default), mysql, mariadb, or mssql
DB_PORTNoDatabase port — defaults to 5432 (postgres), 3306 (mysql/mariadb), 1433 (mssql)
DB_NAMENoDatabase name (default: trustvc_events)
DB_USERNoDatabase username (default: postgres)
DB_PASSWORDNoDatabase password
DB_POOL_MAXNoConnection pool max (default: 5)
DB_LEASE_TTL_MSNoDistributed lease TTL in ms for HA deployments (default: 30000)
OTEL_ENABLEDNoSet true to enable OpenTelemetry traces and metrics
OTEL_EXPORTER_OTLP_ENDPOINTNoOTLP collector endpoint (default: http://localhost:4318)
OTEL_SERVICE_NAMENoService name reported in telemetry (default: trustvc-webhook-events)

Full config.json Example​

{
"chains": [
{
"chainKey": "ethereum-sepolia",
"rpcUrl": "wss://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}",
"registryAddresses": [
"0xe6b5ce7E3691a0927b2806CE6638b35237DFfAc4"
],
"replayFromBlock": 10896377,
"replayBatchSize": 10000,
"replayDelayMs": 500,
"confirmations": 1
},
{
"chainKey": "stability",
"rpcUrl": "https://rpc.stabilityprotocol.com/zgt/${STABILITY_API_KEY}",
"registryAddresses": [
"0xCB524ba5D1C39f86d87af20B180c01aeD4517DcB"
],
"pollIntervalMs": 10000,
"replayFromBlock": 35000000,
"replayBatchSize": 5000,
"replayDelayMs": 5000,
"confirmations": 1
},
{
"chainKey": "polygon-amoy",
"rpcUrl": "wss://polygon-amoy-bor-rpc.publicnode.com",
"registryAddresses": [],
"replayFromBlock": 39173608,
"replayBatchSize": 5000
}
],
"webhook": {
"url": "https://your-system.example.com/trustvc/events",
"timeoutMs": 10000,
"retryAttempts": 3,
"retryBackoffMs": 1000,
"headers": {
"Authorization": "Bearer ${WEBHOOK_SECRET}"
}
},
"server": {
"port": 8080,
"host": "0.0.0.0",
"workerProcesses": true,
"logLevel": "info"
}
}