我的问题是关于hyperledger-composer:
在事务处理器函数中,可以获得当前参与者的id,如下所示:
let currentParticipant = getCurrentParticipant();
let participantId = currentParticipant.getFullyQualifiedIdentifier();但是如何从angular应用程序中获取当前参与者的id呢?
发布于 2018-08-05 03:57:18
我不认为直接从angular检索这些信息是可能的。
您可以根据用于提交交易的卡来检索参与者。
我建议你使用Hyperledger Composer-Rest-Server公开app,并从你的angular应用程序中直接调用它们。
这里是官方文档。https://hyperledger.github.io/composer/latest/integrating/getting-started-rest-api
发布于 2018-09-10 23:35:25
这是一个肮脏的黑客,但它对我是有效的。
尝试ping localhost:3000/api/system/ping,这将ping当前用户并返回参与用户。
正如在前面的回答中所提到的,使用composer-rest-server
https://stackoverflow.com/questions/51677393
复制相似问题