func (stub *ChaincodeStub) GetString(key string) (string, error) { valBytes, err := stub.GetState(key) if err != nil { return "", err } return string(valBytes), nil }
func (stub *ChaincodeStub) PutString(key string, value string) error { err := stub.PutState(key, []byte(value)) if err != nil { return err } return nil }Overall, the `ChaincodeStub` type and its associated methods provide a simple and efficient way for developers to interact with the Hyperledger Fabric blockchain using Go.