首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从其他渠道获取查询结果

如何从其他渠道获取查询结果
EN

Stack Overflow用户
提问于 2019-04-15 00:10:18
回答 1查看 123关注 0票数 0

当我想在我的fabric中获得查询结果时,我遇到了麻烦。我有2个渠道,渠道1存储帐户数据,渠道2存储一些内容和他们的成本。我在频道1,我想在channel2中查询一个内容的成本,然后在频道1中“购买”它。例如,channel1有一个帐户A,他有20美元,channel2有一个电影成本9美元,A想查询电影的成本,然后“购买”它,所以A现在只有11美元。但是现在我不知道如何从channel2那里得到"$9“。我该怎么做呢?

EN

回答 1

Stack Overflow用户

发布于 2019-04-15 15:06:59

Fabric使用通道作为一种隔离形式。无论您如何使用'InvokeChaincode‘API调用另一个链码。

代码语言:javascript
复制
// InvokeChaincode locally calls the specified chaincode `Invoke` using the
    // same transaction context; that is, chaincode calling chaincode doesn't
    // create a new transaction message.
    // If the called chaincode is on the same channel, it simply adds the called
    // chaincode read set and write set to the calling transaction.
    // If the called chaincode is on a different channel,
    // only the Response is returned to the calling chaincode; any PutState calls
    // from the called chaincode will not have any effect on the ledger; that is,
    // the called chaincode on a different channel will not have its read set
    // and write set applied to the transaction. Only the calling chaincode's
    // read set and write set will be applied to the transaction. Effectively
    // the called chaincode on a different channel is a `Query`, which does not
    // participate in state validation checks in subsequent commit phase.
    // If `channel` is empty, the caller's channel is assumed.
    InvokeChaincode(chaincodeName string, args [][]byte, channel string) pb.Response

Source

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55677355

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档