如何获得调用该事务的参与者?
How to get Participant that called that transaction?
我有一个类似这样的交易doSomething(asset1, asset2)
。
我是否可以在不将参与者引用作为参数之一传递的情况下检索调用 doSomething
交易的参与者?
更新:
doSomething(param1, param2) {
//get caller participant reference here
let caller = getParticipant();
}
例如,在上面的交易中,我想获得对在该函数内调用交易的参与者的引用(即交易尚未完成)
运行时中有一个方法 getCurrentParticipant API,您可以从事务处理函数中调用它。
在较新版本的 Composer 中(当然是在 v0.19.0 中)也有 getCurrentIdentity。
API 参考中的 document 有详细信息。
我有一个类似这样的交易doSomething(asset1, asset2)
。
我是否可以在不将参与者引用作为参数之一传递的情况下检索调用 doSomething
交易的参与者?
更新:
doSomething(param1, param2) {
//get caller participant reference here
let caller = getParticipant();
}
例如,在上面的交易中,我想获得对在该函数内调用交易的参与者的引用(即交易尚未完成)
运行时中有一个方法 getCurrentParticipant API,您可以从事务处理函数中调用它。
在较新版本的 Composer 中(当然是在 v0.19.0 中)也有 getCurrentIdentity。
API 参考中的 document 有详细信息。