How to create participant , there identities via rest api that generated by composer rest server without importing cards via /importwallets?

只愿长相守 提交于 2019-12-11 01:18:58

问题


I have created bna and deployed in composer rest server by enabling passport and multi-user, How to create participant, their identities via rest API that generated by composer rest server without importing cards via import wallets? and there is no proper documentation for this.


回答1:


assuming you've done a /Wallet/Import of an identity that can issue other identities:

eg. REST Endpoint

/Wallets/Import

browse for file your exported admin card eg. netadmin.card and Import it. use the POST /wallet/{name}/setDefault REST method if you need to set this as the default id.

you would then do:

Add a participant (say a participant called trader1):

- eg. say 'Trader'

Post /Trader

{
  "$class": "org.acme.trading.Trader",
  "tradeId": "trader1",
  "firstName": "John",
  "lastName": "Doe"
}

Issue an identity mapped to that participant above (say jdoe):

Under /System;

POST /system/identities/issue:
{

"participant": "resource:org.acme.trading.Trader#trader1", "userID": "jdoe", "options": {} }

You should get a business network card in your Downloads folder - from your REST server go to /Wallets

/POST /wallet/import

Import the wallet, giving it the userId@your-network parameter when prompted. Then set that as the default user (eg /POST wallet/{name}/setDefault ) if you want to use it in your browser.



来源:https://stackoverflow.com/questions/48838803/how-to-create-participant-there-identities-via-rest-api-that-generated-by-comp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!