hyperledger composer playground 如何实施 "All Transactions"?
How is hyperledger composer playground implementing the "All Transactions"?
当我尝试对 "org.hyperledger.composer.system.HistorianRecord" 使用查询时,结果不显示 AddAsset、AddParticipant 等系统事务的输入。
我想使用查询为单个资产创建审计跟踪。
关于跟踪资产历史的问题很多,但我找不到解决方案。
必须有一个解决方案,hyperledger playground 在测试部分的 "All Transaction" 中准确地显示了我更喜欢的方式。那么我们如何编写代码以获得与所有交易相同的输出。
我使用的查询
query selectHistoricalRecord {
description: "Select all Historical Record of AddAsset"
statement:
SELECT org.hyperledger.composer.system.HistorianRecord
WHERE (transactionType == 'org.hyperledger.composer.system.AddAsset')
}
这个logic.js
/**
* Remove all high volume commodities
* @param {org.example.trading.GetAssetHistory} tx - the asset for constructing audit trail
* @transaction
*/
async function GetAssetHistory(tx)
{
let results = await query('selectHistoricalRecord');
console.log( results );
}
输出如下:
但在所有交易中:
我们得到这样的东西:
我的问题是 "all transactions" 如何显示输入,但 historian 没有。还有什么其他方式可以获得系统事务的输入。
此查询应为您提供结果:
query a2 {
description: "Select Transaction"
statement:
SELECT org.hyperledger.composer.system.AddAsset
}
当我尝试对 "org.hyperledger.composer.system.HistorianRecord" 使用查询时,结果不显示 AddAsset、AddParticipant 等系统事务的输入。 我想使用查询为单个资产创建审计跟踪。
关于跟踪资产历史的问题很多,但我找不到解决方案。
必须有一个解决方案,hyperledger playground 在测试部分的 "All Transaction" 中准确地显示了我更喜欢的方式。那么我们如何编写代码以获得与所有交易相同的输出。
我使用的查询
query selectHistoricalRecord {
description: "Select all Historical Record of AddAsset"
statement:
SELECT org.hyperledger.composer.system.HistorianRecord
WHERE (transactionType == 'org.hyperledger.composer.system.AddAsset')
}
这个logic.js
/**
* Remove all high volume commodities
* @param {org.example.trading.GetAssetHistory} tx - the asset for constructing audit trail
* @transaction
*/
async function GetAssetHistory(tx)
{
let results = await query('selectHistoricalRecord');
console.log( results );
}
输出如下:
但在所有交易中:
我们得到这样的东西:
我的问题是 "all transactions" 如何显示输入,但 historian 没有。还有什么其他方式可以获得系统事务的输入。
此查询应为您提供结果:
query a2 { description: "Select Transaction" statement: SELECT org.hyperledger.composer.system.AddAsset }