How to create a test with asset ownership? #fabric


Attila Klenik <klenik@...>
 

Hi Luiz,

 

check out the following pending PR and documentation about a new Fabric adapter, which is quite flexible regarding the dynamic registration of users (affiliations, attributes, choosing the TX submitter).

Adapter: https://github.com/hyperledger/caliper/pull/296

Documentation: https://github.com/hyperledger/caliper/pull/297

 

Regards,

Attila Klenik

PhD Student @ Fault Tolerant Systems Research Group,

Department of Measurement and Information Systems,

Faculty of Electrical Engineering and Informatics,

Budapest University of Technology and Economics

 

E-mail: klenik@...

 

From: caliper@... <caliper@...> On Behalf Of luizck@...
Sent: 2019. február 14., csütörtök 20:12
To: caliper@...
Subject: [Hyperledger Caliper] How to create a test with asset ownership? #fabric

 

Hi all,

We have a test case where multiple orgs can put assets into a blockchain, but only its "owner" can alter the asset's state. The owner is identified by the MspId of the transaction.
Is there a way to pass (or create) the context of the owner organization to the callback?

To illustrate:

module.exports.run = function() {
   
let asset  = asset_array[count++];
    let
tx = {
       
'transaction_type': 'AlterAsset',
       
'asset': asset.id
   
};

   
//contx must be the context of the owner of the asset.
    return
bc.invokeSmartContract(contx, 'mychannel', '0', [tx], 100);
};


Regards,
Luiz


luizck@...
 

Hi all,

We have a test case where multiple orgs can put assets into a blockchain, but only its "owner" can alter the asset's state. The owner is identified by the MspId of the transaction.
Is there a way to pass (or create) the context of the owner organization to the callback?

To illustrate:

module.exports.run = function() {
let asset = asset_array[count++];
let tx = {
'transaction_type': 'AlterAsset',
'asset': asset.id
};

//contx must be the context of the owner of the asset.
return bc.invokeSmartContract(contx, 'mychannel', '0', [tx], 100);
};

Regards,
Luiz