通过 composer-rest-server 创建 Card
Create Card through composer-rest-server
我可以使用 composer-rest-api 添加参与者,并且可以通过 rest API 钱包通过 composer-rest-api 上传卡片。是否可以通过composer-rest-api创建Card?
我查看了这个答案 ,它提到了如何使用 javascript api 创建卡片。我使用 javascript 代码来创建参与者并发布它,当我 运行 它($node filename.js)时,它工作正常。我怎样才能将它添加到其余 API,我需要修改哪个文件才能将其余服务器包含在创建卡中。
是的,您可以像 http://localhost:3000/api/system/issueIdentity
那样使用 /api/system/issueIdentity
操作 - 您可以选择将卡片保存到文件中(没有设置凭据,即注册 ID 和密码)。然后,如果需要,您将再次在 REST 中使用 http://localhost:3000/api/wallet/import'- and specify the card file to import from a 'Browse' (explorer) button. Once you import it to the wallet in your REST client, you can set it as the default card too using
setDefault` 端点操作导入卡(就像您所做的那样)。然后在注册后使用它,并确实将其导出以供其他地方使用。使用 curl 的示例:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \"participant": "org.acme.org.user#orguser1", \"userID": "dave" \ }' 'http://localhost:3000/api/system/issueIdentity'
其中 orguser1 是您已经在 Composer 中创建的参与者。希望这有帮助。
我能够执行 O'Mahony 先生提供的 curl 命令。但是,我不知道如何处理我收到的回复(请参阅下文)。有人有 javascript 示例代码来处理响应吗?谢谢
PK
��|eL��gDconnection.json{"name":"hlfv1","type":"hlfv1","orderers":[{"url":"grpc://localhost:7050"}],"ca":{"url":"http://localhost:7054","name":"ca.org1.example.com"},"peers":[{"requestURL":"grpc://localhost:7051","eventURL":"grpc://localhost:7053"}],"channel":"composerchannel","mspID":"Org1MSP","timeout":300}PK
�|eL�/
metadata.json{"userName":"voter114","version":1,"enrollmentSecret":"JoKCZAJxTfic","businessNetwork":"voting-network"} PK
��|eL��gDconnection.jsonPK
�|eL�/
我可以使用 composer-rest-api 添加参与者,并且可以通过 rest API 钱包通过 composer-rest-api 上传卡片。是否可以通过composer-rest-api创建Card?
我查看了这个答案
是的,您可以像 http://localhost:3000/api/system/issueIdentity
那样使用 /api/system/issueIdentity
操作 - 您可以选择将卡片保存到文件中(没有设置凭据,即注册 ID 和密码)。然后,如果需要,您将再次在 REST 中使用 http://localhost:3000/api/wallet/import'- and specify the card file to import from a 'Browse' (explorer) button. Once you import it to the wallet in your REST client, you can set it as the default card too using
setDefault` 端点操作导入卡(就像您所做的那样)。然后在注册后使用它,并确实将其导出以供其他地方使用。使用 curl 的示例:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \"participant": "org.acme.org.user#orguser1", \"userID": "dave" \ }' 'http://localhost:3000/api/system/issueIdentity'
其中 orguser1 是您已经在 Composer 中创建的参与者。希望这有帮助。
我能够执行 O'Mahony 先生提供的 curl 命令。但是,我不知道如何处理我收到的回复(请参阅下文)。有人有 javascript 示例代码来处理响应吗?谢谢
PK ��|eL��gDconnection.json{"name":"hlfv1","type":"hlfv1","orderers":[{"url":"grpc://localhost:7050"}],"ca":{"url":"http://localhost:7054","name":"ca.org1.example.com"},"peers":[{"requestURL":"grpc://localhost:7051","eventURL":"grpc://localhost:7053"}],"channel":"composerchannel","mspID":"Org1MSP","timeout":300}PK �|eL�/ metadata.json{"userName":"voter114","version":1,"enrollmentSecret":"JoKCZAJxTfic","businessNetwork":"voting-network"} PK ��|eL��gDconnection.jsonPK �|eL�/