-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
190 lines (152 loc) · 5.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
.PHONY: help
.DEFAULT_GOAL := help
define PRINT_HELP_PYSCRIPT
import re, sys
for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT
reset:
go run src/go/reset/reset.go
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
clean: clean-mpc-progs
docker-compose run --rm ethnode rm -rf /opt/hbswap/poa/data
#docker-compose run --rm mpc.nodes rm -rf Scripts/hbswap/log/*
clean-mpc-progs:
docker-compose run --rm mpc.compile rm -rf Programs/Bytecode Programs/Schedules Programs/Public-Input
clean-player-data:
docker-compose run --rm mpc.trusted.setup rm -rf Player-Data/*
clean-local-files:
find . -name "*.pyc" -exec rm -f {} \;
find . -name "*~" -exec rm -f {} \;
#down: down-init
down:
docker-compose -f docker-compose.yml -f liquidity-provider.yml -f trader.yml down --remove-orphans
stop:
docker-compose stop ethnode mpc.nodes
rm: clean
#docker-compose rm --stop --force ethnode contract.deploycontract.deposit
docker-compose rm --stop --force -v
docker volume rm \
hbswap_public-keys \
hbswap_secrets-p0 \
hbswap_secrets-p1 \
hbswap_secrets-p2 \
hbswap_secrets-p3
init-eth:
docker-compose up -d ethnode
docker-compose up contract.deploy
docker-compose up pool.init
docker-compose up client.deposit
simulation: down mpc-compile
docker-compose up --detach ethnode
docker-compose up deploycontract
# MPC Network -- could be deployed to a cloud provider
docker-compose up --detach \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3
# client operations -- could be done by UI
docker-compose --file docker-compose.yml --file liquidity-provider.yml up init.pool
docker-compose --file docker-compose.yml --file trader.yml up public.deposit
docker-compose --file docker-compose.yml --file trader.yml up secret.deposit
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
docker-compose --file docker-compose.yml --file trader.yml up trade-1
docker-compose --file docker-compose.yml --file trader.yml up trade-2
start-hbswap:
docker-compose up -d ethnode
docker-compose up deploycontract
docker-compose up -d \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3
#sh scripts/follow-sim-logs-with-tmux.sh
public-deposit:
docker-compose -f docker-compose.yml -f trader.yml up public.deposit
init-secrets:
docker-compose -f docker-compose.yml -f liquidity-provider.yml up init.pool
docker-compose -f docker-compose.yml -f trader.yml up secret.deposit
trade-1:
docker-compose -f docker-compose.yml -f trader.yml up trade-1
trade-2:
docker-compose -f docker-compose.yml -f trader.yml up trade-2
up-eth:
docker-compose up -d ethnode
deploycontract: up-eth
docker-compose -f docker-compose.yml -f eth.yml up contract.deploy
lp-init-pool:
docker-compose -f docker-compose.yml -f liquidity-provider.yml up pool.init
trader-deposit:
docker-compose -f docker-compose.yml -f trader.yml up client.deposit
mpc-keys:
docker-compose up mpc.trusted.setup
mpc-compile:
docker-compose up mpc.compile
mpc-init-pool: mpc-keys mpc-compile
docker-compose up \
mpc.init.node.0 \
mpc.init.node.1 \
mpc.init.node.2 \
mpc.init.node.3
mpc:
docker-compose up -d \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3
run-client:
docker-compose up client
#up: ## run the example
up: down rm mpc-keys mpc-compile mpc-init-pool ## run the example
docker-compose up -d ethnode
docker-compose up contract.deploy
docker-compose up contract.deposit
docker-compose up -d mpcnode0 mpcnode1 mpcnode2 mpcnode3
docker-compose up -d client
sh scripts/follow-sim-logs-with-tmux.sh
down-init:
docker-compose -f hbswap-init.yml down --remove-orphans
rm-init: clean
docker-compose -f hbswap-init.yml rm --stop --force mpc.trusted.setup mpc.compile mpcnode0 mpcnode1 mpcnode2 mpcnode3
#docker-compose -f hbswap-init.yml rm --stop --force mpc.trusted.setup mpc.compile mpc.allnodes
up-init: down-init rm-init
docker-compose -f hbswap-init.yml up mpc.trusted.setup mpc.compile
docker-compose -f hbswap-init.yml up mpcnode0 mpcnode1 mpcnode2 mpcnode3
#docker-compose -f hbswap-init.yml up mpc.allnodes
build-mpcnode0:
docker-compose -f docker-compose-testnet.yml build mpcnode0
testnet-build: down build-mpcnode0 mpc-compile
docker-compose -f docker-compose-testnet.yml up --detach \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3
down-testnet:
docker-compose -f docker-compose-testnet.yml down --remove-orphans
testnet: down-testnet
docker-compose -f docker-compose-testnet.yml up --detach \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3
testnet-compile: down mpc-compile
docker-compose -f docker-compose-testnet.yml up --detach \
mpcnode0 \
mpcnode1 \
mpcnode2 \
mpcnode3