- To list the available Cards:
composer card list
-
To create a new .bna composer archive create ...
-
To deploy it to fabric: composer runtime install ...
-
To start the deployed network composer network start
-
To update the network definition for an already deployed network composer network update
-
To install composer runtime:
composer runtime install --card PeerAdmin@hlfv1 --businessNetworkName hr-network
- TO deploy business network:
composer network start --card PeerAdmin@hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile hr-network@0.0.1.bna --file networkadmin.card
- To import the network administrator identity as a usable business network card:
composer card import --file networkadmin.card
- To check that the business network has been deployed successfully:
composer network ping --card admin@hr-network
- Generate a Rest Server without authentication and without multiuser. composer-rest-server
business card name: admin@hr-network
-
To restart the REST server using authentication and multiuser enabled. composer-rest-server -c admin@workvalid -n never -m true
-
Add a new participant using nodejs client API https://hyperledger.github.io/composer/managing/participant-add.html but modified some part of the code.
using command line :
composer participant add -c admin@workvalid -d '{"$class":"org.acme.workvalid.EduInstitution","institutionId":"sjsu@workvalid.org","institutionName":"San Jose State University","institutionLocation":"San Jose"}'
- TO issue a new identity to the added participant(https://hyperledger.github.io/composer/managing/identity-issue.html) command line composer identity issue -c admin@workvalid -f sjsuid.card -u sjsuid -a "org.acme.workvalid.EduInstitution#sjsu@workvalid.org" --issuer true
This command worked: composer identity issue -u tcsid1 -a org.acme.biznet.Employer#TCS -c admin@hr-network
Also worked with javascript API
akhil@akhil:~/client_app_nodejs$ node issue_new_identity.js userID = infyid1 userSecret = xgeAbkHoZScw
-
To create the business network card from the userid and usersecret created composer card create --file infyid1.card --businessNetworkName hr-network --connectionProfileFile /home/akhil/.composer/cards/admin@hr-network/connection.json --user infyid1 --enrollSecret xgeAbkHoZScw
-
Imported the card for security reasons:
akhil@akhil:~/hr-network$ composer card import -f infyid1.card -n infyid1@hr-network Successfully imported business network card: infyid1@hr-network
Command succeeded
-
To list all the identities composer identity list -c admin@hr-network
-
In github after registering the Oauth application clientID: 45d3d1a2f584d6b4899e client secret: e8d3c28524ff5839b3c08e29bca707a50aeaaf24
export COMPOSER_PROVIDERS='{ "github": { "provider": "github", "module": "passport-github", "clientID": "45d3d1a2f584d6b4899e", "clientSecret": "e8d3c28524ff5839b3c08e29bca707a50aeaaf24", "authPath": "/auth/github", "callbackURL": "/auth/github/callback", "successRedirect": "/", "failureRedirect": "/" } }'
To remove white spaces: https://www.browserling.com/tools/remove-all-whitespace
- Command to start the rest server:
composer-rest-server --card admin@workvalid -n "never" -a true -m true -p 3000
19 navigate to localhost:3000/auth/github and give authorization
References: https://hyperledger.github.io/composer/managing/participantsandidentities.html
https://hyperledger.github.io/composer/managing/identity-issue.html
https://hyperledger.github.io/composer/managing/id-cards-playground.html - havent followed
This is one of the most important thing to be done by tomorrow at any cost. Login and authentication is done using passport strategy: https://github.com/hyperledger/composer/issues/142
This is for using the passport-jwt
https://github.com/hyperledger/composer/issues/2038