Get desktop application:
View/edit binary Protocol Buffers messages
This structure is necessary to sign the proposal which contains the header and the payload. Without this structure, we would have to concatenate the header and the payload to verify the signature, which could be expensive with large payload When an endorser receives a SignedProposal message, it should verify the signature over the proposal bytes. This verification requires the following steps: 1. Verification of the validity of the certificate that was used to produce the signature. The certificate will be available once proposalBytes has been unmarshalled to a Proposal message, and Proposal.header has been unmarshalled to a Header message. While this unmarshalling-before-verifying might not be ideal, it is unavoidable because i) the signature needs to also protect the signing certificate; ii) it is desirable that Header is created once by the client and never changed (for the sake of accountability and non-repudiation). Note also that it is actually impossible to conclusively verify the validity of the certificate included in a Proposal, because the proposal needs to first be endorsed and ordered with respect to certificate expiration transactions. Still, it is useful to pre-filter expired certificates at this stage. 2. Verification that the certificate is trusted (signed by a trusted CA) and that it is allowed to transact with us (with respect to some ACLs); 3. Verification that the signature on proposalBytes is valid; 4. Detect replay attacks;
The bytes of Proposal
Signaure over proposalBytes; this signature is to be verified against the creator identity contained in the header of the Proposal message marshaled as proposalBytes
A ProposalResponse is returned from an endorser to the proposal submitter. The idea is that this message contains the endorser's response to the request of a client to perform an action over a chaincode (or more generically on the ledger); the response might be success/error (conveyed in the Response field) together with a description of the action and a signature over it by that endorser. If a sufficient number of distinct endorsers agree on the same action and produce signature to that effect, a transaction can be generated and sent for ordering.
Version indicates message protocol version
Timestamp is the time that the message was created as defined by the sender
A response message indicating whether the endorsement of the action was successful
The payload of response. It is the bytes of ProposalResponsePayload
The endorsement of the proposal, basically the endorser's signature over the payload
Interface exported by the events server
event chatting using Event
SignedEvent is used for any communication between consumer and producer
Signature over the event bytes
Marshal of Event object
Event is used by - consumers (adapters) to send Register - producer to advertise supported types and events
TODO need timestamp
Register consumer sent event
producer events
Unregister consumer sent events
Creator of the event, specified as a certificate chain
AnchorPeer message structure which provides information about anchor peer, it includes host name, port number and peer certificate.
Used in:
DNS host name of the anchor peer
The port number
AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem
ChaincodeAction contains the actions the events generated by the execution of the chaincode.
This field contains the read set and the write set produced by the chaincode executing this invocation.
This field contains the events generated by the chaincode executing this invocation.
This field contains the result of executing this invocation.
This field contains the ChaincodeID of executing this invocation. Endorser will set it with the ChaincodeID called by endorser while simulating proposal. Committer will validate the version matching with latest chaincode version. Adding ChaincodeID to keep version opens up the possibility of multiple ChaincodeAction per transaction.
ChaincodeActionPayload is the message to be used for the TransactionAction's payload when the Header's type is set to CHAINCODE. It carries the chaincodeProposalPayload and an endorsed action to apply to the ledger.
This field contains the bytes of the ChaincodeProposalPayload message from the original invocation (essentially the arguments) after the application of the visibility function. The main visibility modes are "full" (the entire ChaincodeProposalPayload message is included here), "hash" (only the hash of the ChaincodeProposalPayload message is included) or "nothing". This field will be used to check the consistency of ProposalResponsePayload.proposalHash. For the CHAINCODE type, ProposalResponsePayload.proposalHash is supposed to be H(ProposalHeader || f(ChaincodeProposalPayload)) where f is the visibility function.
The list of actions to apply to the ledger
Specify the deployment of a chaincode. TODO: Define `codePackage`.
Controls when the chaincode becomes executable.
Used in:
ChaincodeEndorsedAction carries information about the endorsement of a specific proposal
Used in:
This is the bytes of the ProposalResponsePayload message signed by the endorsers. Recall that for the CHAINCODE type, the ProposalResponsePayload's extenstion field carries a ChaincodeAction
The endorsement of the proposal, basically the endorser's signature over proposalResponsePayload
ChaincodeEvent is used for events and registrations that are specific to chaincode string type - "chaincode"
Used in:
ChaincodeHeaderExtension is the Header's extentions message to be used when the Header's type is CHAINCODE. This extensions is used to specify which chaincode to invoke and what should appear on the ledger.
The PayloadVisibility field controls to what extent the Proposal's payload (recall that for the type CHAINCODE, it is ChaincodeProposalPayload message) field will be visible in the final transaction and in the ledger. Ideally, it would be configurable, supporting at least 3 main visibility modes: 1. all bytes of the payload are visible; 2. only a hash of the payload is visible; 3. nothing is visible. Notice that the visibility function may be potentially part of the ESCC. In that case it overrides PayloadVisibility field. Finally notice that this field impacts the content of ProposalResponsePayload.proposalHash.
The ID of the chaincode to target.
ChaincodeID contains the path as specified by the deploy transaction that created it as well as the hashCode that is generated by the system for the path. From the user level (ie, CLI, REST API and so on) deploy transaction is expected to provide the path and other requests are expected to provide the hashCode. The other value will be ignored. Internally, the structure could contain both values. For instance, the hashCode will be set when first generated using the path
Used in:
, ,deploy transaction will use the path
all other requests will use the name (really a hashcode) generated by the deploy transaction
user friendly version name for the chaincode
ChaincodeInfo contains general information about an installed/instantiated chaincode
Used in:
the path as specified by the install/instantiate transaction
the chaincode function upon instantiation and its arguments. This will be blank if the query is returning information about installed chaincodes.
the name of the ESCC for this chaincode. This will be blank if the query is returning information about installed chaincodes.
the name of the VSCC for this chaincode. This will be blank if the query is returning information about installed chaincodes.
Carries the chaincode function and its arguments. UnmarshalJSON in transaction.go converts the string-based REST/JSON input to the []byte-based current ChaincodeInput structure.
Used in:
Carries the chaincode function and its arguments.
This field can contain a user-specified ID generation algorithm If supplied, this will be used to generate a ID If not supplied (left empty), sha256base64 will be used The algorithm consists of two parts: 1, a hash function 2, a decoding used to decode user (string) input to bytes Currently, SHA256 with BASE64 is supported (e.g. idGenerationAlg='sha256base64')
ChaincodeProposalPayload is the Proposal's payload message to be used when the Header's type is CHAINCODE. It contains the arguments for this invocation.
Input contains the arguments for this invocation. If this invocation deploys a new chaincode, ESCC/VSCC are part of this field. This is usually a marshaled ChaincodeInvocationSpec
TransientMap contains data (e.g. cryptographic material) that might be used to implement some form of application-level confidentiality. The contents of this field are supposed to always be omitted from the transaction and excluded from the ledger.
ChaincodeQueryResponse returns information about each chaincode that pertains to a query in lscc.go, such as GetChaincodes (returns all chaincodes instantiated on a channel), and GetInstalledChaincodes (returns all chaincodes installed on a peer)
ChaincodeReg is used for registering chaincode Interests when EventType is CHAINCODE
Used in:
Carries the chaincode specification. This is the actual metadata required for defining a chaincode.
Used in:
,Used in:
ChannelInfo contains general information about channels
Used in:
ChannelQueryResponse returns information about each channel that pertains to a query in lscc.go, such as GetChannels (returns all channels for a given peer)
Confidentiality Levels
An endorsement is a signature of an endorser over a proposal response. By producing an endorsement message, an endorser implicitly "approves" that proposal response and the actions contained therein. When enough endorsements have been collected, a transaction can be generated out of a set of proposal responses. Note that this message only contains an identity and a signature but no signed payload. This is intentional because endorsements are supposed to be collected in a transaction, and they are all expected to endorse a single proposal response/action (many endorsements over a single proposal response)
Used in:
,Identity of the endorser (e.g. its certificate)
Signature of the payload included in ProposalResponse concatenated with the endorser's certificate; ie, sign(ProposalResponse.payload + endorser)
Used in:
Used in:
,Ideally we should just have the following oneof for different Reg types and get rid of EventType. But this is an API change Additional Reg types may add messages specific to their type to the oneof.
Used in:
ProcessedTransaction wraps an Envelope that includes a transaction along with an indication of whether the transaction was validated or invalidated by committing peer. The use case is that GetTransactionByID API needs to retrieve the transaction Envelope from block storage, and return it to a client, and indicate whether the transaction was validated or invalidated by committing peer. So that the originally submitted transaction Envelope is not modified, the ProcessedTransaction wrapper is returned.
An Envelope which includes a processed transaction
An indication of whether the transaction was validated or invalidated by committing peer
A Proposal is sent to an endorser for endorsement. The proposal contains: 1. A header which should be unmarshaled to a Header message. Note that Header is both the header of a Proposal and of a Transaction, in that i) both headers should be unmarshaled to this message; and ii) it is used to compute cryptographic hashes and signatures. The header has fields common to all proposals/transactions. In addition it has a type field for additional customization. An example of this is the ChaincodeHeaderExtension message used to extend the Header for type CHAINCODE. 2. A payload whose type depends on the header's type field. 3. An extension whose type depends on the header's type field. Let us see an example. For type CHAINCODE (see the Header message), we have the following: 1. The header is a Header message whose extensions field is a ChaincodeHeaderExtension message. 2. The payload is a ChaincodeProposalPayload message. 3. The extension is a ChaincodeAction that might be used to ask the endorsers to endorse a specific ChaincodeAction, thus emulating the submitting peer model.
The header of the proposal. It is the bytes of the Header
The payload of the proposal as defined by the type in the proposal header.
Optional extensions to the proposal. Its content depends on the Header's type field. For the type CHAINCODE, it might be the bytes of a ChaincodeAction message.
ProposalResponsePayload is the payload of a proposal response. This message is the "bridge" between the client's request and the endorser's action in response to that request. Concretely, for chaincodes, it contains a hashed representation of the proposal (proposalHash) and a representation of the chaincode state changes and events inside the extension field.
Hash of the proposal that triggered this response. The hash is used to link a response with its proposal, both for bookeeping purposes on an asynchronous system and for security reasons (accountability, non-repudiation). The hash usually covers the entire Proposal message (byte-by-byte). However this implies that the hash can only be verified if the entire proposal message is available when ProposalResponsePayload is included in a transaction or stored in the ledger. For confidentiality reasons, with chaincodes it might be undesirable to store the proposal payload in the ledger. If the type is CHAINCODE, this is handled by separating the proposal's header and the payload: the header is always hashed in its entirety whereas the payload can either be hashed fully, or only its hash may be hashed, or nothing from the payload can be hashed. The PayloadVisibility field in the Header's extension controls to which extent the proposal payload is "visible" in the sense that was just explained.
Extension should be unmarshaled to a type-specific message. The type of the extension in any proposal response depends on the type of the proposal that the client selected when the proposal was initially sent out. In particular, this information is stored in the type field of a Header. For chaincode, it's a ChaincodeAction message
---------- consumer events --------- Register is sent by consumers for registering events string type - "register"
Used in:
Rejection is sent by consumers for erroneous transaction rejection events string type - "rejection"
Used in:
A response with a representation similar to an HTTP response that can be used within another message.
Used in:
,A status code that should follow the HTTP status codes.
A message associated with the response code.
A payload that can be used to include metadata with this response.
This message is necessary to facilitate the verification of the signature (in the signature field) over the bytes of the transaction (in the transactionBytes field).
The bytes of the Transaction. NDD
Signature of the transactionBytes The public key of the signature is in the header field of TransactionAction There might be multiple TransactionAction, so multiple headers, but there should be same transactor identity (cert) in all headers
The transaction to be sent to the ordering service. A transaction contains one or more TransactionAction. Each TransactionAction binds a proposal to potentially multiple actions. The transaction is atomic meaning that either all actions in the transaction will be committed or none will. Note that while a Transaction might include more than one Header, the Header.creator field must be the same in each. A single client is free to issue a number of independent Proposal, each with their header (Header) and request payload (ChaincodeProposalPayload). Each proposal is independently endorsed generating an action (ProposalResponsePayload) with one signature per Endorser. Any number of independent proposals (and their action) might be included in a transaction to ensure that they are treated atomically.
Used in:
The payload is an array of TransactionAction. An array is necessary to accommodate multiple actions per transaction
TransactionAction binds a proposal to its action. The type field in the header dictates the type of action to be applied to the ledger.
Used in:
The header of the proposal action, which is the proposal header
The payload of the action as defined by the type in the header For chaincode, it's the bytes of ChaincodeActionPayload
---------- producer events ---------
Used in: