This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.sabre.yaml
163 lines (152 loc) · 4.95 KB
/
docker-compose.sabre.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
version: "3"
volumes:
consensource-shared-data:
services:
consensource-contract-builder:
image: consensource-contract-builder
container_name: consensource-contract-builder
build:
context: .
dockerfile: processor/Dockerfile.sabre
volumes:
- consensource-shared-data:/shared_data
entrypoint: |
bash -c "
while true; do curl -s http://sawtooth-rest-api:8008/state | grep -q head; if [ $$? -eq 0 ]; then break; fi; sleep 0.5; done;
sabre cr --create consensource --key /shared_data/my_key --owner $$(cat /shared_data/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre upload --filename /build/processor/consensource.yaml --key /shared_data/my_key --url http://sawtooth-rest-api:8008 --wait 30
sabre ns --create 3d0111 --key /shared_data/my_key --owner $$(cat /shared_data/my_key.pub) --url http://sawtooth-rest-api:8008 --wait 30
sabre perm 3d0111 consensource --key /shared_data/my_key --read --write --url http://sawtooth-rest-api:8008 --wait 30
echo '---------========= consensource contract is loaded =========---------'
"
cli:
image: target/consensource-cli:latest
container_name: consensource-cli
volumes:
- consensource-shared-data:/shared_data
entrypoint: |
bash -c "
if [ ! -f $HOME/.sawtooth/keys/root.priv ]; then
sawtooth keygen
fi;
mkdir -p /shared_data/keys && \
csrc genesis -o /shared_data/consensource-genesis.batch -K /shared_data/keys \
-g /cli/example-genesis.yaml;
tail -f /dev/null
"
## Because the published client image is built with non-local config,
## we default to using the local client image which has the config to
## for our local services.
client:
image: target/consensource-ui:local
container_name: consensource-client
build:
context: ui
volumes:
- ./client/public/:/usr/local/apache2/htdocs/
expose:
- 80
ports:
- "8080:80"
consensus-engine:
image: hyperledger/sawtooth-devmode-engine-rust:chime
container_name: consensource-consensus-engine
expose:
- 5050
ports:
- "5050:5050"
command: |
bash -c "
devmode-engine-rust -C tcp://validator:5050
"
validator:
image: hyperledger/sawtooth-validator:chime
container_name: consensource-validator
expose:
- 4004
- 8800
ports:
- "4004:4004"
- "8800:8800"
volumes:
- consensource-shared-data:/shared_data
entrypoint: |
bash -c "
sawadm keygen && \
sawtooth keygen my_key && \
sawset genesis -k /root/.sawtooth/keys/my_key.priv && \
cp /root/.sawtooth/keys/my_key.* /shared_data && \
sawset proposal create \
-k /root/.sawtooth/keys/my_key.priv \
sawtooth.swa.administrators=$$(cat /shared_data/my_key.pub) \
sawtooth.consensus.algorithm.name=Devmode \
sawtooth.consensus.algorithm.version=0.1 \
-o config.batch \
&& sawadm genesis config-genesis.batch config.batch && \
sawtooth-validator -v \
--endpoint tcp://eth0:8800 \
--bind component:tcp://eth0:4004 \
--bind network:tcp://eth0:8800 \
--bind consensus:tcp://eth0:5050 \
"
sawtooth-rest-api:
image: hyperledger/sawtooth-rest-api:chime
container_name: sawtooth-rest-api
ports:
- "8008:8008"
depends_on:
- validator
entrypoint: sawtooth-rest-api -v -C tcp://validator:4004 --bind sawtooth-rest-api:8008
api:
image: target/consensource-api:latest
container_name: consensource-api
ports:
- "9009:9009"
- "9010:9010"
environment:
ROCKET_ADDRESS: "0.0.0.0"
ROCKET_PORT: "9009"
OAUTH_VALIDATION_URL: "https://oauth.iam.perf.target.com"
command: |
bash -c "
consensource-rest-api -v --dbhost postgres -C tcp://validator:4004
"
settings-tp:
image: hyperledger/sawtooth-settings-tp:chime
container_name: sawtooth-settings-tp
depends_on:
- validator
entrypoint: settings-tp -v -C tcp://validator:4004
sabre-tp:
image: hyperledger/sawtooth-sabre-tp:0.4
container_name: sawtooth-sabre-tp
depends_on:
- validator
entrypoint: sawtooth-sabre -vv --connect tcp://validator:4004
postgres:
image: postgres:alpine
container_name: consensource-db
volumes:
- ./database/tables:/docker-entrypoint-initdb.d
restart: always
environment:
POSTGRES_USER: consensourcedb
POSTGRES_PASSWORD: consensourcedb
POSTGRES_DB: consensourcedb
ports:
- "5432:5432"
expose:
- 5432
adminer:
image: adminer
container_name: consensource-adminer
restart: always
ports:
- "8081:8080"
sds:
image: target/consensource-sds:latest
container_name: consensource-sds
command: |
bash -c "
consensource-sds --dbhost postgres -v -C tcp://validator:4004
"