escc

package
v0.0.0-...-5e9bd76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndorserOneValidSignature

type EndorserOneValidSignature struct {
}

EndorserOneValidSignature implements the default endorsement policy, which is to sign the proposal hash and the read-write set

func (*EndorserOneValidSignature) Init

Init is called once when the chaincode started the first time

func (*EndorserOneValidSignature) Invoke

Invoke is called to endorse the specified Proposal For now, we sign the input and return the endorsed result. Later we can expand the chaincode to provide more sophisticate policy processing such as enabling policy specification to be coded as a transaction of the chaincode and Client could select which policy to use for endorsement using parameter @return a marshalled proposal response Note that Peer calls this function with 4 mandatory arguments (and 2 optional ones): args[0] - function name (not used now) args[1] - serialized Header object args[2] - serialized ChaincodeProposalPayload object args[3] - ChaincodeID of executing chaincode args[4] - result of executing chaincode args[5] - binary blob of simulation results args[6] - serialized events args[7] - payloadVisibility

NOTE: this chaincode is meant to sign another chaincode's simulation results. It should not manipulate state as any state change will be silently discarded: the only state changes that will be persisted if this endorsement is successful is what we are about to sign, which by definition can't be a state change of our own.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL