Skip to content

Commit

Permalink
Adapt code to work with MP-SPDZ git submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
sbellem committed Feb 1, 2021
1 parent f4d6b9d commit 5fcb03a
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 46 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poa/data
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poa/data
34 changes: 17 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
command: sh chain-latest.sh

deploy.contract:
image: hbswap-go-x
image: hbswap-go-z
build:
context: .
dockerfile: contract.Dockerfile
Expand All @@ -66,14 +66,14 @@ services:
command: ["wait-for-it", "eth.chain:8545", "--", "go", "run", "deploy/deploy.go", "eth.chain"]

mpc.trusted.setup:
image: hbswap-setup-x
image: hbswap-setup-z
build:
context: .
dockerfile: setup.Dockerfile
networks:
- hbswap
volumes:
- ../../Scripts/setup-ssl.sh:/usr/src/setup-ssl.sh
- ./MP-SPDZ/Scripts/setup-ssl.sh:/usr/src/setup-ssl.sh
- ./scripts/generate-keys.sh:/usr/src/generate-keys.sh
- public-keys:/usr/src/Player-Data
- secrets-p0:/usr/src/Secrets-P0
Expand All @@ -91,8 +91,8 @@ services:
networks:
- hbswap
volumes:
- ../../compile.py:/usr/src/compile.py
- ../../Compiler:/usr/src/Compiler
- ./MP-SPDZ/compile.py:/usr/src/compile.py
- ./MP-SPDZ/Compiler:/usr/src/Compiler
- ./src/mpc:/usr/src/Programs/Source
- ./scripts/compile.sh:/usr/src/compile.sh
- mpc-bytecodes:/usr/src/Programs/Bytecode
Expand All @@ -101,10 +101,10 @@ services:
command: ["bash", "compile.sh"]

mpc.node.0:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
dockerfile: Scripts/hbswap/hbswap.Dockerfile
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
environment:
POADIR: /opt/poa
Expand All @@ -130,10 +130,10 @@ services:
command: ["wait-for-it", "eth.chain:8545", "--", "bash", "mpc-node.sh", "0", "eth.chain", "mpc.node.0"]

mpc.node.1:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
dockerfile: Scripts/hbswap/hbswap.Dockerfile
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
environment:
POADIR: /opt/poa
Expand All @@ -156,10 +156,10 @@ services:
command: ["wait-for-it", "eth.chain:8545", "--", "bash", "mpc-node.sh", "1", "eth.chain", "mpc.node.0"]

mpc.node.2:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
dockerfile: Scripts/hbswap/hbswap.Dockerfile
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
environment:
POADIR: /opt/poa
Expand All @@ -182,10 +182,10 @@ services:
command: ["wait-for-it", "eth.chain:8545", "--", "bash", "mpc-node.sh", "2", "eth.chain", "mpc.node.0"]

mpc.node.3:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
dockerfile: Scripts/hbswap/hbswap.Dockerfile
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
environment:
POADIR: /opt/poa
Expand Down
40 changes: 18 additions & 22 deletions hbswap.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,20 @@ RUN set -ex \
&& ln -s libmpirxx.so.8.4.3 libmpirxx.so \
&& ln -s libmpirxx.so.8.4.3 libmpirxx.so.8

COPY Makefile .
COPY CONFIG .
COPY BMR BMR
#COPY ECDSA ECDSA
COPY Exceptions Exceptions
#COPY ExternalIO ExternalIO
#COPY FHE FHE
#COPY FHEOffline FHEOffline
COPY GC GC
COPY Machines Machines
COPY Math Math
COPY Networking Networking
COPY OT OT
COPY Processor Processor
COPY Protocols Protocols
COPY SimpleOT SimpleOT
COPY Tools Tools
COPY Utils Utils
#COPY Yao Yao
COPY MP-SPDZ/Makefile .
COPY MP-SPDZ/CONFIG .
COPY MP-SPDZ/BMR BMR
COPY MP-SPDZ/Exceptions Exceptions
COPY MP-SPDZ/GC GC
COPY MP-SPDZ/Machines Machines
COPY MP-SPDZ/Math Math
COPY MP-SPDZ/Networking Networking
COPY MP-SPDZ/OT OT
COPY MP-SPDZ/Processor Processor
COPY MP-SPDZ/Protocols Protocols
COPY MP-SPDZ/SimpleOT SimpleOT
COPY MP-SPDZ/Tools Tools
COPY MP-SPDZ/Utils Utils

RUN make clean

Expand Down Expand Up @@ -98,13 +93,13 @@ RUN go get -d -v github.com/ethereum/go-ethereum
WORKDIR $GOPATH/src/github.com/ethereum/go-ethereum
RUN git checkout cfbb969da

COPY Scripts/hbswap/src /go/src/github.com/initc3/MP-SPDZ/Scripts/hbswap
COPY src /go/src/github.com/initc3/MP-SPDZ/Scripts/hbswap

WORKDIR /go/src/github.com/initc3/MP-SPDZ/Scripts/hbswap

RUN go get -d -v ./...

COPY Scripts /usr/src/MP-SPDZ/Scripts
COPY MP-SPDZ/Scripts /usr/src/MP-SPDZ/Scripts

# MP-SPDZ
WORKDIR $MP_SPDZ_HOME
Expand All @@ -124,5 +119,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/MP-SPDZ/Scripts/hbswap/src/python
COPY src/python /usr/src/honeybadgerswap-python
WORKDIR /usr/src/honeybadgerswap-python
RUN pip install --editable .
2 changes: 1 addition & 1 deletion liquidity-provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
init.pool:
image: hbswap-go-x
image: hbswap-go-z
build:
context: .
dockerfile: contract.Dockerfile
Expand Down
12 changes: 6 additions & 6 deletions trader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'

services:
public.deposit:
image: hbswap-go-x
image: hbswap-go-z
build:
context: .
dockerfile: contract.Dockerfile
Expand All @@ -24,7 +24,7 @@ services:
command: ["bash", "client-public-deposit.sh", "eth.chain"]

secret.deposit:
image: hbswap-go-x
image: hbswap-go-z
build:
context: .
dockerfile: contract.Dockerfile
Expand All @@ -46,9 +46,9 @@ services:
command: ["bash", "client-secret-deposit.sh", "eth.chain"]

trade-1:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
# FIXME is the poa stuff needed?
Expand All @@ -70,9 +70,9 @@ services:
#command: ["wait-for-it", "mpc.node.3:8080", "--", "bash", "trade.sh", "eth.chain", "0", "-1.1", "2"]

trade-2:
image: hbswap-mpc-x
image: hbswap-mpc-z
build:
context: ../..
context: .
dockerfile: hbswap.Dockerfile
target: hbswap
# FIXME is the poa stuff needed?
Expand Down

0 comments on commit 5fcb03a

Please sign in to comment.