28 lines
583 B
Go
28 lines
583 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/hyperledger/fabric-contract-api-go/contractapi"
|
|
)
|
|
|
|
type FeedbackContract struct {
|
|
contractapi.Contract
|
|
}
|
|
|
|
func (c *FeedbackContract) SubmitFeedback(
|
|
ctx contractapi.TransactionContextInterface, id string, feedback string,
|
|
) error {
|
|
return ctx.GetStub().PutState(id, []byte(feedback))
|
|
}
|
|
|
|
func main() {
|
|
chaincode, err := contractapi.NewChaincode(new(FeedbackContract))
|
|
if err != nil {
|
|
fmt.Printf("Error creating chaincode: %s", err)
|
|
}
|
|
if err := chaincode.Start(); err != nil {
|
|
fmt.Printf("Error starting chaincode: %s", err)
|
|
}
|
|
}
|