Configuration

Every environment variable of the API, the app, the deploy script, and the local tooling.

API#

The API validates its environment on startup and refuses to start if anything required is missing or malformed. Copy verora-api/.env.example to .env to start.

VariableRequiredDefaultDescription
NODE_ENVNodevelopmentdevelopment, production, or test.
PORTNo4100HTTP port.
DATABASE_URLYes-postgres:// or postgresql:// connection string.
CHAINYes-foundry (local Anvil) or sepolia (Ethereum Sepolia).
RPC_URLYes-Comma-separated http/https RPC URLs, used one at a time and failed over in order when the active one stops answering, or a single ws/wss URL.
AGENT_REGISTRY_ADDRESSYes-From the deployment manifest.
QUERY_CONSUMER_ADDRESSYes-From the deployment manifest.
STAKING_POOL_ADDRESSYes-From the deployment manifest.
REPUTATION_MANAGER_ADDRESSYes-From the deployment manifest.
PAYMENT_ROUTER_ADDRESSYes-From the deployment manifest.
START_BLOCKNo0Deployment block (startBlock in the manifest). The indexer starts here on an empty database.
CONFIRMATIONSNo3Blocks to wait before indexing, to stay clear of reorgs (0 to 256). 0 is fine on local Anvil.
ORACLE_ENABLEDNotrueRuns the oracle loop.
ORACLE_PRIVATE_KEYWhen the oracle is enabled-Key of the FINALIZER address. Only needs gas; never use the contract owner's key.
JWT_SECRETYes-Session signing secret, at least 32 characters (for example openssl rand -hex 32).
PUBLIC_BASE_URLYes-Public URL of the API, used to build metadata and asset URLs.
CORS_ORIGINSIn productionemptyComma-separated browser origins allowed by CORS.
SIWE_DOMAINSIn productionemptyComma-separated host[:port] values accepted in SIWE messages. When empty, any domain is accepted.
SWAGGER_ENABLEDNofalseServes interactive API docs at /api/docs.
ALLOW_PRIVATE_AGENT_ENDPOINTSNofalseDevelopment only: lets the oracle and health checks call agents on private or loopback addresses over http. Rejected when NODE_ENV=production.
TRUST_PROXY_HOPSNo0Number of reverse proxies in front of the API, for correct client IPs in rate limiting (0 to 10).

Boolean variables accept true or 1.

Production checks

With NODE_ENV=production the API also refuses to start when ALLOW_PRIVATE_AGENT_ENDPOINTS is true or when CORS_ORIGINS or SIWE_DOMAINS is empty.

App#

All values are public and inlined at build time. The app refuses to start if a contract address is missing or malformed. See verora-app/.env.example.

VariableDescription
NEXT_PUBLIC_CHAINTarget network: foundry (local Anvil) or sepolia (Ethereum Sepolia).
NEXT_PUBLIC_RPC_URLComma-separated RPC endpoints, used one at a time and failed over in order when the active one stops answering (no background probing). Defaults to the chain's public RPC.
NEXT_PUBLIC_API_URLVerora API base URL, for example https://api.veroraprotocol.com.
NEXT_PUBLIC_SITE_URLOptional public origin of the app, used for canonical URLs, the sitemap, and social cards. Defaults to https://veroraprotocol.com.
NEXT_PUBLIC_AGENT_REGISTRY_ADDRESSFrom the deployment manifest.
NEXT_PUBLIC_QUERY_CONSUMER_ADDRESSFrom the deployment manifest.
NEXT_PUBLIC_STAKING_POOL_ADDRESSFrom the deployment manifest.
NEXT_PUBLIC_REPUTATION_MANAGER_ADDRESSFrom the deployment manifest.
NEXT_PUBLIC_PAYMENT_ROUTER_ADDRESSFrom the deployment manifest.

Deploy script#

Read by verora-contracts/script/Deploy.s.sol. The signer always comes from the forge CLI.

VariableRequiredDefaultDescription
FINALIZERYes-Oracle address authorized to finalize queries.
OWNERNoDeployerFinal owner of every contract (two-step transfer).
MIN_STAKENo10000000000000000 (0.01 ETH)Minimum stake per call, in wei.
UNSTAKING_PERIODNo604800 (7 days)Unbonding period in seconds, at most 30 days.
MIN_PAYMENT_PER_AGENTNo100000000000000 (0.0001 ETH)Minimum payment per assigned agent, in wei.
SEPOLIA_RPC_URLFor Sepolia-RPC URL behind the sepolia alias in foundry.toml.
ETHERSCAN_API_KEYFor --verify-Source verification on Etherscan.

Local tooling#

VariableUsed byDefaultDescription
VERORA_LOG_DIRstartup.sh/tmp/veroraWhere service logs are written.
Test agent settingsTest agentPort 4102Listen port, agent slugs, and each agent's owner and encryption keys. See the test agent source for the variable names.
AGENT_REGISTRY_ADDRESSTest agent, smoke test-AgentRegistry address.
RPC_URLTest agent, smoke test, SDK examplehttp://localhost:8545Chain RPC.
API_URLSmoke test, SDK examplehttp://localhost:4100Verora API.
APP_ORIGINSmoke test, SDK examplehttp://localhost:4101App origin used for SIWE.
Test agent URLSmoke testhttp://localhost:4102Test agent base URL, exported by startup.sh.
AGENT_ENDPOINTSDK examplehttp://localhost:4102/alpha/queryEndpoint registered for the example agent.
DEPLOYMENTSDK example../verora-contracts/deployments/31337.jsonDeployment manifest path.
QUERY_CONSUMER_ADDRESS, STAKING_POOL_ADDRESS, PAYMENT_ROUTER_ADDRESS, TREASURY_ADDRESSSmoke test-Contract addresses, exported by startup.sh.