-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated full tutorial to hyperledger-composer v0.16
- Loading branch information
Bob Dill
committed
Dec 5, 2017
1 parent
9348f30
commit b628b78
Showing
406 changed files
with
32,763 additions
and
27,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
env: | ||
es6: true | ||
node: true | ||
mocha: true | ||
jquery: true | ||
extends: 'eslint:recommended' | ||
parserOptions: | ||
ecmaVersion: 6 | ||
sourceType: | ||
- script | ||
rules: | ||
indent: | ||
- error | ||
- 4 | ||
linebreak-style: | ||
- error | ||
- unix | ||
quotes: | ||
- error | ||
- single | ||
semi: | ||
- error | ||
- always | ||
no-unused-vars: | ||
- error | ||
- args: none | ||
no-console: off | ||
no-case-declarations: off | ||
curly: error | ||
eqeqeq: error | ||
no-throw-literal: error | ||
strict: error | ||
no-var: error | ||
dot-notation: error | ||
no-tabs: error | ||
no-trailing-spaces: error | ||
no-use-before-define: error | ||
no-useless-call: error | ||
no-with: error | ||
operator-linebreak: error | ||
require-jsdoc: | ||
- error | ||
- require: | ||
ClassDeclaration: true | ||
MethodDefinition: true | ||
FunctionDeclaration: true | ||
valid-jsdoc: | ||
- error | ||
- requireReturn: false | ||
yoda: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
* text eol=lf | ||
|
||
# Explicitly declare text files you want to always be normalized and converted | ||
# to native line endings on checkout. | ||
*.js text | ||
*.css text | ||
*.html text | ||
*.json text | ||
*.sh text | ||
|
||
# Denote all files that are truly binary and should not be modified. | ||
*.png binary | ||
*.jpg binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/bin/bash | ||
|
||
. ../common_OSX.sh | ||
|
||
CHAPTER_DIR="" | ||
DIR="" | ||
REPO_DIR="" | ||
ADMIN_DIR="node_modules/composer-admin" | ||
CLIENT_DIR="node_modules/composer-client" | ||
CLI_DIR="node_modules/composer-cli" | ||
COMMON_DIR="node_modules/composer-common" | ||
HLFV1_DIR="node_modules/composer-connector-hlfv1" | ||
RUNTIME_DIR="node_modules/composer-runtime" | ||
declare -a elements=("${ADMIN_DIR}" "$CLIENT_DIR" "${COMMON_DIR}" "${HLFV1_DIR}" "${RUNTIME_DIR}") | ||
declare -a folders=('Admin' 'Client' 'Common' 'hlfv1' 'Runtime') | ||
|
||
|
||
# get current folder | ||
showStep "getting current directory path" | ||
getCurrent | ||
CHAPTER_DIR=$DIR | ||
showStep "Chapter dir is: ${CHAPTER_DIR}" | ||
for i in "${elements[@]}" | ||
do | ||
# switch to folder | ||
showStep "Changing to ${i}" | ||
cd "${i}" | ||
pwd | ||
# generate docs | ||
showStep "Generating Documentation" | ||
if [ ! -e "jsdoc.json" ]; then | ||
cp jsdoc.conf jsdoc.json | ||
fi | ||
jsdoc --pedantic --recurse -c jsdoc.json | ||
cd ../../ | ||
done | ||
|
||
# get current folder -1 | ||
showStep "getting repo root folder" | ||
cd ../ | ||
pwd | ||
getCurrent | ||
REPO_DIR=$DIR | ||
showStep "repo dir is: ${REPO_DIR}" | ||
|
||
# remove old folders | ||
showStep "Removing old documentation folders" | ||
cd Composer_Docs | ||
pwd | ||
for i in "${folders[@]}" | ||
do | ||
# switch to folder | ||
showStep "removing old docs in ${i}" | ||
rm -rf "${i}" | ||
mkdir "${i}" | ||
done | ||
# copy new content | ||
showStep "copying new content from node_modules in ${CHAPTER_DIR} to Composer_Docs in ${pwd}" | ||
pwd | ||
count=${#elements[@]} | ||
for i in `seq 1 $count` | ||
do | ||
showStep "cp -R ${CHAPTER_DIR}/${elements[$i-1]}/out/ ${folders[$i-1]}" | ||
cp -R ${CHAPTER_DIR}/${elements[$i-1]}/out/ ${folders[$i-1]} | ||
done | ||
# display message on how to access documentation | ||
showStep "Hyperledger Composer API documentation has been generated for your current version of Composer. | ||
You can access this information by navigating to the ${GREEN}Composer_Docs${RESET} folder in your repo | ||
and opening the ${GREEN}index.html${RESET} file located there in your favorite browser" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,12 +80,38 @@ showStep "deploying network" | |
# cd network/dist | ||
# composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -i PeerAdmin -s randomString | ||
# | ||
# what the documentation implies is required | ||
# what the v0.14 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 | ||
# what really works for v0.14 | ||
# 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 | ||
# | ||
# documentation for v0.15 | ||
# | ||
cd network/dist | ||
composer network deploy -a $NETWORK_NAME.bna -p hlfv1 -A admin -S adminpw -i PeerAdmin -s randomString | ||
showStep "installing PeerAdmin card" | ||
composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName $NETWORK_NAME | ||
showStep "starting network" | ||
# change in documentation | ||
# composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile $NETWORK_NAME.bna --file networkadmin.card | ||
# corrected to: | ||
composer network start -c PeerAdmin@hlfv1 -A admin -S adminpw -a $NETWORK_NAME.bna --file networkadmin.card | ||
showStep "importing networkadmin card" | ||
if composer card list -n admin@$NETWORK_NAME > /dev/null; then | ||
composer card delete -n admin@$NETWORK_NAME | ||
fi | ||
composer card import --file networkadmin.card | ||
showStep "pinging admin@$NETWORK_NAME card" | ||
composer network ping --card admin@$NETWORK_NAME | ||
# | ||
# creating card for test program | ||
# composer card create -p controller/restapi/features/composer/creds/connection.json -u defaultProfile -c controller/restapi/features/composer/creds/[email protected] -k controller/restapi/features/composer/creds/114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk -r PeerAdmin -r ChannelAdmin | ||
# composer card import --file [email protected] | ||
# showStep "pinging defaultProfile@hlfv1 card" | ||
# composer network ping --card defaultProfile@hlfv1 | ||
# | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.