Reputation: 421
I have some doubts with how to use hyperledger composer in production. I need to create apis using hyperledger composer which will be used by our front end application which is not of angular js.
Upvotes: 0
Views: 567
Reputation: 41
You need to enable authentication in REST server.
export COMPOSER_CARD=name of your card that will be used to start the REST server
export COMPOSER_AUTHENTICATION=true
export COMPOSER_PROVIDERS='{
"github":{
},
...
}'
Also you need to switch on REST server Multi-user mode.
export COMPOSER_MULTIUSER=true
export COMPOSER_DATASOURCES='{
"db":{
"name":"db",
"host":"hostname",
"port":port number,
"database":"database name",
"user":"login",
"password":"password",
"connector":"mongodb"
}
}'
and then start the REST server
composer-rest-server
Now the composer REST server will start with the card COMPOSER_CARD with authentication and Multi-user enabled.
If you now visit http://localhost:3000 you will find a new set of APIs "Wallet". Here the wallet functions are defined.
Now the steps for the user will be as follows:
Hence even if you started the REST server with COMPOSER_CARD it is using your actual card to execute Web services.
Hope this clarifies.
Also you can go through the actual document related to this one for better understanding:
https://hyperledger.github.io/composer/latest/tutorials/google_oauth2_rest
Upvotes: 2