Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerizing proposer #929

Merged
merged 4 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,13 @@ SDK API is documented in `./doc/lib/Nf3.html` and is provided by the NF_3 class

## Apps

Nightfall_3 provides some reference applications (which make use of the SDK) so that you can exercise its features. To
use it:
Nightfall_3 provides some reference applications (which make use of the SDK) so that you can
exercise its features. To use it:

- run up nightfall_3 as described above and wait for the deployment to complete;
- in the `apps` folder there are small applications like `proposer` or `challenger` you can run with
`npm start`. For example, `proposer` will start a small application running which will sign block
proposal transactions;
`./start-apps`. For example, `proposer` will start a small application running which will sign
block proposal transactions;

## Limitations

Expand Down
38 changes: 38 additions & 0 deletions docker-compose.apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.5'
# Use this script for making nightfall_3 use stubs.
services:

proposer:
build:
dockerfile: proposer.Dockerfile
context: .
ports:
# to use with postman and etc
- 8083:8080
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a port inconsistency with app.mjs where port is 8092

environment:
BLOCKCHAIN_WS_HOST: blockchain
BLOCKCHAIN_PORT: 8546
ENABLE_QUEUE: 1
OPTIMIST_HOST: optimist
OPTIMIST_PORT: 80
OPTIMIST_WS_PORT: 8080
CLIENT_HOST: client
CLIENT_PORT: 8080
networks:
- nightfall_network
volumes:
- type: bind
source: ./apps/proposer/src
target: /app/src
- type: bind
source: ./cli
target: /app/cli

networks:
nightfall_network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1
2 changes: 1 addition & 1 deletion proposer.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14.17
FROM node:16.17

WORKDIR /app
COPY common-files common-files
Expand Down
2 changes: 2 additions & 0 deletions start-apps
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#! /bin/bash
docker-compose -f docker-compose.apps.yml up proposer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @signorecello, what about the Challenger?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we can add a separate PR for challenger. Proposer is urgent