Configuration (.env)¶
Every environment variable the framework reads, grouped by component, with its
default and what it does. Copy stealth_name_service/backend/.env_sample to
.env in the same directory and edit it.
How to read the tables¶
- Default is the value the code uses when the variable is unset. When
stealth_name_service/backend/.env_sampleships a different value, the cell says "sample: …". A variable with no default and an error when it is missing is marked required. - Used by names the binary or script that reads the variable.
- Rows marked not in
.env_sampleare read by the code (or by a compose file or script) but are not listed in the sample file. - Compose files pass the whole
.envto the services withenv_file, so one file configures every component.deploy.shalso sources it, to substitute${VAR:-default}values in the compose files. See Compose stacks. - Rows marked Deprecated belong to the legacy
abstract_accountpath. Use Track C (BridgeAA) instead: setup, legacy page.
Numeric and boolean parsing differs by component:
| Component | Boolean rule | Bad numeric value |
|---|---|---|
testing_backend |
true (any case) is on; everything else is off |
Silently falls back to the default |
event_listener |
Only EVENT_LISTENER_RESET_CURSOR is boolean: false (any case) is off; everything else is on |
Silently falls back to the default |
event_handler |
Not applicable | Silently falls back to the default |
consensus_committee and CONSENSUS_ENABLED in every binary |
true, 1, yes are on; false, 0, no are off |
Startup error, except CONSENSUS_ENABLED: any other value means off |
Backend¶
Read by testing_backend (src/main.rs, src/backend_log.rs). See
The backend HTTP server.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
RUST_LOG |
info (sample: info) |
event_handler, consensus_committee |
Log filter for the tracing subscriber of these two binaries (standard tracing filter syntax). The backend does not use it; it uses BACKEND_DEBUG_LEVEL. |
BACKEND_DEBUG_LEVEL |
verbose (sample: error-only) |
testing_backend |
error-only logs errors and startup lines; mute or quiet logs almost nothing; any other value or unset logs everything. |
ENABLE_HTTPS |
false |
testing_backend |
true serves HTTPS on 0.0.0.0:8443 instead of HTTP on 0.0.0.0:5000. |
ACTIX_WORKERS |
4 (sample: 3) |
testing_backend |
Number of Actix worker threads per replica. |
GRPC_POOL_SIZE |
1, minimum 1 (sample: 1) |
testing_backend, deploy.sh |
gRPC connections per replica to each network. deploy.sh requires it to be at most COINS_PER_REPLICA outside bridge mode. |
COINS_PER_REPLICA |
50 (sample: 10) |
testing_backend, deploy.sh |
Gas coins owned by each backend replica. Replica r (from the Swarm slot in HOSTNAME) takes coins [r*N, r*N + N) of each sender. Must match the replica count in docker-compose.backend.yml, or the load test hits locked objects. |
SENDER_ADDRESS |
unset (sample: the relayer address) | testing_backend, deploy.sh, event_handler, setup tools |
The bridge sender. The backend preloads a coin cache for it with twice COINS_PER_REPLICA coins. It is also the fallback for EVENT_HANDLER_SIGNER. deploy.sh prints a warning when it is unset outside benchmark mode. |
HOSTNAME |
"", slot 1 with a warning |
testing_backend |
Not in .env_sample. Set by Docker Swarm (backend.{{.Task.Slot}}.{{.Task.ID}}). The first number in it, minus one, is the replica's coin partition. |
BACKEND_PORT |
5000 |
compose, consensus_compare.sh |
Not in .env_sample. Host port published for the backend in docker-compose.backend.yml. |
TLS¶
Only read when ENABLE_HTTPS=true.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
TLS_CERT_PATH |
cert.pem (sample: ./cert.pem) |
testing_backend |
Path to the PEM certificate. |
TLS_KEY_PATH |
key.pem (sample: ./key.pem) |
testing_backend |
Path to the PEM private key. |
Network endpoints¶
| Variable | Default | Used by | Meaning |
|---|---|---|---|
IOTA_DEVNET_GRPC_URL |
https://grpc.devnet.iota.cafe:443 |
event_handler, setup tools, consensus_committee |
Not in .env_sample. gRPC endpoint for devnet. |
IOTA_TESTNET_GRPC_URL |
https://grpc.testnet.iota.cafe:443 |
event_handler, setup tools, consensus_committee |
Not in .env_sample. gRPC endpoint for testnet. |
The backend always connects to https://grpc.devnet.iota.cafe:443 and
https://grpc.testnet.iota.cafe:443; it does not read these two variables.
Load test¶
Read by loadtest through its flags. In benchmark and hybrid mode docker-compose.benchmark.yml
substitutes them into the loadtest command line; the compose fallback applies when the variable is
missing from .env. Run by hand, loadtest takes the flags directly and only reads
LOADTEST_GAS_BUDGET, LOADTEST_PIPELINE_DEPTH and OUTPUT_DIR from the environment. See
Binaries and scripts.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
NUM_AGENTS |
compose 10 (sample: 1000; code default 0) |
compose, testing_backend, loadtest --agents |
Concurrent agent tasks, one keystore address each. The backend preloads gas-coin caches for the first NUM_AGENTS key-pair addresses (code default 0). |
LOADTEST_INTERVAL |
compose 0.1 (sample: 8) |
compose, loadtest --interval |
Base interval between requests, in seconds. |
LOADTEST_REQUESTS |
compose 50 (sample: 100) |
compose, loadtest --requests |
Requests per agent. |
LOADTEST_GAS_BUDGET |
5000000 (sample: 8000000) |
loadtest, compose, consensus_compare.sh |
Gas budget per transaction. loadtest reads it itself as the default of --gas-budget. |
LOADTEST_TARGET_URL |
compose http://backend:5000/api/SendPTB (sample: same) |
compose, loadtest --target-url |
Endpoint to POST to. |
LOADTEST_JSON |
compose payloads/get_time.json (sample: payloads/bridge_request.json) |
compose, loadtest --json |
Payload template, a path inside the container. |
LOADTEST_ARRIVAL_TYPE |
compose default (sample: default) |
compose, loadtest --arrival-type |
default, staircase or poisson. |
LOADTEST_POISSON_LAMBDA |
compose 1.0 (sample: 0.5) |
compose, loadtest --poisson-lambda |
Per-agent rate in requests per second. The total rate is this value times NUM_AGENTS. |
LOADTEST_PIPELINE_DEPTH |
1 |
loadtest, compose, deploy.sh |
Maximum in-flight requests per agent. Must not exceed COINS_PER_REPLICA; deploy.sh enforces it outside bridge mode. |
LOADTEST_INCREMENT_INTERVAL |
compose 10.0 (sample: 70) |
compose, loadtest --increment-interval |
Seconds between staircase steps. |
LOADTEST_MAX_REQUESTS_PER_INTERVAL |
compose 5 (sample: 4) |
compose, loadtest --max-requests-per-interval |
Highest requests-per-interval the staircase reaches. |
OUTPUT_DIR |
./output |
loadtest |
Not in .env_sample. Directory where PTB_CALL_<timestamp>/ run folders are created. docker-compose.benchmark.yml sets it to /app/output. |
Event listener¶
Read by event_listener (src/bin/event_listener.rs). See The event listener.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
EVENT_LISTENER_PACKAGE_ID |
0x0c3c5bac1a1ab8258ea6ab6d630d350e65f9f8e879a768613225bbd20a1fa5b7 (sample: a bridge_source package) |
event_listener, event_handler |
Package whose events are watched. event_handler also reads it, only in 3-phase bridge mode (build_ack_config()), as the bridge_source package for acknowledgements. It is required there. |
EVENT_LISTENER_MODULE |
coordinator (sample: bridge_source) |
event_listener |
Module whose events are watched. |
EVENT_LISTENER_EVENT_TYPE |
unset (sample: CrossChainRequest) |
event_listener |
When set and not blank, only events whose fully qualified type contains this string are forwarded. |
EVENT_LISTENER_RPC_URL |
https://api.testnet.iota.cafe:443 |
event_listener |
Mentioned only in a comment of .env_sample. JSON-RPC endpoint polled for events (the source chain, testnet). |
EVENT_LISTENER_POLL_MS |
50 |
event_listener |
Not in .env_sample. Polling interval in milliseconds. |
EVENT_LISTENER_DEDUPE_CAPACITY |
10000 |
event_listener |
Not in .env_sample. Number of processed event ids remembered to suppress duplicates. |
EVENT_LISTENER_RESET_CURSOR |
on (resets) | event_listener |
Not in .env_sample. Unless set to false, the listener deletes data/cursor.json, data/events.jsonl and data/processed_events.json at start and begins from the chain tip. false resumes from the saved cursor. |
EVENT_HANDLER_URL |
http://event_handler:5000/api/handle_event |
event_listener |
Where the listener posts events when the committee is off. |
CONSENSUS_INGEST_URL |
http://consensus_committee:5000/api/handle_event |
event_listener |
Where the listener posts instead, when CONSENSUS_ENABLED is on. Commented out in the sample. |
BACKEND_API_URL |
none | nothing | In .env_sample (http://backend:5000/api/SendPTB), but no binary reads it. |
Event handler¶
Read by event_handler (src/bin/event_handler.rs). See The event handler.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
EVENT_HANDLER_MODE |
static (sample: bridge) |
event_handler, consensus_compare.sh |
static runs a fixed call and ignores the event body; bridge builds the destination call from the event and runs it through the BridgeAA. Any other value is a startup error. consensus_compare.sh refuses to start unless .env says bridge. |
EVENT_HANDLER_SIGNER |
falls back to SENDER_ADDRESS, then empty |
event_handler, setup tools |
Relayer address. In bridge mode it signs the CrossChainIntent and must be in the BridgeAA ACL; in static mode it signs ordinary transactions. It must exist in the keystore. Required in bridge mode. |
EVENT_HANDLER_NETWORK |
devnet (sample: devnet) |
event_handler, setup tools, consensus_committee |
The destination network, devnet or testnet. The acknowledgement runs on the other one. |
EVENT_HANDLER_KEYSTORE_PATH |
falls back to KEYSTORE_PATH, then iota.keystore |
event_handler, setup tools |
Keystore file. |
EVENT_HANDLER_GRPC_POOL_SIZE |
1 (sample: 12) |
event_handler |
gRPC connections per network. |
EVENT_HANDLER_GAS_COINS |
1000 |
event_handler |
Gas coins claimed for each sender at startup. Together with EVENT_HANDLER_CONCURRENCY this is the relayer's parallelism ceiling. See Gas pool sizing. |
EVENT_HANDLER_CONCURRENCY |
8, minimum 1 (sample: 12) |
event_handler |
Transactions in flight at once. Effective ceiling is the smaller of this and the live coin count. |
BATCH_SIZE |
100, minimum 1 |
event_handler |
Events bundled into one destination transaction. 1 is one transaction per event. Ignored in static mode. Each transaction reserves the per-event budget times the number of events in that batch (at most BATCH_SIZE). Coins below one full batch (budget × BATCH_SIZE) are retired. |
LOADTEST_GAS_BUDGET_BRIDGE |
5000000 (sample: 3000000) |
event_handler |
Gas budget of one destination event. The transaction reserves this times the number of events in the batch (at most BATCH_SIZE). |
EVENT_HANDLER_AGENT_NUMBER |
0 (sample: 1001) |
event_handler |
Agent number written to the agent_number column of bridge_results.csv. Use a number no load-test agent uses. |
EVENT_HANDLER_TARGET |
0xcdafbcff129cab6a0a84c935c8adcba8332eab042d2ed8a69dc665577ca82031::counter::increment |
event_handler |
Not in .env_sample. Fixed call of static mode. |
EVENT_HANDLER_ARGS_JSON |
[["object","0xaeaf7cfe71ec5f58674848556ed160e77f6cee6f6df223c54da644e86c1fa5a2"]] |
event_handler |
Not in .env_sample. Arguments of the static-mode call, as the JSON argument array the backend accepts. Invalid JSON becomes an empty array. |
KEYSTORE_PATH |
iota.keystore (sample: iota.aliases, in the legacy block) |
event_handler, setup tools |
Fallback for EVENT_HANDLER_KEYSTORE_PATH; keep that variable set, or the handler would open iota.aliases. |
BRIDGE_MIN_INTERVAL_MS |
none | nothing | In .env_sample (10000), but no binary reads it. |
BRIDGE_MAX_BACKOFF_MS |
none | nothing | In .env_sample (1000), but no binary reads it. |
Bridge account¶
The destination BridgeAA and the chain identifiers. Read by event_handler in bridge mode, by the
setup tools and, when its ACL check is on, by consensus_committee. See
Account abstraction and BridgeAA and
One-time bridge setup.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
BRIDGE_AA_PACKAGE_ID |
required (bridge mode, setup tools, committee ACL check) | event_handler, bridge_aa_init, bridge_acl_add, bridge_aa_coins, consensus_committee |
The bridge_abstract_account package on the destination chain. Not the same as BRIDGE_ACK_AA_PACKAGE_ID: the ACL is read through a type tag built from this id, so a package from the wrong network makes every entry invisible instead of raising an error. |
BRIDGE_AA_ACCOUNT_ID |
required (bridge mode, bridge_acl_add, bridge_aa_coins, committee ACL check) |
event_handler, bridge_acl_add, bridge_aa_coins, consensus_committee |
The BridgeAA object created by bridge_aa_init. It must own its gas coins; funding the relayer key is not enough. |
BRIDGE_SOURCE_CHAIN_ID |
required | event_handler, setup tools, consensus_committee |
Chain id of the source chain (the sample uses 1 for testnet). Arbitrary, but it must match the ACL entries' source_chain_id. consensus_committee always requires it. |
BRIDGE_TARGET_CHAIN_ID |
required | event_handler, setup tools, consensus_committee |
Chain id of the destination chain (the sample uses 2 for devnet). It must equal the account's own chain_id, or every intent aborts with EWrongTargetChain. The handler checks both ids at startup. |
BRIDGE_ACL_SOURCE_SENDERS |
unset | bridge_aa_init |
Comma-separated source-chain addresses seeded into the ACL at creation, besides the relayer. A request from an address missing from the ACL aborts with ESenderNotInAcl. |
BRIDGE_AA_CREATOR |
the relayer address | bridge_aa_init |
Not in .env_sample. Address that pays for and sends the account-creation transaction. It must be in the keystore. |
BRIDGE_TARGET_PACKAGE |
required by bridge_acl_add and bridge_aa_coins |
bridge_acl_add, bridge_aa_coins |
The bridge_target package on the destination chain. Those two tools use its record function as the anchor call in their transactions. The comment in .env_sample says no binary reads this variable; the code contradicts it. |
BRIDGE_ACL_GAS_BUDGET |
500000000 |
bridge_acl_add apply |
Not in .env_sample. Default of --gas-budget. |
BRIDGE_PROTOCOL_PHASES |
2 (sample: 3) |
event_handler, consensus_compare.sh |
2 is request then execute. 3 adds an acknowledgement on the source chain and requires EVENT_HANDLER_MODE=bridge. Anything else is a startup error. |
Acknowledgement¶
Used only when BRIDGE_PROTOCOL_PHASES=3. See
Three phases and the AA acknowledgement.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
BRIDGE_ACK_SIGNER |
eoa |
event_handler |
eoa: the relayer key signs an ordinary transaction calling bridge_source::acknowledge. aa: a second BridgeAA on the source chain executes a signed intent calling bridge_source::acknowledge_pure. |
BRIDGE_SOURCE_CONFIG_ID |
required when BRIDGE_ACK_SIGNER=eoa |
event_handler |
The frozen SourceConfig object on the source chain. |
BRIDGE_ACK_GAS_BUDGET |
2000000 |
event_handler |
Gas budget of one acknowledgement. Do not go below 2000000: one ack costs more than 1000000, and a smaller budget aborts with InsufficientGas. The reservation is this times the number of requests acknowledged in the batch (at most BATCH_SIZE). |
BRIDGE_ACK_AA_PACKAGE_ID |
required when BRIDGE_ACK_SIGNER=aa |
event_handler |
bridge_abstract_account deployment on the source network. |
BRIDGE_ACK_AA_ACCOUNT_ID |
required when BRIDGE_ACK_SIGNER=aa |
event_handler |
The BridgeAA created from it. Its single ACL entry names BRIDGE_AA_ACCOUNT_ID as the originator, and its chain ids are swapped relative to the destination account. It needs its own gas coins. |
Consensus committee¶
Read by consensus_committee (src/consensus/config.rs), by event_listener and event_handler
(for CONSENSUS_ENABLED and the delivery key) and by deploy.sh. See
Adding the consensus committee and
The consensus committee inside. CONSENSUS_INGEST_URL, the listener's
posting target, is described under Event listener.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
CONSENSUS_ENABLED |
false |
deploy.sh, event_listener, event_handler, consensus_committee |
true, 1 or yes turns the committee on (any other value is off). deploy.sh then adds docker-compose.consensus.yml in bridge and hybrid modes; benchmark mode ignores it. With it on, event_handler executes only deliveries signed by the committee. |
CONSENSUS_DELIVERY_KEY |
required when the committee is on, at least 32 characters | consensus_committee, event_handler, deploy.sh, consensus_compare.sh |
Shared HMAC-SHA256 secret. Generate one with openssl rand -hex 32. Both binaries refuse to start without it; deploy.sh stops before touching the stack. |
CONSENSUS_NODES |
4 |
consensus_committee |
Validators, all with equal voting power. Must be at least 1. CometBFT tolerates floor((n-1)/3) faulty or Byzantine ones. |
CONSENSUS_FAULTY_NODES |
0 |
consensus_committee |
Crash-stop nodes: in the validator set but never started. |
CONSENSUS_BYZANTINE_NODES |
0 |
consensus_committee |
Nodes running CONSENSUS_BYZANTINE_STRATEGY. Faulty plus Byzantine nodes must not exceed CONSENSUS_NODES. Exceeding floor((n-1)/3) only logs a warning. |
CONSENSUS_BYZANTINE_STRATEGY |
forge |
consensus_committee |
forge, censor, delay or equivocate (case-insensitive). Anything else is a startup error. |
CONSENSUS_BYZANTINE_DELAY_MS |
2000 |
consensus_committee |
How late a delay node proposes. |
CONSENSUS_TIMEOUT_PROPOSE_MS |
3000 |
consensus_committee |
CometBFT timeout_propose: a slow proposer loses its round after this. |
CONSENSUS_TIMEOUT_COMMIT_MS |
1000 |
consensus_committee |
CometBFT timeout_commit: a floor on the latency the committee adds per block. |
CONSENSUS_P2P_FLUSH_MS |
10 |
consensus_committee |
CometBFT p2p.flush_throttle_timeout. CometBFT's own default is 100. |
CONSENSUS_GOSSIP_SLEEP_MS |
10 |
consensus_committee |
CometBFT consensus.peer_gossip_sleep_duration. CometBFT's own default is 100. |
CONSENSUS_P2P_RATE_BYTES |
20480000 |
consensus_committee |
Per-peer p2p.send_rate and p2p.recv_rate, in bytes per second. CometBFT's own default is 5120000. |
CONSENSUS_SKIP_TIMEOUT_COMMIT |
false |
consensus_committee |
Start the next block as soon as all votes are in. Left off because it measured slower. |
CONSENSUS_CHECK_ACL |
true |
consensus_committee |
Every node checks the event's source_sender against the destination ACL (read-only RPC, no gas). false skips the check, for runs without a chain. |
CONSENSUS_ACL_REFRESH_SECS |
60 |
consensus_committee |
How often the ACL is re-read. 0 means never. |
CONSENSUS_EXECUTOR_URL |
http://event_handler:5000/api/handle_event |
consensus_committee |
Where the committee delivers committed events. Commented out in the sample. |
CONSENSUS_LISTEN_ADDR |
0.0.0.0:5000 |
consensus_committee |
Address of the committee's HTTP server. Commented out in the sample. |
CONSENSUS_BASE_PORT |
26656 |
consensus_committee |
Node i uses base + 10*i (p2p), +1 (RPC), +2 (ABCI). Commented out in the sample. |
CONSENSUS_COMETBFT_LOG_LEVEL |
info |
consensus_committee |
Log level passed to every CometBFT process. Commented out in the sample. |
CONSENSUS_INGEST_WORKERS |
32 |
consensus_committee |
Concurrent mempool submissions. Must be at least 1. Commented out in the sample. |
CONSENSUS_INGEST_QUEUE |
100000 |
consensus_committee |
Events queued before the listener gets a 503 and retries. Must be at least 1. Commented out in the sample. |
CONSENSUS_DELIVERY_TIMEOUT_MS |
10000 |
consensus_committee |
One delivery attempt to the executor, then retry. Must be at least 1. Commented out in the sample. |
CONSENSUS_CHAIN_ID |
bridge-committee |
consensus_committee |
The committee's own chain id, unrelated to the IOTA chain ids. Commented out in the sample. |
CONSENSUS_HOME |
consensus |
consensus_committee |
Not in .env_sample as a variable. Directory for the CometBFT homes, wiped on every start. docker-compose.consensus.yml sets it to /app/consensus. |
COMETBFT_BIN |
cometbft |
consensus_committee, consensus_smoke.sh |
Not in .env_sample as a variable. Path of the CometBFT binary. docker-compose.consensus.yml sets it to /usr/local/bin/cometbft; consensus_smoke.sh copies one out of the Docker image when it is unset. |
Tools and scripts¶
Variables read only by deploy.sh and consensus_smoke.sh. None is in .env_sample.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
DEPLOY_MODE |
bridge |
deploy.sh |
Deployment mode when --mode is not given: bridge, benchmark or hybrid. |
SWARM_ADVERTISE_ADDR |
127.0.0.1 |
deploy.sh |
Address passed to docker swarm init --advertise-addr. Set a routable address to add worker nodes. |
SMOKE_PORT |
5077 |
consensus_smoke.sh |
Port of the committee under test. |
SMOKE_MOCK_PORT |
5999 |
consensus_smoke.sh |
Port of the mock executor. |
Legacy account abstraction¶
Deprecated
Everything in this group belongs to the older abstract_account path. Its Move source is not in
this repository. Use Track C (BridgeAA) instead: One-time bridge setup.
Background: Legacy: the abstract_account path.
| Variable | Default | Used by | Meaning |
|---|---|---|---|
ENABLE_AA |
false |
testing_backend |
Deprecated. true initialises the legacy account at startup and registers /api/SendAAPTB. When off, the endpoint does not exist. |
SPONSOR_ADDRESS |
required by aa_init |
aa_init |
Deprecated. Address that sponsors and owns the legacy account. |
AA_ACCOUNT_ID_DEVNET |
unset | testing_backend, aa_init output |
Deprecated. Legacy account object on devnet. |
AA_PACKAGE_ID_DEVNET |
required by aa_init |
testing_backend, aa_init |
Deprecated. Legacy abstract_account package on devnet. |
PACKAGE_METADATA_ID |
none | nothing | Deprecated. In .env_sample, but no binary reads it. aa_init derives the metadata id from the package id. |
AA_MODULE_NAME |
required when creating an account | aa_init |
Deprecated. Module of the authenticator (sample: abstract_account). |
AA_FUNCTION_NAME |
required when ENABLE_AA=true and AA_ACCOUNT_ID_DEVNET is set |
testing_backend, aa_init |
Deprecated. Authenticator function; it must match authenticate_max_args_N, which implies N - 3 benchmark objects (sample: authenticate_max_args_125). |
AA_CREATE_FUNCTION_NAME |
required when creating an account | aa_init |
Deprecated. Account creation function (sample: create). |
BENCH_OBJECT_IDS |
required when ENABLE_AA=true and AA_ACCOUNT_ID_DEVNET is set |
testing_backend |
Deprecated. Comma-separated frozen benchmark object ids, optionally in brackets (sample: []). |