Skip to content

Commit

Permalink
Merge branch 'master' into david/client-testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
druiz0992 committed Oct 13, 2022
2 parents e648387 + d830dfe commit fe72daa
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 24 deletions.
2 changes: 1 addition & 1 deletion common-files/utils/httputils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const doObfuscation = object => {
const finished = promisify(stream.finished);

const downloadFile = async (fileUrl, outputLocationPath) => {
logger.debug(`Downloading file: $fileUrl`);
logger.debug(`Downloading file: ${fileUrl}`);

const writer = fs.createWriteStream(outputLocationPath);
return axios({
Expand Down
8 changes: 4 additions & 4 deletions docker/docker-compose.client.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version: '3.5'
services:
client:
build:
dockerfile: client.Dockerfile
context: .
dockerfile: docker/client.Dockerfile
context: ..
volumes:
- type: bind
source: ../nightfall-client/src
Expand All @@ -19,8 +19,8 @@ services:

worker:
build:
dockerfile: worker.Dockerfile
context: .
dockerfile: docker/worker.Dockerfile
context: ..
volumes:
- type: bind
source: ../nightfall-deployer/circuits
Expand Down
41 changes: 27 additions & 14 deletions docker/docker-compose.client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,24 @@ services:
- type: volume
source: build
target: /app/build
- type: volume
source: mongodb
target: /app/mongodb
networks:
- nightfall_network
ports:
- 27017:27017
- 8080:80
depends_on:
- worker
- rabbitmq
- mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
LOG_LEVEL: debug
LOG_LEVEL: ${LOG_LEVEL:-debug}
ZOKRATES_WORKER_HOST: worker
RABBITMQ_HOST: amqp://rabbitmq
RABBITMQ_PORT: 5672
ENABLE_QUEUE: 1
USE_STUBS: 'false' # make sure this flag is the same as in deployer service
OPTIMIST_HOST: ${OPTIMIST_HOST:-optimist}
OPTIMIST_PORT: ${OPTIMIST_PORT:-80}
MONGO_URL: ${CLIENT_MONGO_URL:-mongodb://mongodb:27017}
RABBITMQ_HOST: ${RABBITMQ_HOST:-amqp://rabbitmq}
RABBITMQ_PORT: ${RABBITMQ_PORT:-5672}
ENABLE_QUEUE: ${ENABLE_QUEUE:-1}
USE_STUBS: ${USE_STUBS:-false} # make sure this flag is the same as in deployer service
BLOCKCHAIN_URL: ${BLOCKCHAIN_URL}
USE_EXTERNAL_NODE: 'true'
AUTOSTART_RETRIES: 600
Expand All @@ -45,17 +43,32 @@ services:
networks:
- nightfall_network

mongodb:
image: mongo:4.4.1-bionic
hostname: mongodb
ports:
- 27017:27017
networks:
- nightfall_network
command: --quiet
volumes:
- type: volume
source: mongodb
target: /data/db

worker:
image: public.ecr.aws/m0t3e1j9/nightfall-worker:testnet
volumes:
- type: volume
source: proving_files
target: /app/output/
depends_on:
- rabbitmq
networks:
- nightfall_network
environment:
LOG_LEVEL: info
MPC: 'true'
LOG_LEVEL: ${LOG_LEVEL:-debug}
MPC: ${MPC:-true}
ETH_NETWORK: ${ETH_NETWORK}
CIRCUIT_FILES_URL: ${CIRCUIT_FILES_URL}

Expand All @@ -71,4 +84,4 @@ networks:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
gateway: 172.16.238.1
12 changes: 7 additions & 5 deletions zokrates-worker/src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ const checkCircuitsOutput = async () => {
fs.mkdirSync(`${outputPath}/${circuit}`);
}

const downloadPath = `${baseUrl}/proving_files/${circuit}/${filename}`;

try {
await downloadFile(
`${baseUrl}/proving_files/${circuit}/${f.split(' ')[1]}`,
`${outputPath}/${circuit}/${f.split(' ')[1]}`,
);
await downloadFile(downloadPath, `${outputPath}/${circuit}/${filename}`);
} catch (e) {
console.error(`ERROR downloading ${f.split(' ')[1]}`);
logger.error({
message: `ERROR downloading ${filename}`,
error: e,
});
}
}
}),
Expand Down

0 comments on commit fe72daa

Please sign in to comment.