-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
206 lines (195 loc) · 8.12 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
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
version: "3.7"
volumes:
orderer.example.com:
peer0.org1.example.com:
services:
bal-ganache:
build:
context: ./bal
target: bal-ethereum
restart: always
container_name: bal-ganache
ports:
- "8081:8080"
networks:
case-study:
ipv4_address: 172.16.238.10
bal-fabric:
build:
context: ./bal
target: bal-fabric
restart: always
container_name: bal-fabric
ports:
- "8082:8080"
networks:
case-study:
ipv4_address: 172.16.238.11
ganache-with-truffle:
container_name: ganache-with-truffle
build:
context: ./ganache-cli
target: ganache
command: ["ganache-cli", "-m", "smart contract composition", "--defaultBalanceEther", "100000000", "-l", "471238800", "-g", "1", "-v", "--keepAliveTimeout", "15000", "-b", "3"]
ports:
- "8545:8545"
networks:
case-study:
ipv4_address: 172.16.238.12
orderer.example.com:
container_name: orderer.example.com
image: hyperledger/fabric-orderer:1.4
environment:
- FABRIC_LOGGING_SPEC=DEBUG
- GRPC_TRACE=all=true,
- GRPC_VERBOSITY=debug
- ORDERER_GENERAL_LOGLEVEL=DEBUG
- ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
- ORDERER_GENERAL_LISTENPORT=7050
- ORDERER_GENERAL_GENESISMETHOD=file
- ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block
- ORDERER_GENERAL_LOCALMSPID=OrdererMSP
- ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp
# enabled TLS
- ORDERER_GENERAL_TLS_ENABLED=true
- ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
- ORDERER_KAFKA_TOPIC_REPLICATIONFACTOR=1
- ORDERER_KAFKA_VERBOSE=true
- ORDERER_GENERAL_CLUSTER_CLIENTCERTIFICATE=/var/hyperledger/orderer/tls/server.crt
- ORDERER_GENERAL_CLUSTER_CLIENTPRIVATEKEY=/var/hyperledger/orderer/tls/server.key
- ORDERER_GENERAL_CLUSTER_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt]
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: orderer
volumes:
- ./fabric/channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block
- ./fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp
- ./fabric/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls
- orderer.example.com:/var/hyperledger/production/orderer
ports:
- 7050:7050
networks:
case-study:
ipv4_address: 172.16.238.13
peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer:1.4
environment:
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
# the following setting starts chaincode containers on the same
# bridge network as the peers
# https://docs.docker.com/compose/networking/
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=bal_case-study
- FABRIC_LOGGING_SPEC=DEBUG
- CORE_LOGGING_LEVEL=DEBUG
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt
# combine inherited properties as extend is not supported in v3+
- CORE_PEER_ID=peer0.org1.example.com
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_CHAINCODEADDRESS=peer0.org1.example.com:7052
- CORE_PEER_CHAINCODELISTENADDRESS=0.0.0.0:7052
- CORE_PEER_LOCALMSPID=Org1MSP
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
command: peer node start
volumes:
- /var/run/:/host/var/run/
- ./fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp
- ./fabric/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls
- peer0.org1.example.com:/var/hyperledger/production
ports:
- 7051:7051
networks:
case-study:
ipv4_address: 172.16.238.14
ca0:
image: hyperledger/fabric-ca:1.4
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca-org1
- FABRIC_CA_SERVER_TLS_ENABLED=true
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/2b7b5fcae2a6f9d736d77c8b625094031dd5b51d2078edd1ec1c5df6cea8b246_sk
- FABRIC_CA_SERVER_PORT=7054
ports:
- "7054:7054"
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/2b7b5fcae2a6f9d736d77c8b625094031dd5b51d2078edd1ec1c5df6cea8b246_sk -b admin:adminpw -d'
volumes:
- ./fabric/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
container_name: ca_peerOrg1
networks:
case-study:
ipv4_address: 172.16.238.16
cli:
container_name: cli
image: hyperledger/fabric-tools:1.4
tty: true
stdin_open: true
environment:
- SYS_CHANNEL=bal-sys-channel
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
#- FABRIC_LOGGING_SPEC=DEBUG
- FABRIC_LOGGING_SPEC=INFO
- CORE_PEER_ID=cli
- CORE_PEER_ADDRESS=peer0.org1.example.com:7051
- CORE_PEER_CHAINCODELISTENADDRESS=peer0.org1.com:7052
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.crt
- CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/server.key
- CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
- CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/[email protected]/msp
working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer
# run script for registering and joining the channel + run test chaincode commands
command: /bin/bash
volumes:
- /var/run/:/host/var/run/
- ../SmartContracts/Fabric:/opt/gopath/src/github.com/chaincode
- ./fabric/crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/
- ./fabric/scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/
- ./fabric/channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
depends_on:
- orderer.example.com
- peer0.org1.example.com
- ca0
networks:
case-study:
ipv4_address: 172.16.238.15
case-study-backend:
build:
context: ./client-app/backend
restart: always
container_name: case-study-backend
ports:
- "8080:8080"
environment:
- CLIENT_CALLBACK_URL=http://case-study-backend:8080
- DAIRY_BAL_URL=http://172.16.238.11:8080/blockchain-access-layer
- DAIRY_SC_ADDRESS=mychannel/dairy
- SEAFOOD_BAL_URL=http://172.16.238.10:8080/blockchain-access-layer
- SEAFOOD_SC_ADDRESS=0x75f17644EAEb3cC6511764a6F1138F14B3e33D0f
networks:
case-study:
ipv4_address: 172.16.238.17
case-study-frontend:
build:
context: ./client-app/frontend
restart: always
container_name: case-study-frontend
ports:
- "4200:80"
networks:
case-study:
ipv4_address: 172.16.238.18
networks:
case-study:
ipam:
driver: default
config:
- subnet: "172.16.238.0/24"