-
Notifications
You must be signed in to change notification settings - Fork 39
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 #286 from EYBlockchain/swati/multiple-user-test
Multiple Zapp Test
- Loading branch information
Showing
18 changed files
with
646 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
docker-compose -f docker-compose.zapp-double.yml down -v | ||
|
||
echo "Starting ganache..." | ||
|
||
docker compose -f docker-compose.zapp-double.yml up -d ganache $BUILD_ARG | ||
|
||
echo "Waiting for 30 seconds before starting the deployer..." | ||
sleep 30 | ||
|
||
echo "Starting deployer and zokrates..." | ||
CONSTRUCTOR_CALL | ||
|
||
docker-compose -f docker-compose.zapp-double.yml up -d deployer $BUILD_ARG | ||
|
||
docker compose -f docker-compose.zapp-double.yml up -d zokrates zokrates2 $BUILD_ARG | ||
echo "Waiting for 20 seconds before starting timber..." | ||
sleep 20 | ||
|
||
echo "Starting timber..." | ||
docker compose -f docker-compose.zapp-double.yml up -d timber timber2 $BUILD_ARG | ||
|
||
echo "Waiting for 2 seconds before starting Zapp orchestrators..." | ||
sleep 2 | ||
|
||
echo "Starting Zapp ..." | ||
docker compose -f docker-compose.zapp-double.yml up -d zapp zapp2 --build --wait | ||
echo "Waiting for 2 seconds before running the tests..." | ||
sleep 2 | ||
echo "All services have been started." | ||
echo "----------------------------------------------------" | ||
echo " Run these commands in two terminal to get the logs" | ||
echo "docker compose -f docker-compose.zapp-double.yml logs -f -n 1000 zapp zokrates timber" | ||
echo "docker compose -f docker-compose.zapp-double.yml logs -f -n 1000 zapp2 zokrates2 timber2" | ||
echo "-----------------------------------------------------" |
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
272 changes: 272 additions & 0 deletions
272
src/boilerplate/common/boilerplate-docker-compose.zapp-double.yml
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,272 @@ | ||
version: '3.5' | ||
|
||
services: | ||
zapp: | ||
ports: | ||
- '3000:3000' | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
depends_on: | ||
- zokrates | ||
- timber | ||
- ganache | ||
- zapp-mongo | ||
volumes: | ||
- ./build:/app/build | ||
- ./contracts/:/app/contracts/ | ||
- ./migrations/:/app/migrations/ | ||
- ./truffle-config.js:/app/truffle-config.js | ||
- ./circuits/:/app/circuits:delegated | ||
- ./orchestration/:/app/orchestration:delegated | ||
- ./test/:/app/test:delegated | ||
- ./config/:/app/config:delegated | ||
environment: | ||
BLOCKCHAIN_HOST: ws://ganache | ||
BLOCKCHAIN_PORT: 8545 | ||
RPC_URL: ws://ganache:8545 | ||
DEFAULT_ACCOUNT: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' | ||
KEY: '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d' | ||
LOG_LEVEL: info | ||
MONGO_HOST: mongodb://zapp-mongo | ||
MONGO_PORT: 27019 | ||
MONGO_NAME: zapp_db | ||
MONGO_USERNAME: admin | ||
MONGO_PASSWORD: admin | ||
networks: | ||
- zapp_network | ||
|
||
zapp2: | ||
ports: | ||
- '3001:3000' | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
depends_on: | ||
- zokrates | ||
- timber | ||
- ganache | ||
- zapp-mongo | ||
volumes: | ||
- ./build:/app/build | ||
- ./contracts/:/app/contracts/ | ||
- ./migrations/:/app/migrations/ | ||
- ./truffle-config.js:/app/truffle-config.js | ||
- ./circuits/:/app/circuits:delegated | ||
- ./orchestration/:/app/orchestration:delegated | ||
- ./test/:/app/test:delegated | ||
- ./config/:/app/config:delegated | ||
environment: | ||
BLOCKCHAIN_HOST: ws://ganache | ||
BLOCKCHAIN_PORT: 8545 | ||
RPC_URL: ws://ganache:8545 | ||
DEFAULT_ACCOUNT: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0' | ||
KEY: '0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1' | ||
LOG_LEVEL: info | ||
MONGO_HOST: mongodb://zapp-mongo | ||
MONGO_PORT: 27019 | ||
MONGO_NAME: zapp_db | ||
MONGO_USERNAME: admin | ||
MONGO_PASSWORD: admin | ||
networks: | ||
- zapp_network | ||
|
||
zokrates: | ||
image: ghcr.io/eyblockchain/zokrates-worker-updated:latest | ||
# the following image is for arm64 architecture. Uncomment the following lines and comment the above line if you are using ARM | ||
# image: ghcr.io/eyblockchain/zokrates-worker-starlight:v0.2 | ||
# platform: linux/arm64/v8 | ||
volumes: | ||
- ./circuits/:/app/circuits:delegated | ||
- ./proving-files/:/app/output:delegated | ||
- ./orchestration/common/write-vk.mjs:/app/write-vk.mjs | ||
- ./orchestration/common/db/:/app/orchestration/common/db:delegated | ||
environment: | ||
PROVING_SCHEME: 'g16' | ||
ports: | ||
- '8080:80' | ||
networks: | ||
- zapp_network | ||
|
||
zokrates2: | ||
image: ghcr.io/eyblockchain/zokrates-worker-updated:latest | ||
# the following image is for arm64 architecture. Uncomment the following lines and comment the above line if you are using ARM | ||
# image: ghcr.io/eyblockchain/zokrates-worker-starlight:v0.2 | ||
# platform: linux/arm64/v8 | ||
volumes: | ||
- ./circuits/:/app/circuits:delegated | ||
- ./proving-files/:/app/output:delegated | ||
- ./orchestration/common/write-vk.mjs:/app/write-vk.mjs | ||
- ./orchestration/common/db/:/app/orchestration/common/db:delegated | ||
environment: | ||
PROVING_SCHEME: 'g16' | ||
ports: | ||
- '8081:80' | ||
networks: | ||
- zapp_network | ||
|
||
timber: | ||
build: | ||
context: https://github.com/EYBlockchain/timber.git#starlight/testnet:merkle-tree | ||
dockerfile: Dockerfile | ||
restart: on-failure | ||
depends_on: | ||
- timber-mongo | ||
- ganache | ||
volumes: | ||
- ./config/:/app/config | ||
- ./contracts/:/app/contracts:consistent | ||
- ./build/:/app/build:consistent | ||
ports: | ||
- '9000:80' | ||
environment: | ||
HASH_TYPE: 'mimc' | ||
LOG_LEVEL: 'silly' | ||
UNIQUE_LEAVES: 'true' | ||
BLOCKCHAIN_HOST: ws://ganache | ||
BLOCKCHAIN_PORT: 8545 | ||
RPC_URL: ws://ganache:8545 | ||
DEFAULT_ACCOUNT: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' | ||
KEY: '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d' | ||
CONTRACT_LOCATION: 'default' | ||
MONGO_HOST: mongodb://timber-mongo | ||
MONGO_PORT: 27017 | ||
MONGO_NAME: merkle_tree | ||
MONGO_USERNAME: admin | ||
MONGO_PASSWORD: admin | ||
networks: | ||
- zapp_network | ||
|
||
timber2: | ||
build: | ||
context: https://github.com/EYBlockchain/timber.git#starlight/testnet:merkle-tree | ||
dockerfile: Dockerfile | ||
restart: on-failure | ||
depends_on: | ||
- timber-mongo | ||
- ganache | ||
volumes: | ||
- ./config/:/app/config | ||
- ./contracts/:/app/contracts:consistent | ||
- ./build/:/app/build:consistent | ||
ports: | ||
- '9001:80' | ||
environment: | ||
HASH_TYPE: 'mimc' | ||
LOG_LEVEL: 'silly' | ||
UNIQUE_LEAVES: 'true' | ||
BLOCKCHAIN_HOST: ws://ganache | ||
BLOCKCHAIN_PORT: 8545 | ||
RPC_URL: ws://ganache:8545 | ||
DEFAULT_ACCOUNT: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0' | ||
KEY: '0x6cbed15c793ce57650b9877cf6fa156fbef513c4e6134f022a85b1ffdd59b2a1' | ||
CONTRACT_LOCATION: 'default' | ||
MONGO_HOST: mongodb://timber-mongo | ||
MONGO_PORT: 27017 | ||
MONGO_NAME: merkle_tree | ||
MONGO_USERNAME: admin | ||
MONGO_PASSWORD: admin | ||
networks: | ||
- zapp_network | ||
|
||
#The database storing the merkle tree | ||
timber-mongo: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.mongo | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=admin | ||
- MONGO_INITDB_DATABASE=merkle_tree | ||
ports: | ||
- "2022:27017" | ||
volumes: | ||
- timber-mongo-volume:/data/db | ||
- ./config:/app/config/ | ||
networks: | ||
- zapp_network | ||
|
||
timber-mongo2: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.mongo | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=admin | ||
- MONGO_INITDB_DATABASE=merkle_tree | ||
ports: | ||
- "2023:27017" | ||
volumes: | ||
- timber-mongo-volume2:/data/db | ||
networks: | ||
- zapp_network | ||
|
||
#The database storing commitments | ||
zapp-mongo: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.mongo | ||
ports: | ||
- "2020:27017" | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=admin | ||
- MONGO_INITDB_DATABASE=zapp_db | ||
volumes: | ||
- zapp-commitment-volume:/data/db | ||
networks: | ||
- zapp_network | ||
|
||
zapp-mongo2: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.mongo | ||
ports: | ||
- "2021:27017" | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=admin | ||
- MONGO_INITDB_DATABASE=zapp_db | ||
volumes: | ||
- zapp-commitment-volume2:/data/db | ||
networks: | ||
- zapp_network | ||
|
||
|
||
ganache: | ||
image: trufflesuite/ganache:v7.4.4 | ||
command: --accounts=10 --gasLimit=100000000 --deterministic -i 1337 | ||
ports: | ||
- '8545:8545' | ||
networks: | ||
- zapp_network | ||
|
||
deployer: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.deployer | ||
depends_on: | ||
- ganache | ||
volumes: | ||
- ./build:/app/build | ||
- ./contracts/:/app/contracts/ | ||
- ./migrations/:/app/migrations/ | ||
- ./truffle-config.js:/app/truffle-config.js | ||
- ./orchestration/:/app/orchestration:delegated | ||
environment: | ||
BLOCKCHAIN_HOST: ws://ganache | ||
BLOCKCHAIN_PORT: 8545 | ||
RPC_URL: ws://ganache:8545 | ||
DEFAULT_ACCOUNT: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1' | ||
KEY: '0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d' | ||
networks: | ||
- zapp_network | ||
|
||
volumes: | ||
timber-mongo-volume: {} | ||
timber-mongo-volume2: {} | ||
zapp-commitment-volume: {} | ||
zapp-commitment-volume2: {} | ||
networks: | ||
zapp_network: | ||
name: zapp_network |
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
Oops, something went wrong.