Welcome to the Linux Foundation Forum!

Labs Ch 8 Answers

SunilSamuel Posts: 2
edited January 2022 in LFS272 Class Forum

Hi , Can someone help with the lab answers ? I am particularly looking for ch-8 ones.
I believe these should be available within the initial resources, at least as a different section .


  • davidmarkclements

    Hi @SunilSamuel

    We don't provide answers to the lab exercises for the following reasons:

    • answers are in the actual reading material, they just have to be extrapolated and reapplied
    • when the exercise is correctly complete the your answer is validated with code provided with the lab
    • providing answers directly undermines the point of using reading comprehension to learn skills in order to complete the lab
  • brentbrownfield
    brentbrownfield Posts: 8
    edited December 2021

    The following post was meant for the LFS272 forum. Not sure how I got into the wrong area.

    This is not at all true for the final statement in Lab 8:

    If you were initializing a chainode that implements the Fabric contract API (instead of the Fabric
    Chaincode Shim API), then you’d need to specify the name of the initialization function to be
    called in the chanincode. For example:
    peer chaincode invoke -o orderer.example.com:7050 --tls --cafile
    $ORDERER_TLS_CA -C allarewelcome -n mychaincode --peerAddresses
    '{"function":"initLedger","args":["key0", "value0"]}' --isInit
    We leave as an exercise to the reader to upgrade the sacc chaincode one more time, this time specifying that it must be initialized as described above.

    I have seen nothing in the course materials that addresses how to do this. There are not helpful references back to specific locations in the hyperledger fabric 2 docs either.

    Also there is no code to verify this. It is the final statement in the lab.

    How am I supposed to use this material to prepare for an exam if topics are not explained properly?

  • hakroush
    hakroush Posts: 4

    to minimize the search the answer is in Promises (1)
    try to compare the lab exercise to the example in the lesson
    its a bit confusing because these functions are not promises or accepting callbacks, so you have to construct the promises yourself.
    there is already the hint of using promisify
    good luck


Upcoming Training