Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 515b257

Browse files
awjh-ibmmbwhite
authored andcommitted
uppdated for v0.19.x composer (#135)
Signed-off-by: awjh-ibm <[email protected]>
1 parent 6202123 commit 515b257

File tree

6 files changed

+74
-359
lines changed

6 files changed

+74
-359
lines changed

packages/vehicle-manufacture/installers/hlfv1/build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,29 @@ ROOT=$DIR/../..
1818
cd $ROOT
1919
npm install
2020

21+
NETWORK_VERSION=$(grep -o '"version": *"[^"]*"' $ROOT/node_modules/vehicle-manufacture-network/package.json | grep -o '[0-9]\.[0-9]\.[0-9]')
22+
2123
cd "${DIR}"
2224
cat install.sh.in | sed \
2325
-e 's/{{COMPOSER-VERSION}}/latest/g' \
2426
-e 's/{{VEHICLE-MANUFACTURE-VERSION}}/latest/g' \
2527
-e 's/{{NODE-RED-VERSION}}/latest/g' \
28+
-e "s/{{NETWORK-VERSION}}/$NETWORK_VERSION/g" \
2629
> install.sh
2730
echo "PAYLOAD:" >> install.sh
2831
tar czf - -C $ROOT/node_modules/vehicle-manufacture-network/dist vehicle-manufacture-network.bna -C $DIR flows.json fabric-dev-servers >> install.sh
2932

3033
cd $ROOT
3134
npm install vehicle-manufacture-network@unstable --no-save
3235

36+
UNSTABLE_NETWORK_VERSION=$(grep -o '"version": *"[^"]*"' $ROOT/node_modules/vehicle-manufacture-network/package.json | grep -o '[0-9]\.[0-9]\.[0-9]')
37+
3338
cd "${DIR}"
3439
cat install.sh.in | sed \
3540
-e 's/{{COMPOSER-VERSION}}/unstable/g' \
3641
-e 's/{{VEHICLE-MANUFACTURE-VERSION}}/unstable/g' \
3742
-e 's/{{NODE-RED-VERSION}}/unstable/g' \
43+
-e "s/{{NETWORK-VERSION}}/$UNSTABLE_NETWORK_VERSION/g" \
3844
> install-unstable.sh
3945
echo "PAYLOAD:" >> install-unstable.sh
4046
tar czf - -C $ROOT/node_modules/vehicle-manufacture-network/dist vehicle-manufacture-network.bna -C $DIR flows.json fabric-dev-servers >> install-unstable.sh

packages/vehicle-manufacture/installers/hlfv1/install.sh.in

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -91,24 +91,61 @@ rm -fr $(pwd)/vldstage
9191
mkdir $(pwd)/vldstage
9292
chmod 777 $(pwd)/vldstage
9393
echo '{
94-
"name": "hlfv1",
95-
"description": "Hyperledger Fabric v1.0",
96-
"type": "hlfv1",
97-
"timeout": 300,
98-
"orderers": [
99-
{
100-
"url": "grpc://orderer.example.com:7050"
101-
}
102-
],
103-
"channel": "composerchannel",
104-
"mspID": "Org1MSP",
105-
"ca": {"url": "http://ca.org1.example.com:7054", "name": "ca.org1.example.com"},
106-
"peers": [
107-
{
108-
"requestURL": "grpc://peer0.org1.example.com:7051",
109-
"eventURL": "grpc://peer0.org1.example.com:7053"
110-
}
111-
]
94+
"name": "hlfv1",
95+
"version": "1.0.0",
96+
"client": {
97+
"organization": "Org1",
98+
"connection": {
99+
"timeout": {
100+
"peer": {
101+
"endorser": "300",
102+
"eventHub": "300",
103+
"eventReg": "300"
104+
},
105+
"orderer": "300"
106+
}
107+
}
108+
},
109+
"orderers": {
110+
"orderer.example.com": {
111+
"url": "grpc://orderer.example.com:7050",
112+
"grpcOptions": {}
113+
}
114+
},
115+
"peers": {
116+
"peer0.org1.example.com": {
117+
"url": "grpc://peer0.org1.example.com:7051",
118+
"eventUrl": "grpc://peer0.org1.example.com:7053",
119+
"grpcOptions": {},
120+
"endorsingPeer": true,
121+
"chaincodeQuery": true,
122+
"ledgerQuery": true,
123+
"eventSource": true
124+
}
125+
},
126+
"channels": {
127+
"composerchannel": {
128+
"orderers": ["orderer.example.com"],
129+
"peers": {
130+
"peer0.org1.example.com": {}
131+
}
132+
}
133+
},
134+
"certificateAuthorities": {
135+
"ca.org1.example.com": {
136+
"url": "http://ca.org1.example.com:7054",
137+
"caName": "ca.org1.example.com"
138+
}
139+
},
140+
"organizations": {
141+
"Org1": {
142+
"mspid": "Org1MSP",
143+
"peers": ["peer0.org1.example.com"],
144+
"certificateAuthorities": ["ca.org1.example.com"]
145+
}
146+
},
147+
"x-type": "hlfv1",
148+
"x-commitTimeout": 100
112149
}' > $(pwd)/vldstage/connection.json
113150

114151
# build the PeerAdmin card and import it
@@ -143,15 +180,25 @@ docker run \
143180
# Wait for playground to start
144181
sleep 5
145182

146-
# Deploy the business network archive.
183+
# Install the business network archive.
147184
docker run \
148185
--rm \
149186
--network composer_default \
150187
-v $(pwd)/vehicle-manufacture-network.bna:/home/composer/vehicle-manufacture-network.bna \
151188
-v $(pwd)/vldstage:/home/composer/vldstage \
152189
-v $(pwd)/.vld-card-store:/home/composer/.composer \
153190
hyperledger/composer-cli:{{COMPOSER-VERSION}} \
154-
network deploy -c PeerAdmin@hlfv1 -a vehicle-manufacture-network.bna -A admin -S adminpw -f /home/composer/vldstage/bnaadmin.card
191+
network install -c PeerAdmin@hlfv1 -a vehicle-manufacture-network.bna
192+
193+
# Start the network
194+
docker run \
195+
--rm \
196+
--network composer_default \
197+
-v $(pwd)/vehicle-manufacture-network.bna:/home/composer/vehicle-manufacture-network.bna \
198+
-v $(pwd)/vldstage:/home/composer/vldstage \
199+
-v $(pwd)/.vld-card-store:/home/composer/.composer \
200+
hyperledger/composer-cli:{{COMPOSER-VERSION}} \
201+
network start -n vehicle-manufacture-network -V {{NETWORK-VERSION}} -c PeerAdmin@hlfv1 -A admin -S adminpw -f /home/composer/vldstage/bnaadmin.card
155202

156203
docker run \
157204
--rm \

packages/vehicle-manufacture/installers/hlfv11/build.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

packages/vehicle-manufacture/installers/hlfv11/flows.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)