-
Notifications
You must be signed in to change notification settings - Fork 13
/
demo3.yaml
261 lines (239 loc) · 7.54 KB
/
demo3.yaml
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------------
version: '3.6'
volumes:
cargo-registry1:
cargo-registry2:
cargo-registry3:
keys:
services:
validator-1:
image: sawtooth-poet2-validator:latest
build:
context: .
dockerfile: poet2-validator.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
expose:
- 4004
- 8800
- 5050
volumes:
- keys:/shared_keys
# start the validator with an empty genesis batch
working_dir: /root
command: "bash -c \"\
sawadm keygen validator-2 && \
sawadm keygen validator-3 && \
sawadm keygen && \
sawset genesis \
-k /etc/sawtooth/keys/validator.priv \
-o config-genesis.batch && \
sawset proposal create \
-k /etc/sawtooth/keys/validator.priv \
sawtooth.consensus.algorithm=poet2 \
sawtooth.poet.block_claim_delay=0 \
-o config.batch && \
sawadm genesis \
config-genesis.batch config.batch && \
mv /etc/sawtooth/keys/validator-* /shared_keys && \
echo $$(cat /etc/sawtooth/keys/validator.pub); \
sawtooth-validator -v \
--endpoint tcp://validator-1:8800 \
--bind component:tcp://eth0:4004 \
--bind network:tcp://eth0:8800 \
--bind consensus:tcp://eth0:5050 \
--peering static \
--peers tcp://validator-2:8800
--peers tcp://validator-3:8800
--scheduler parallel \
\""
stop_signal: SIGKILL
validator-2:
image: sawtooth-poet2-validator:latest
build:
context: .
dockerfile: poet2-validator.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
expose:
- 4004
- 8800
- 5050
volumes:
- keys:/shared_keys
# start the validator with an empty genesis batch
working_dir: /root
command: "bash -c \"\
while true; do if [ -e /shared_keys/validator-2.pub ]; then mv /shared_keys/validator-2.priv /etc/sawtooth/keys/validator.priv && mv /shared_keys/validator-2.pub /etc/sawtooth/keys/validator.pub; break; fi; sleep 0.5; done; \
echo $$(cat /etc/sawtooth/keys/validator.pub); \
sawtooth-validator -v \
--endpoint tcp://validator-2:8800 \
--bind component:tcp://eth0:4004 \
--bind network:tcp://eth0:8800 \
--bind consensus:tcp://eth0:5050 \
--peering static \
--peers tcp://validator-1:8800
--peers tcp://validator-3:8800
--scheduler parallel \
\""
stop_signal: SIGKILL
validator-3:
image: sawtooth-poet2-validator:latest
build:
context: .
dockerfile: poet2-validator.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
expose:
- 4004
- 8800
- 5050
volumes:
- keys:/shared_keys
# start the validator with an empty genesis batch
working_dir: /root
command: "bash -c \"\
while true; do if [ -e /shared_keys/validator-3.pub ]; then mv /shared_keys/validator-3.priv /etc/sawtooth/keys/validator.priv && mv /shared_keys/validator-3.pub /etc/sawtooth/keys/validator.pub; break; fi; sleep 0.5; done; \
echo $$(cat /etc/sawtooth/keys/validator.pub); \
sawtooth-validator -v \
--endpoint tcp://validator-3:8800 \
--bind component:tcp://eth0:4004 \
--bind network:tcp://eth0:8800 \
--bind consensus:tcp://eth0:5050 \
--peering static \
--peers tcp://validator-1:8800
--peers tcp://validator-2:8800
--scheduler parallel \
\""
stop_signal: SIGKILL
poet-2-engine-1:
build:
context: .
dockerfile: poet2-engine.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
volumes:
- ./:/project/sawtooth-poet2
- cargo-registry1:/root/.cargo/registry
working_dir: '/project/sawtooth-poet2/src/core'
depends_on:
- validator-1
entrypoint: "bash -c \"\
RUST_BACKTRACE=1 cargo run --bin poet2 -- -C tcp://validator-1:5050 -v \""
stop_signal: SIGKILL
poet-2-engine-2:
build:
context: .
dockerfile: poet2-engine.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
volumes:
- ./:/project/sawtooth-poet2
- cargo-registry2:/root/.cargo/registry
working_dir: '/project/sawtooth-poet2/src/core'
depends_on:
- validator-2
entrypoint: "bash -c \"\
RUST_BACKTRACE=1 cargo run --bin poet2 -- -C tcp://validator-2:5050 -v \""
stop_signal: SIGKILL
poet-2-engine-3:
build:
context: .
dockerfile: poet2-engine.dockerfile
args:
- http_proxy
- https_proxy
- no_proxy
volumes:
- ./:/project/sawtooth-poet2
- cargo-registry3:/root/.cargo/registry
working_dir: '/project/sawtooth-poet2/src/core'
depends_on:
- validator-3
entrypoint: "bash -c \"\
RUST_BACKTRACE=1 cargo run --bin poet2 -- -C tcp://validator-3:5050 -v \""
stop_signal: SIGKILL
rest-api-1:
image: hyperledger/sawtooth-rest-api:latest
expose:
- "8008"
depends_on:
- validator-1
entrypoint: sawtooth-rest-api -C tcp://validator-1:4004 --bind rest-api-1:8008
rest-api-2:
image: hyperledger/sawtooth-rest-api:latest
expose:
- "8008"
depends_on:
- validator-2
entrypoint: sawtooth-rest-api -C tcp://validator-2:4004 --bind rest-api-2:8008
rest-api-3:
image: hyperledger/sawtooth-rest-api:latest
expose:
- "8008"
depends_on:
- validator-3
entrypoint: sawtooth-rest-api -C tcp://validator-3:4004 --bind rest-api-3:8008
settings-tp-1:
image: hyperledger/sawtooth-settings-tp:latest
depends_on:
- validator-1
entrypoint: settings-tp -vv -C tcp://validator-1:4004
settings-tp-2:
image: hyperledger/sawtooth-settings-tp:latest
depends_on:
- validator-2
entrypoint: settings-tp -vv -C tcp://validator-2:4004
settings-tp-3:
image: hyperledger/sawtooth-settings-tp:latest
depends_on:
- validator-3
entrypoint: settings-tp -vv -C tcp://validator-3:4004
intkey-tp-python-1:
image: hyperledger/sawtooth-intkey-tp-python:latest
depends_on:
- validator-1
entrypoint: intkey-tp-python -vv -C tcp://validator-1:4004
intkey-tp-python-2:
image: hyperledger/sawtooth-intkey-tp-python:latest
depends_on:
- validator-2
entrypoint: intkey-tp-python -vv -C tcp://validator-2:4004
intkey-tp-python-3:
image: hyperledger/sawtooth-intkey-tp-python:latest
depends_on:
- validator-3
entrypoint: intkey-tp-python -vv -C tcp://validator-3:4004
shell:
image: hyperledger/sawtooth-all:latest
container_name: sawtooth-shell-default
depends_on:
- rest-api-1
- rest-api-2
entrypoint: "bash -c \"\
sawtooth keygen && \
tail -f /dev/null \
\""