Security and Communication Networks / 2021 / Article / Alg 2 / Research Article
Based on Consortium Blockchain to Design a Credit Verifiable Cross University Course Learning System Algorithm 2 Chaincode for the university to check courses.
(1) func (t ∗ Chaincode) CheckCourse(APIstub shim.ChaincodeStubInterface, args []string) peer.Response { (2) if len(args) ! = 4 { (3) return shim.Error(“nu Incorrect mber of arguments. Expecting 4″) (4) } (5) var teacher = Teacher{Name: args [1 ], University: args [2 ], Course: args [3 ]} (6) teacherAsBytes, _: = json.Marshal(teacher) (7) APIstub.PutState(args[0], teacherAsBytes) (8) return shim.Success(nil) (9) } Step 3: after receiving from University B, Teacher B first uses to confirm whether the timestamp is valid, then searches for the public key of University B by , verifies by , and calculates , , , , .