3

Im following the Hyperledger tutorial Youtube Link and the instructor modifies a sample contract. However with the current version of Hyperledger fabric playground which can be accessed online, there is no mention of state after entering the accountTransfer function. This leads to an error as shown below: Hyperledger Composer Playground Error

How to solve the same? I have tried searching for answers but I couldnt find any which addresses this specific issue.

SeaWarrior404
  • 3,811
  • 14
  • 43
  • 65
  • 1
    Can you also confirm your Composer version eg. `composer -v` - thanks – Paul O'Mahony Dec 06 '17 at 15:58
  • @PaulO'Mahony I was using the online version of Composer(Playground v0.16.0) on the IBM bluemix platform. I will try running this locally tonight and then see if I run into issues. – SeaWarrior404 Dec 07 '17 at 05:20
  • sure np - as long as you make the changes (in the answer below) suggested, you should be good to go in Playground. – Paul O'Mahony Dec 07 '17 at 10:58

1 Answers1

8

t: stands for transaction.

you have two problems in your model

  1. transactionId is already reserved (you don't need to model/define it - a transaction Id is returned when a transaction is submitted - Or call the field something else if you are using it for your own transaction purposes) - the Docs do mention this about transactionId https://hyperledger.github.io/composer/reference/cto_language.html

  2. you do not use 'identified by' in your definition of the transaction - unlike Participants and Assets

see -> https://hyperledger.github.io/composer/reference/js_scripts.html and our sample networks (which you can browse) show examples of modeled transactions -> https://github.com/hyperledger/composer-sample-networks

I would add that more info about modeling transactions should be included in the page ref in 1. above.

Finally for this out-of-context 't:' error (ie item 1 above) - we have an outstanding Github issue (a different kind of problem producing the error, but the same error results nonetheless). https://github.com/hyperledger/composer/issues/1497

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15
  • Thankyou! As I mentioned, I was following the tutorial. I didnt delve into the deeper aspects of the things you have mentioned yet. But after reading through docs, I have gained a better understanding of the same. – SeaWarrior404 Dec 07 '17 at 05:18