Skip to content

Commit 445ccbc

Browse files
Simon Stonedenyeart
authored andcommitted
[FAB-12880] Move old prog model samples for FabCar
Move the old programming model samples for FabCar, including the "node" (JavaScript!) chaincode sample and the JavaScript application in the top level into new subdirectories called "javascript-low-level". We still want to keep these samples around for comparision purposes, but most new developers should be using the new samples built using the new programming model. At the same time, update the startFabric.sh script to output correct help information on how to run the applications built using the new programming model after starting the Fabric network and deploying the chaincode. Change-Id: I1e3701737f105cba67f661bf893771ac8a3a0373 Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
1 parent 5270248 commit 445ccbc

File tree

8 files changed

+56
-5
lines changed

8 files changed

+56
-5
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

fabcar/startFabric.sh

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,59 @@ docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/g
5050
sleep 10
5151
docker exec -e "CORE_PEER_LOCALMSPID=Org1MSP" -e "CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp" cli peer chaincode invoke -o orderer.example.com:7050 -C mychannel -n fabcar -c '{"function":"initLedger","Args":[]}'
5252

53-
printf "\nTotal setup execution time : $(($(date +%s) - starttime)) secs ...\n\n\n"
54-
printf "Start by installing required packages run 'npm install'\n"
55-
printf "Then run 'node enrollAdmin.js', then 'node registerUser'\n\n"
56-
printf "The 'node invoke.js' will fail until it has been updated with valid arguments\n"
57-
printf "The 'node query.js' may be run at anytime once the user has been registered\n\n"
53+
cat <<EOF
54+
55+
Total setup execution time : $(($(date +%s) - starttime)) secs ...
56+
57+
Next, use the FabCar applications to interact with the deployed FabCar contract.
58+
The FabCar applications are available in multiple programming languages.
59+
Follow the instructions for the programming language of your choice:
60+
61+
JavaScript:
62+
63+
Start by changing into the "javascript" directory:
64+
cd javascript
65+
66+
Next, install all required packages:
67+
npm install
68+
69+
Then run the following applications to enroll the admin user, and register a new user
70+
called user1 which will be used by the other applications to interact with the deployed
71+
FabCar contract:
72+
node enrollAdmin
73+
node registerUser
74+
75+
You can run the invoke application as follows. By default, the invoke application will
76+
create a new car, but you can update the application to submit other transactions:
77+
node invoke
78+
79+
You can run the query application as follows. By default, the query application will
80+
return all cars, but you can update the application to evaluate other transactions:
81+
node query
82+
83+
TypeScript:
84+
85+
Start by changing into the "typescript" directory:
86+
cd typescript
87+
88+
Next, install all required packages:
89+
npm install
90+
91+
Next, compile the TypeScript code into JavaScript:
92+
npm run build
93+
94+
Then run the following applications to enroll the admin user, and register a new user
95+
called user1 which will be used by the other applications to interact with the deployed
96+
FabCar contract:
97+
node dist/enrollAdmin
98+
node dist/registerUser
99+
100+
You can run the invoke application as follows. By default, the invoke application will
101+
create a new car, but you can update the application to submit other transactions:
102+
node dist/invoke
103+
104+
You can run the query application as follows. By default, the query application will
105+
return all cars, but you can update the application to evaluate other transactions:
106+
node dist/query
107+
108+
EOF

0 commit comments

Comments
 (0)