Hyperledger Composer身份发布

时间:2018-05-17 20:53:39

标签: hyperledger-fabric hyperledger hyperledger-composer

当我尝试发布新身份时遇到以下问题:

将未知的远程类型“issueidentityrequest”视为“任何”

正确发出身份(当我使用 composer-playground 查看时),但代码以ERROR结尾,我无法下载该卡。我的代码如下:

`const identity = {
    "participant": 'org.acme.sample.Company#'+companyId,
    "userID": companyId,
    "options": {}
};`

`$.ajax({
    url: "http://localhost:3000/api/system/identities/issue",
    type: "POST",
    dataType: 'blob',
    data: identity,`

    success: function (cardData) {
        console.log('CARD-DATA', cardData);
    },`
    error: function (xhr, status) {
        console.log("Sorry, there was a problem!");
    },
    complete: function (xhr, status) {
        console.log("The request is complete!");
    }
});`

请帮助我!

1 个答案:

答案 0 :(得分:0)

可能最好看到端到端示例https://medium.com/@CazChurchUk/developing-multi-user-application-using-the-hyperledger-composer-rest-server-b3b88e857ccc,端点确实会返回导入的业务网卡。然后用它在磁盘上创建卡片文件

例如

$.ajax({
  url: "http://localhost:3000/api/system/issue",
  type: "POST",
  dataType: 'blob',
  data: identity,
  xhrFields: {
    withCredentials: true
  }