在同一个作曲家休息服务器配置中使用两张名片 [英] Using two business cards in the same composer rest server configuration

查看:58
本文介绍了在同一个作曲家休息服务器配置中使用两张名片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完成了将教程部署到多组织结构网络的教程,并且成功运行了.

现在我有两张管理卡- alice @ trade-network,bob @ trade-network

和由他们发出的两个身份/卡- jdoe @ trade-network,dlowe @ trade-network

现在我已经给出了访问控制规则,说明jdoe(trader1-org1)和dlowe(trader2-org2)只能查看自己的记录

因此,当我连接到他们各自的名片时,我只能查看他们的记录.现在,我可以为jdoe和dlowe分别启动两个休息服务器(两个端口),这只能通过其休息api端点查看其记录.

现在我知道我可以为管理员的爱丽丝或鲍勃启动另一个休息服务器,以便他们可以查看所有记录(jdoe和dlowe的记录) 但是我不想那样做.那就是启动第三个休息服务器.

还有其他方法可以实现这一目标.要获取所有卡中的所有记录! 有没有一种方法可以用两个卡实例或类似的东西启动一个休息服务器.

建议??谢谢〜!

解决方案

首先很酷地尝试各种可能性.

简单的答案是在多用户模式下启动单个REST服务器,从而启用钱包.在此处查看更多-> https://hyperledger.github.io/composer/latest/integrating/enabling-multiuser 并举例说明使用电子钱包(在其中存储了商务网卡).您可以按照以下说明将钱包存储区保存到磁盘上-> https://hyperledger.github.io/composer/latest/integrating/deploying-the-rest-server.html

然后jdoe, dlow, alice and bob-作为业务网络的参与者(每个人都有自己的受任何ACL规则支配的商业网卡)-可以使用浏览器客户端(REST API客户端)作为不同的参与者进行交互(因此,会根据您的ACL规则看到不同的结果.

Google OAUTH2教程中有一个示例.如何切换身份,导入用户的商务网卡/在REST API中将其设置为默认值,以便其使用特定的区块链身份/参与者在商务网络上执行活动(具体请参见第11步").

I did the tutorial to deploy to a multi org fabric network and it worked successfully .

Now i have two admin cards - alice@trade-network , bob@trade-network

and two identities/cards issued by them - jdoe@trade-network , dlowe@trade-network

Now i have given access control rules stating that jdoe (trader1-org1) and dlowe(trader2-org2) can only view their own records

Thus when i connect to their respective business cards i am able to view only their records . Now i can start two rest servers each (2 ports) for jdoe and dlowe which enables view of their records only through their rest api endpoints .

Now i know for a fact i can start another rest server for alice or bob who are admins so they can view all the records (jdoe's and dlowe's) But i dont want to do it that way . That is start a third rest server .

Is there any other way to achieve this . To get all the records in all cards ! Is there a way to start a rest server with two card instances or something like that .

Suggestions ?? Thanks~!

解决方案

cool that you've been playing around with possibilities firstly.

The simple answer is to start a single REST server in multi-user mode, which enables wallets. See more here -> https://hyperledger.github.io/composer/latest/integrating/enabling-multiuser with an example of using Wallets (into which business network cards are stored). You can persist the wallet store to disk as described here -> https://hyperledger.github.io/composer/latest/integrating/deploying-the-rest-server.html

Then jdoe, dlow, alice and bob - as participants of the business network (each with their own business network card governed by whatever ACL rules are in place) - can interact using a browser client (REST API client) as the different participants (and therefore see different results as per your ACL rules).

There is an example of this in the Google OAUTH2 tutorial which shows how you switch identities, import a user's business network card / set it as default in the REST API, so that its using a specific blockchain identity / participant to perform activities on the business network (see specifically 'Step Eleven' onwards).

这篇关于在同一个作曲家休息服务器配置中使用两张名片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆