Skip to content

Deployment

deploy.sh does everything in one go: it removes the running stack, re-initialises the swarm, builds every image and deploys.

It resets Docker Swarm

deploy.sh runs docker swarm leave --force and then docker swarm init. Run it only on a machine where that is acceptable. Complete Setup first: you need .env and the keystore.

cd stealth_name_service/backend
./deploy.sh            # bridge mode (default)
./deploy.sh benchmark  # or: --mode benchmark

The default mode is bridge, which never starts a load test by itself.

Mode Services
bridge (default) backend, event_listener, event_handler
benchmark backend, loadtest
hybrid backend, loadtest, event_listener, event_handler

With CONSENSUS_ENABLED=true, bridge and hybrid also start consensus_committee.

Which compose files each mode loads

deploy.sh always loads docker-compose.backend.yml, adds files per mode, and appends the consensus file when the committee is on. Details of each file: Compose stacks.

flowchart LR
    B["docker-compose.backend.yml<br/>backend"]
    BR["docker-compose.bridge.yml<br/>event_listener, event_handler"]
    BM["docker-compose.benchmark.yml<br/>loadtest"]
    C["docker-compose.consensus.yml<br/>consensus_committee"]
    B --> bridge(["bridge"])
    BR --> bridge
    B --> benchmark(["benchmark"])
    BM --> benchmark
    B --> hybrid(["hybrid"])
    BM --> hybrid
    BR --> hybrid
    C -. "CONSENSUS_ENABLED<br/>(bridge, hybrid)" .-> bridge
    C -.-> hybrid

What deploy.sh checks

Before it touches the stack:

  • The mode is bridge, benchmark or hybrid; anything else exits with an error.
  • With CONSENSUS_ENABLED=true (outside benchmark), .env must hold a CONSENSUS_DELIVERY_KEY of at least 32 characters. Generate one with echo "CONSENSUS_DELIVERY_KEY=$(openssl rand -hex 32)" >> .env.

After the old stack and swarm are gone, before the deploy:

  • Outside bridge mode, COINS_PER_REPLICA, LOADTEST_PIPELINE_DEPTH and GRPC_POOL_SIZE must be non-negative integers, and the last two must not exceed COINS_PER_REPLICA.
  • Outside benchmark mode, an unset SENDER_ADDRESS only prints a warning.
  • testing_backend/iota.keystore must exist, or the script exits with an error. deploy.sh creates shared_data/, events_data/ and consensus_data/ itself.

A missing .env is only a warning: the compose defaults apply.

Services

Service What it does
backend Rust HTTP server, 10 replicas on port 5000
loadtest Concurrent load generator; writes CSVs to shared_data/
event_listener Polls the source chain module and forwards each new event
event_handler Builds, signs and submits the destination transaction; writes events_data/bridge_results.csv
consensus_committee Optional BFT committee between listener and handler (details)

Logs

The stack is named stealth-name-service-backend_<mode> and services are <stack>_<service>. When it finishes, deploy.sh prints the exact docker service logs -f command for each service of your mode. For bridge:

docker service logs -f stealth-name-service-backend_bridge_event_handler

(docker stack ps stealth-name-service-backend_bridge lists the tasks; deploy.sh runs it at the end.)

Where outputs land

All under stealth_name_service/backend/, created by deploy.sh (see Repository layout):

Folder Contents
shared_data/ Backend and loadtest output (PTB_CALL_* run folders)
events_data/ Listener and handler state, bridge_results.csv
consensus_data/ CometBFT homes and per-node logs, wiped on every committee start
results/ Written by consensus_compare.sh

Column definitions: CSV schemas.

Stop the stack

deploy.sh removes a stack with docker stack rm; do the same by hand:

docker stack rm stealth-name-service-backend_bridge

Check it worked

docker stack ls                                          # lists stealth-name-service-backend_<mode>
docker stack ps stealth-name-service-backend_bridge      # backend tasks Running
curl -s http://localhost:5000/ready                      # READY once the coin caches are warm

/ready answers 503 with WARMING until the caches are warm (GET /ready). The port is BACKEND_PORT, default 5000.

Next