Skip to content

Commit

Permalink
updated to Hyperledger Composer V0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Dill committed Nov 10, 2017
1 parent 76486a3 commit bbe80b5
Show file tree
Hide file tree
Showing 132 changed files with 1,935 additions and 739 deletions.
17 changes: 17 additions & 0 deletions Chapter03/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,20 @@ If github is new to you, please use the following process:
- press the enter key.

This will make a local copy of the tutorial on your computer and, because you cloned from your personal copy of the tutorial, will allow you to save your work up to github.com and, if you choose, share your work with others.
# Check out the network

- Open a Terminal Window and change to Chapter03
- Issue the command ```buildAndDeploy``` and press enter, which will create a file called zerotoblockchain-network.bna in the Chapter03/network/dist folder.
- Open HyperLedger Composer [Playground](https://composer-playground.mybluemix.net) and then click on the web page to select the option to use your own business network
- You may get the following message. If so, congrats! You've used playground before. Click on ```Clear local Storage```
![Invalid Storage](../assets/IBMCloud_playground_invalid.png)
- You may see this message. If so, click on ```Let's Blockchain!```
![Let's Blockchain!](../assets/IBMCloud_playground_lets.png)
- You should then see this page. Click on the right hand icon - deploy a new business network
![Deploy new network](../assets/IBMCloud_playground_deploy1.png)
- which takes you to this page:
![Drag your file here](../assets/IBMCloud_playground_drag.png)
- navigate in Finder (OSX) or the Ubuntu File Explorer to Chapter03/network/dist
- and then drag the ```zerotoblockchain-network.bna``` file to the highlighted icon in the playground
- The right hand side of the screen will now activate. Press the ```Deploy``` button
![Deploy](../assets/IBMCloud_playground_deploy2.png)
Binary file modified Chapter03/README.pdf
Binary file not shown.
15 changes: 13 additions & 2 deletions Chapter03/deployNetwork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,16 @@ echo "Parameters:"
echo -e "Network Name is: ${GREEN} $NETWORK_NAME ${RESET}" | indent

showStep "deploying network"
cd network/dist
composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -i PeerAdmin -s randomString
# original - V0.13
# cd network/dist
# composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -i PeerAdmin -s randomString
#
# what the documentation implies is required
# cd network/dist
# composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -A admin -S adminpw -i PeerAdmin -s randomString
#
# what really works
composer identity request -p hlfv1 -i admin -s adminpw
composer identity import -p hlfv1 -u admin -c ~/.identityCredentials/admin-pub.pem -k ~/.identityCredentials/admin-priv.pem
cd network/dist
composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -A admin -S adminpw -i PeerAdmin -s randomString
14 changes: 7 additions & 7 deletions Chapter03/network/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"engines": {
"composer": "^0.10.0"
"composer": ""
},
"name": "zerotoblockchain-network",
"version": "0.1.6",
"version": "0.1.5",
"description": "Zero to Blockchain tutorial network",
"networkImage": "https://hyperledger.github.io/composer-sample-networks/packages/basic-sample-network/networkimage.svg",
"networkImageanimated": "https://hyperledger.github.io/composer-sample-networks/packages/basic-sample-network/networkimageanimated.svg",
Expand Down Expand Up @@ -36,11 +36,11 @@
"browserfs": "^1.2.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"composer-admin": "^0.9.0",
"composer-cli": "^0.9.0",
"composer-client": "^0.9.0",
"composer-connector-embedded": "^0.9.0",
"composer-cucumber-steps": "^0.9.0",
"composer-admin": "^0.14.0",
"composer-cli": "^0.14.0",
"composer-client": "^0.14.0",
"composer-connector-embedded": "^0.14.0",
"composer-cucumber-steps": "^0.14.0",
"cucumber": "^2.2.0",
"eslint": "^3.6.1",
"istanbul": "^0.4.5",
Expand Down
20 changes: 20 additions & 0 deletions Chapter03/network/permissions.acl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,24 @@ rule Default {
operation: ALL
resource: "org.acme.Z2BTestNetwork.*"
action: ALLOW
}
/**
* Added to support V0.14 breaking changes
*
*/

rule NetworkAdminUser {
description: "Grant business network administrators full access to user resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "**"
action: ALLOW
}

rule NetworkAdminSystem {
description: "Grant business network administrators full access to system resources"
participant: "org.hyperledger.composer.system.NetworkAdmin"
operation: ALL
resource: "org.hyperledger.composer.system.**"
action: ALLOW
}
33 changes: 6 additions & 27 deletions Chapter03/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"engines": {
"composer": ""
"composer": "^0.10.0"
},
"name": "zerotoblockchain-network",
"version": "0.1.6",
Expand Down Expand Up @@ -33,31 +33,15 @@
"author": "Bob Dill, IBM Distinguished Engineer",
"license": "Apache-2.0",
"devDependencies": {
"http": "",
"https": "",
"fs": "",
"mime": "",
"path": "",
"body-parser": "",
"cfenv": "",
"cookie-parser": "",
"express-session": "",
"vcap_services": "",
"uuid": "",
"connect-busboy": "",
"ejs": "",
"date-format": "",
"extend": "",
"browserfs": "^1.2.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"composer-admin": "",
"composer-cli": "",
"composer-client": "",
"composer-admin": "^0.14.0",
"composer-cli": "^0.14.0",
"composer-client": "^0.14.0",
"composer-common": "",
"composer-connector-embedded": "",
"composer-connector-hlf": "",
"composer-cucumber-steps": "",
"composer-connector-embedded": "^0.14.0",
"composer-cucumber-steps": "^0.14.0",
"cucumber": "^2.2.0",
"eslint": "^3.6.1",
"istanbul": "^0.4.5",
Expand Down Expand Up @@ -99,10 +83,5 @@
"branches": 100,
"functions": 100,
"lines": 100
},
"dependencies": {
"express": "^4.15.4",
"http": "0.0.0",
"sleep": "^5.1.1"
}
}
5 changes: 4 additions & 1 deletion Chapter03/start_rest_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ echo -e "Network Name is: ${GREEN} $NETWORK_NAME ${RESET}" | indent


showStep "testing rest server \n when this completes, \n go to your favorite browser \n and enter localhost:3000/explorer "
composer-rest-server -p hlfv1 -n $NETWORK_NAME -i PeerAdmin -s randomString
# original (pre V0.14)
# composer-rest-server -p hlfv1 -n $NETWORK_NAME -i PeerAdmin -s randomString
# V0.14
composer-rest-server -p hlfv1 -n zerotoblockchain-network -i admin -s adminPW
Loading

0 comments on commit bbe80b5

Please sign in to comment.