Research Article

Based on Consortium Blockchain to Design a Credit Verifiable Cross University Course Learning System

Algorithm 3

Chaincode for the teacher to approve students to join the course.
(1)func (t Chaincode) LearnCourse(APIstub shim.ChaincodeStubInterface, args []string) peer.Response {
(2) if len(args) ! = 6 {
(3)  return shim.Error(“Incorrect number of arguments. Expecting 6″)
(4) }
(5) var student = Student{Name: args [1], University: args [2], Hash: args [3], Grade: args [2], Credit: args [3]}
(6) studentAsBytes, _: = json.Marshal(student)
(7) APIstub.PutState(args[0], studentAsBytes)
(8) return shim.Success(nil)
(9)}
 Step 3: When Student A finishes his homework and final examination , he searches for the public key of Teacher B by , encrypts with the public key , generates , calculates , and uploads by invoking the chaincode WorkUpload. The chaincode is shown in Algorithm 4.