I have run the network using the below command
composer-rest-server -c admin@mynetwork -n never -w true
In the network there are some other participants also like
Participant1 has p1@mynetwork card
Participant2 has p2@mynetwork card
Now the problem is how to connect to another card while doing the transaction.
I want to do the transaction1 with p1 card and transaction2 with p2 card.
How to do that connection while doing the transaction. I am using to call the transaction in nodejs by calling http://localhost:3000/api/transaction1
You can do it in 2 ways:
1st way:
You can create an account in github OAuth to authenticate user for your hyperledger rest server. What this does is that your rest-server will then get a wallet where user will upload their card and then activate that card. Now whatever transaction that you will perform will carry on being the participant, whose card that is.
Steps:
export COMPOSER_PROVIDERS='{"github":"provider":"github","module":"passportgithub","clientID":"c1e68c173a1*******","clientSecret":"**************a2219abc380fa43ace7519","authPath":"/auth/github","callbackURL":"/auth/github/callback","successRedirect":" ","failureRedirect":"/"}}'
npm install -g passport-github
composer-rest-server --card admin@mynetwork -n never -p 3000 -a true -m true
localhost:3000/auth/github
2nd way: (Not Preferable But Easiest :) )
You can create composer rest server at different port using command
composer-rest-server -c p1@mynetwork -n never -w true -p 4000
Now whatever transaction you want to perform by participant1. Perform on port 4000.