Assignment # 1:
Blockchain Fabric introduces decentralized governance for smart contracts, with a new process for installing a chaincode on your peers and starting it on a channel. The new Fabric chaincode lifecycle allows multiple organizations to come to agreement on the parameters of a chaincode, such as the chaincode endorsement policy, before it can be used to interact with the ledger.
Data use description: It is procurements transactions from a company. Each transaction starts with Create PO activity. The PO has to be properly authorized, which is represented by a Sign activity. This is followed by receiving the goods and the related invoice, which is recorded in the information system as GR and IR respectively. Finally, a Release activity is performed to release the PO to the accounts payable department for payment.
- Create and Deploy a Blockchain Network “Hyperledger Fabric” using Python
- You must use Python and share the code of all process
- You must use the attached excel sheet data “procurements details file”
- This link has an example how to create a blockchain using https://github.com/hyperledger/fabric-sdk-py
- Create smart contracts using Python to find the following
- You must use Python and share the code of all process
- Apply rules below
| Rule | Condition apply in smart contracts |
| Inappropriate purchase order | A sign activity must be performed at least once |
| Inappropriate purchase order | The value of a purchase order must be specified |
| Inappropriate purchase order | The value of a purchase order may not change after a sign activity has been performed |
| Incorrect invoice approval | A purchase order activity must be started before date of invoice receipt |
| Inappropriate access | A person must not perform all activities of the P2P process |
| Inappropriate access | A good receipt activity must be performed during regular business hours |
| Inappropriate access | A person must perform a release activity after time T = timestamp of goods receipt event |
| Inappropriate access | A release activity must be performed by a member of senior staff |
| Invoice entry error | An invoice pay activity cannot be duplicated for the same purchase order |
| Goods received not matching valid purchase | The values of Purchase order, goods receipt, and invoice receipt must match before the corresponding invoice can be paid |
| Payment error | The value of a purchase order may not change after a sign activity has been performed |
| Payment error | If a goods receipt activity is performed then an invoice receipt activity must be performed |
| Suboptimal task allocation | A good receipt activity must not be performed by a member of senior staff |
Requirements:
You have to share to files for each requirement
- Your code solution
- Excel file of your solution (except V)
Create and Deploy smart contracts in the created Blockchain Network in the step “A” Python.
- Verify transactions hash (minimum of to 5 cases)
- Extract the procurements details from the created Hyperledger Fabric in A (in excel formate)
- List the Sequence of all transactions in
For example: 10 transactions sequence is
- Create PO —> Sign —> GR —> IR —> Release
- Create PO —> Sign —> Sign —> GR —> IR —> Release
- Etc.
- Results Of The Above Rules using smart contract
| Rule | Condition apply in smart contracts | Number of Violated cases | % of Violated cases from overall cases | Amount $ | % out of overall $ total |
| Inappropriate purchase order | A sign activity must be performed at least once | ||||
| Inappropriate purchase order | The value of a purchase order must be specified | ||||
| Inappropriate purchase order | The value of a purchase order may not change after a sign activity has been performed | ||||
| Incorrect invoice approval | A purchase order activity must be started before date of invoice receipt | ||||
| Inappropriate access | A person must not perform all activities of the P2P process | ||||
| Inappropriate access | A good receipt activity must be performed during regular business hours | ||||
| Inappropriate access | A person must perform a release activity after time T = timestamp of goods receipt event | ||||
| Inappropriate access | A release activity must be performed by a member of senior staff | ||||
| Invoice entry error | An invoice pay activity cannot be duplicated for the same purchase order | ||||
| Goods received not matching valid purchase | The values of Purchase order, goods receipt, and invoice receipt must match before the corresponding invoice can be paid | ||||
| Payment error | The value of a purchase order may not change after a sign activity has been performed | ||||
| Payment error | If a goods receipt activity is performed then an invoice receipt activity must be performed | ||||
| Suboptimal task allocation | A good receipt activity must not be performed by a member of senior staff |
- Share your code to apply the red flags rules in smart contract (means if the any of the below happen, controller will get a red flag violation of the rule).
| Red Flags Rules |
| A sign activity must be performed at least once |
| If a goods receipt activity is performed then an invoice receipt activity must be performed |
| A Sign activity must be started before date of goods receipt |
| A person must not sign and release the same purchase order |
| A person must not sign and perform a good receipt activity for the same purchase order |
| A person must not perform all activities of the P2P process |
| A good receipt activity must be performed during regular business hours |
| A personmust perform a release activity after time T = timestamp of goods receipt event |
| A release activity must be performed by a member of senior staff |
| A good receipt activity must not be performed by a member of senior staff |
| The value of a purchase order must be specified |
| The values of Purchase order, goods receipt, and invoice receipt must match before the corresponding invoice can be paid |
| The value of a purchase order may not change after a sign activity has been performed |
The post New Fabric Chain Code Life cycle appeared first on My Assignment Online.