0
function Exchange(exchange){
// We do the actual exchange here:
// We first need to get both actual nodes:
var nodeIdFrom=exchange.nodeIdFrom;
var quantity =exchange.quantity;
var price = exchange.price;
var nodeIdTo =exchange.nodeIdTo;
return getParticipantRegistry('org.acme.mynetwork.Node')
.then(function(ParticipantRegistry){
ParticipantRegistry.get(nodeIdFrom)
.then(function(Participant){
Participant.Need=Participant.Need+quantity;
Participant.Balance_account=Participant.Balance_account+quantity*price;
return ParticipantRegistry.update(Participant);
});
});
は、私は以下のように定義トランザクションを実行しようとしています。ノードのIDのみをパラメータとして使用します。HyperledgerのgetParticipants
今のところ、この機能は動作しません。プレイグラウンドで実行することはできますが、ノードは変更されません。 ノードをNode(ノードは参加者)として指定せずにトランザクションを適用できますか。