generated from recmo/rust-service-template
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #727 from reilabs/piohei/e2e_test
E2E testing with docker compose
- Loading branch information
Showing
21 changed files
with
1,101 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
services: | ||
chain: | ||
image: ghcr.io/foundry-rs/foundry | ||
hostname: chain | ||
platform: linux/amd64 | ||
ports: | ||
- ${CHAIN_PORT:-8545}:8545 | ||
command: [ "anvil --host 0.0.0.0 --chain-id 31337 --block-time 30 --base-fee 0 --gas-limit 0 --gas-price 0 --fork-url https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}@5091094" ] | ||
tx-sitter-db: | ||
image: postgres:latest | ||
hostname: tx-sitter-db | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=tx-sitter | ||
ports: | ||
- ${TX_SITTER_DB_PORT:-5460}:5432 | ||
volumes: | ||
- tx_sitter_db_data:/var/lib/postgresql/data | ||
sequencer-db: | ||
image: postgres:latest | ||
environment: | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
- POSTGRES_DB=sequencer | ||
ports: | ||
- ${SEQUENCER_DB_PORT:-5461}:5432 | ||
volumes: | ||
- sequencer_db_data:/var/lib/postgresql/data | ||
tx-sitter: | ||
image: ghcr.io/worldcoin/tx-sitter-monolith:latest | ||
hostname: tx-sitter | ||
depends_on: | ||
- tx-sitter-db | ||
- chain | ||
restart: always | ||
ports: | ||
- ${TX_SITTER_PORT:-3000}:3000 | ||
environment: | ||
- RUST_LOG=info | ||
- TX_SITTER__SERVICE__ESCALATION_INTERVAL=3s | ||
- TX_SITTER__DATABASE__KIND=connection_string | ||
- TX_SITTER__DATABASE__CONNECTION_STRING=postgres://postgres:postgres@tx-sitter-db:5432/tx-sitter?sslmode=disable | ||
- TX_SITTER__KEYS__KIND=local | ||
- TX_SITTER__SERVICE__PREDEFINED__NETWORK__CHAIN_ID=31337 | ||
- TX_SITTER__SERVICE__PREDEFINED__NETWORK__NAME=Anvil | ||
- TX_SITTER__SERVICE__PREDEFINED__NETWORK__HTTP_RPC=http://chain:8545 | ||
- TX_SITTER__SERVICE__PREDEFINED__NETWORK__WS_RPC=ws://chain:8545 | ||
- TX_SITTER__SERVICE__PREDEFINED__RELAYER__ID=1b908a34-5dc1-4d2d-a146-5eb46e975830 | ||
- TX_SITTER__SERVICE__PREDEFINED__RELAYER__NAME=Relayer | ||
- TX_SITTER__SERVICE__PREDEFINED__RELAYER__CHAIN_ID=31337 | ||
- TX_SITTER__SERVICE__PREDEFINED__RELAYER__KEY_ID=d10607662a85424f02a33fb1e6d095bd0ac7154396ff09762e41f82ff2233aaa | ||
- TX_SITTER__SERVICE__PREDEFINED__RELAYER__API_KEY=G5CKNF3BTS2hRl60bpdYMNPqXvXsP-QZd2lrtmgctsnllwU9D3Z4D8gOt04M0QNH | ||
- TX_SITTER__SERVER__HOST=0.0.0.0:3000 | ||
- TX_SITTER__SERVER__DISABLE_AUTH=true | ||
semaphore-keys-init-insertion: | ||
image: curlimages/curl:latest | ||
user: "0:0" | ||
volumes: | ||
- ./keys:/keys | ||
entrypoint: /bin/sh | ||
restart: on-failure | ||
command: | ||
- "-c" | ||
- > | ||
if [ ! -f "/keys/insertion_b10t30.ps" ]; then | ||
curl "https://semaphore-mtb-trusted-setup-ceremony.s3.amazonaws.com/insertion_b10/insertion_b10t30.ps" -o /keys/insertion_b10t30.ps && | ||
chown -f $(stat -c "%u:%g" /keys/.keep) /keys/insertion_b10t30.ps; | ||
fi | ||
semaphore-keys-init-deletion: | ||
image: curlimages/curl:latest | ||
user: "0:0" | ||
volumes: | ||
- ./keys:/keys | ||
entrypoint: /bin/sh | ||
restart: on-failure | ||
command: | ||
- "-c" | ||
- > | ||
if [ ! -f "/keys/deletion_b10t30.ps" ]; then | ||
curl "https://semaphore-mtb-trusted-setup-ceremony.s3.amazonaws.com/deletion_b10/deletion_b10t30.ps" -o /keys/deletion_b10t30.ps && | ||
chown -f $(stat -c "%u:%g" /keys/.keep) /keys/deletion_b10t30.ps; | ||
fi | ||
semaphore-insertion: | ||
image: ghcr.io/worldcoin/semaphore-mtb:latest | ||
hostname: semaphore-insertion | ||
restart: always | ||
ports: | ||
- ${SEMAPHORE_INSERTION_PORT:-3001}:3001 | ||
command: [ "start", "--keys-file", "/mtb/keys/insertion_b10t30.ps", "--prover-address", "0.0.0.0:3001", "--mode", "insertion" ] | ||
volumes: | ||
- ./keys:/mtb/keys | ||
environment: | ||
BATCH_TIMEOUT_SECONDS: 1 | ||
depends_on: | ||
semaphore-keys-init-insertion: | ||
condition: service_completed_successfully | ||
semaphore-deletion: | ||
image: ghcr.io/worldcoin/semaphore-mtb:latest | ||
hostname: semaphore-deletion | ||
restart: always | ||
ports: | ||
- ${SEMAPHORE_DELETION_PORT:-3002}:3001 | ||
command: [ "start", "--keys-file", "/mtb/keys/deletion_b10t30.ps", "--prover-address", "0.0.0.0:3001", "--mode", "deletion" ] | ||
volumes: | ||
- ./keys:/mtb/keys | ||
environment: | ||
BATCH_DELETION_TIMEOUT_SECONDS: 1 | ||
depends_on: | ||
semaphore-keys-init-deletion: | ||
condition: service_completed_successfully | ||
signup-sequencer-balancer: | ||
image: haproxy:3.0.0 | ||
hostname: signup-sequencer-balancer | ||
restart: always | ||
profiles: [ e2e-ha ] | ||
ports: | ||
- ${SIGNUP_SEQUENCER_BALANCER_PORT:-8080}:8080 | ||
volumes: | ||
- ./haproxy:/usr/local/etc/haproxy | ||
depends_on: | ||
- signup-sequencer-0 | ||
signup-sequencer-0: &signup-sequencer-def | ||
image: signup-sequencer | ||
hostname: signup-sequencer-0 | ||
profiles: [ e2e-ha ] | ||
build: | ||
context: ./../../ | ||
depends_on: | ||
- sequencer-db | ||
- chain | ||
- semaphore-insertion | ||
- semaphore-deletion | ||
- tx-sitter | ||
restart: always | ||
ports: | ||
- ${SIGNUP_SEQUENCER_0_PORT:-9080}:8080 | ||
volumes: | ||
- ./signup_sequencer/config.toml:/config.toml | ||
command: [ "/config.toml" ] | ||
environment: | ||
- RUST_LOG=debug | ||
# signup-sequencer-1: | ||
# <<: *signup-sequencer-def | ||
# hostname: signup-sequencer-1 | ||
# ports: | ||
# - ${SIGNUP_SEQUENCER_0_PORT:-9081}:8080 | ||
# signup-sequencer-2: | ||
# <<: *signup-sequencer-def | ||
# hostname: signup-sequencer-2 | ||
# ports: | ||
# - ${SIGNUP_SEQUENCER_0_PORT:-9082}:8080 | ||
# signup-sequencer-3: | ||
# <<: *signup-sequencer-def | ||
# hostname: signup-sequencer-3 | ||
# ports: | ||
# - ${SIGNUP_SEQUENCER_0_PORT:-9083}:8080 | ||
volumes: | ||
tx_sitter_db_data: | ||
driver: local | ||
sequencer_db_data: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
frontend http-in | ||
bind *:8080 | ||
default_backend http_back | ||
|
||
backend http_back | ||
balance roundrobin | ||
server signup-sequencer-0 signup-sequencer-0:8080 check | ||
# server signup-sequencer-1 signup-sequencer-1:8080 check | ||
# server signup-sequencer-2 signup-sequencer-2:8080 check | ||
# server signup-sequencer-3 signup-sequencer-3:8080 check |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[tree] | ||
tree_depth = 30 | ||
dense_tree_prefix_depth = 10 | ||
tree_gc_threshold = 10000000 | ||
cache_file = "./cache_file" | ||
|
||
[server] | ||
address = "0.0.0.0:8080" | ||
|
||
[network] | ||
identity_manager_address = "0x48483748eb0446A16cAE79141D0688e3F624Cb73" | ||
|
||
[relayer] | ||
kind = "tx_sitter" | ||
tx_sitter_url = "http://tx-sitter:3000/1/api/G5CKNF3BTS2hRl60bpdYMNPqXvXsP-QZd2lrtmgctsnllwU9D3Z4D8gOt04M0QNH" | ||
tx_sitter_address = "0x1d7ffed610cc4cdC097ecDc835Ae5FEE93C9e3Da" | ||
tx_sitter_gas_limit = 2000000 | ||
|
||
[providers] | ||
primary_network_provider = "http://chain:8545" | ||
|
||
[app] | ||
provers_urls = '[{"url": "http://semaphore-insertion:3001", "prover_type": "insertion", "batch_size": 10,"timeout_s": 30}, {"url": "http://semaphore-deletion:3001", "prover_type": "deletion", "batch_size": 10,"timeout_s": 30}]' | ||
batch_insertion_timeout = "30s" | ||
batch_deletion_timeout = "1s" | ||
|
||
[database] | ||
database = "postgres://postgres:postgres@sequencer-db:5432/sequencer?sslmode=disable" |
Oops, something went wrong.