-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
160 lines (153 loc) · 4.05 KB
/
docker-compose.yml
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
version: "3"
services:
## local eos node
nodeos:
container_name: server
image: nodeos
build:
context: ./services/nodeos
command:
- nodeos
- -e
- -p
- eosio
- --http-server-address
- "0.0.0.0:8888"
- --plugin
- eosio::producer_plugin
- --plugin
- eosio::chain_api_plugin
- --plugin
- eosio::http_plugin
- --plugin
- eosio::state_history_plugin
- --access-control-allow-origin='*'
- --contracts-console
- --http-validate-host=false
- --trace-history
- --chain-state-history
- --verbose-http-errors
- --filter-on='*'
- --disable-replay-opts
ports:
- 8888:8888
## setup accounts and deploy contract
init:
image: nodeos
build:
context: ./services/nodeos
command:
- /bin/bash
- -c
- |
rm -fr ~/eosio-wallet
# create the wallet
cleos wallet create --to-console
cleos wallet import --private-key $$EOS_PRIVATE
cleos wallet import --private-key 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 #default eosio account private key
# create master account (if needed)
cleos -u $$EOS_API get account master || cleos -u $$EOS_API create account eosio master $$EOS_PUBLIC
# create then contract account (if needed)
cleos -u $$EOS_API get account $$EOS_CONTRACT_ACCOUNT || cleos -u $$EOS_API create account eosio $$EOS_CONTRACT_ACCOUNT $$EOS_PUBLIC
# build the contract
eosio-cpp -abigen -o iryo.wasm iryo.cpp
# deploy the contract
cleos -u $$EOS_API set contract $$EOS_CONTRACT_ACCOUNT . iryo.wasm iryo.abi
volumes:
- ./contract:/contract
working_dir: /contract
environment:
- EOS_API=${EOS_NODE} # url on which nodeos is running
- EOS_PRIVATE=${EOS_PRIVATE_KEY} # key used to sign master account
- EOS_PUBLIC=${EOS_PUBLIC_KEY} # key used to create master account (public key of $EOS_PRIVATE)
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT} # account
tty: true
depends_on:
- nodeos
## api server
api:
image: golang:1.12-alpine
command:
- /iryo/api
volumes:
- ./.bin:/iryo
- ./.data:/data
working_dir: /go/src/github.com/iryonetwork/network-poc/cmd/api
environment:
- IRYO_ADDR=0.0.0.0:8000
- EOS_API=${EOS_NODE}
- EOS_ACCOUNT=${EOS_ACCOUNT}
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT}
- EOS_TOKEN_ACCOUNT=iryo.token
- EOS_PRIVATE=${EOS_PRIVATE_KEY} # key used to sign master account
- EOS_ACCOUNT_FORMAT=${EOS_ACCOUNT_FORMAT} # key used to sign master account
- EOS_REQUIRES_RAM=${EOS_REQUIRES_RAM}
- DEBUG=1
ports:
- 8000:8000
## patient server #1
patient1:
image: golang:1.12-alpine
command:
- /iryo/patient1
volumes:
- ./.bin:/iryo
environment:
- IRYO_ADDR=${IRYO_ADDR}
- EOS_API=${EOS_NODE}
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT}
- CLIENT_ADDR=0.0.0.0:9000
- DEBUG=1
- CLIENT_TYPE=Patient
ports:
- 9001:9000
## patient server #2
patient2:
image: golang:1.12-alpine
command:
- /iryo/patient2
volumes:
- ./.bin:/iryo
environment:
- IRYO_ADDR=${IRYO_ADDR}
- EOS_API=${EOS_NODE}
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT}
- CLIENT_ADDR=0.0.0.0:9000
- DEBUG=1
- CLIENT_TYPE=Patient
ports:
- 9002:9000
## doctor server #1
doctor1:
image: golang:1.12-alpine
command:
- /iryo/doctor1
volumes:
- ./.bin:/iryo
environment:
- EOS_API=${EOS_NODE}
- IRYO_ADDR=${IRYO_ADDR}
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT}
- CLIENT_ADDR=0.0.0.0:9000
- DEBUG=1
- CLIENT_TYPE=Doctor
ports:
- 9003:9000
## doctor server #2
doctor2:
image: golang:1.12-alpine
command:
- /iryo/doctor2
volumes:
- ./.bin:/iryo
environment:
- EOS_API=${EOS_NODE}
- IRYO_ADDR=${IRYO_ADDR}
- EOS_CONTRACT_ACCOUNT=${EOS_CONTRACT_ACCOUNT}
- CLIENT_ADDR=0.0.0.0:9000
- DEBUG=1
- CLIENT_TYPE=Doctor
ports:
- 9004:9000
volumes:
devchain: