-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun-org-deployment.sh
executable file
·46 lines (37 loc) · 1.25 KB
/
run-org-deployment.sh
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
#!/usr/bin/env bash
./consortium-add-org.sh org1
./channel-create.sh common
./channel-join.sh common
./chaincode-install.sh example02 1.0 chaincode_example02 golang
./chaincode-instantiate.sh common example02 '["init","a","10","b","0"]'
# Call chaincode functions via the Fabric command line
# sleep 2
./chaincode-query.sh common example02 '["query","a"]'
# sleep 2
./chaincode-invoke.sh common example02 '["move","a","b","1"]'
# sleep 2
./chaincode-query.sh common example02 '["query","a"]'
# # Call chaincode functions via the API server
# JWT=`(curl -d '{"username":"user","password":"pass","attrs":"[]"}' \
# --header "Content-Type: application/json" \
# http://localhost:4000/users | tr -d '"')`
# printf "\n\n"
# # sleep 2
# printf " -- /query\n"
# curl -H "Authorization: Bearer $JWT" \
# -H "Content-Type: application/json" \
# 'http://localhost:4000/query/a'
# printf "\n\n"
# # sleep 2
# printf " -- /move\n"
# curl -H "Authorization: Bearer $JWT" \
# -H "Content-Type: application/json" \
# -d '["a","b","1"]' \
# 'http://localhost:4000/move'
# printf "\n\n"
# # sleep 2
# printf " -- /query\n"
# curl -H "Authorization: Bearer $JWT" \
# -H "Content-Type: application/json" \
# 'http://localhost:4000/query/a'
# printf "\n\n"