Get desktop application:
View/edit binary Protocol Buffers messages
Interface exported by the server.
Chaincode as a server - peer establishes a connection to the chaincode as a client Currently only supports a stream connection.
Interface that provides support to chaincode execution. ChaincodeContext provides the context necessary for the server to respond appropriately.
Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, then a stream of block replies is received
DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, then a stream of **filtered** block replies is received
DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with Payload data as a marshaled orderer.SeekInfo message, then a stream of block and private data replies is received
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
Generate a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest
Cancel a snapshot reqeust. SignedSnapshotRequest contains marshalled bytes for SnaphostRequest
Query pending snapshots query. SignedSnapshotRequest contains marshalled bytes for SnaphostQuery
QueryPendingSnapshotsResponse specifies the response payload of a query pending snapshots request
ACLs provides mappings for resources in a channel. APIResource encapsulates reference to a policy used to determine ACL for the resource
APIResource represents an API resource in the peer whose ACL is determined by the policy_ref field
Used in:
The policy name to use for this API
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
ApplicationPolicy captures the diffenrent policy types that are set and evaluted at the application level.
Used in:
SignaturePolicy type is used if the policy is specified as a combination (using threshold gates) of signatures from MSP principals
ChannelConfigPolicyReference is used when the policy is specified as a string that references a policy defined in the configuration of the channel
BlockAndPrivateData contains Block and a map from tx_seq_in_block to rwset.TxPvtReadWriteSet
Used in:
map from tx_seq_in_block to rwset.TxPvtReadWriteSet
CDSData is data stored in the LSCC on instantiation of a CC for CDSPackage. This needs to be serialized for ChaincodeData hence the protobuf format
hash of ChaincodeDeploymentSpec.code_package
hash of ChaincodeID.name + ChaincodeID.version
ChaincodeAction contains the executed chaincode results, response, and event.
This field contains the read set and the write set produced by the chaincode executing this invocation.
This field contains the event generated by the chaincode. Only a single marshaled ChaincodeEvent is included.
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
ChaincodeData defines the datastructure for chaincodes to be serialized by proto Type provides an additional check by directing to use a specific package after instantiation Data is Type specific (see CDSPackage and SignedCDSPackage)
Name of the chaincode
Version of the chaincode
Escc for the chaincode instance
Vscc for the chaincode instance
Policy endorsement policy for the chaincode instance
Data data specific to the package
Id of the chaincode that's the unique fingerprint for the CC This is not currently used anywhere but serves as a good eyecatcher
InstantiationPolicy for the chaincode
Specify the deployment of a chaincode. TODO: Define `codePackage`.
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
ChaincodeEndorsement instructs the peer how transactions should be endorsed. The only endorsement mechanism which ships with the fabric today is the standard 'escc' mechanism. This code simply simulates the proposal to generate a RW set, then signs the result using the peer's local signing identity.
Specifies what code to run for endorsements, defaults 'escc'
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 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
ChaincodeIdentifier identifies a piece of chaincode. For a peer to accept invocations of this chaincode, the hash of the installed code must match, as must the version string included with the install command.
The hash of the chaincode bytes
A user friendly human readable name corresponding to the ID
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.
the chaincode unique id. computed as: H( H(name || version) || H(CodePackage) )
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:
is_init is used for the application to signal that an invocation is to be routed to the legacy 'Init' function for compatibility with chaincodes which handled Init in the old way. New applications should manage their initialized state themselves.
Carries the chaincode function and its arguments.
Used as request type in: Chaincode.Connect, ChaincodeSupport.Register
Used as response type in: Chaincode.Connect, ChaincodeSupport.Register
event emitted by chaincode. Used only with Init or Invoke. This event is then stored (currently) with Block.NonHashData.TransactionResult
channel id
Used in:
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)
Carries the chaincode specification. This is the actual metadata required for defining a chaincode.
Used in:
,Used in:
ChaincodeValidation instructs the peer how transactions for this chaincode should be validated. The only validation mechanism which ships with fabric today is the standard 'vscc' validation mechanism. This built in validation method utilizes an endorsement policy which checks that a sufficient number of signatures have been included. The 'arguement' field encodes any parameters required by the validation implementation.
Specifies which code to run to validate transactions, defaults to 'vscc'
When 'vscc' a marshaled VSCCArgs
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)
CollectionConfig defines the configuration of a collection object; it currently contains a single, static type. Dynamic collections are deferred.
Used in:
CollectionConfigPackage represents an array of CollectionConfig messages; the extra struct is required because repeated oneof is forbidden by the protobuf syntax
Used in:
, , , , , , ,Collection policy configuration. Initially, the configuration can only contain a SignaturePolicy. In the future, the SignaturePolicy may be a more general Policy. Instead of containing the actual policy, the configuration may in the future contain a string reference to a policy.
Used in:
Initially, only a signature policy is supported.
Later, the SignaturePolicy will be replaced by a Policy. Policy policy = 1; A reference to a Policy is planned to be added later. string reference = 2;
ConfigTree encapsulates channel and resources configuration of a channel. Both configurations are represented as common.Config
DelState is the payload of a ChaincodeMessage. It contains a key which needs to be recorded in the transaction's write set as a delete operation. If the collection is specified, the key needs to be recorded in the transaction's private write set as a delete operation.
DeliverResponse
Used as response type in: Deliver.Deliver, Deliver.DeliverFiltered, Deliver.DeliverWithPrivateData
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)
FilteredBlock is a minimal set of information about a block
Used in:
The position in the blockchain
FilteredChaincodeAction is a minimal set of information about an action within a transaction
Used in:
FilteredTransaction is a minimal set of information about a transaction within a block
Used in:
FilteredTransactionActions is a wrapper for array of TransactionAction message from regular block
Used in:
GetHistoryForKey is the payload of a ChaincodeMessage. It contains a key for which the historical values need to be retrieved.
GetQueryResult is the payload of a ChaincodeMessage. It contains a query string in the form that is supported by the underlying state database. If the collection is specified, the query needs to be executed on the private data. The metadata hold the byte representation of QueryMetadata.
GetState is the payload of a ChaincodeMessage. It contains a key which is to be fetched from the ledger. If the collection is specified, the key would be fetched from the collection (i.e., private state)
GetStateByRange is the payload of a ChaincodeMessage. It contains a start key and a end key required to execute range query. If the collection is specified, the range query needs to be executed on the private data. The metadata hold the byte representation of QueryMetadata.
JoinBySnapshotStatus contains information about whether or a JoinBySnapshot operation is in progress and the related bootstrap dir if it is running.
LifecycleEvent is used as the payload of the chaincode event emitted by LSCC
Used in:
Used as response type in: Admin.GetModuleLogLevel, Admin.SetModuleLogLevel
Used in:
Used as response type in: Admin.GetLogSpec, Admin.SetLogSpec
Reserved entries in the key-level metadata map
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).
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
PutState is the payload of a ChaincodeMessage. It contains a key and value which needs to be written to the transaction's write set. If the collection is specified, the key and value would be written to the transaction's private write set.
QueryMetadata is the metadata of a GetStateByRange and GetQueryResult. It contains a pageSize which denotes the number of records to be fetched and a bookmark.
QueryResponse is returned by the peer as a result of a GetStateByRange, GetQueryResult, and GetHistoryForKey. It holds a bunch of records in results field, a flag to denote whether more results need to be fetched from the peer in has_more field, transaction id in id field, and a QueryResponseMetadata in metadata field.
QueryResponseMetadata is the metadata of a QueryResponse. It contains a count which denotes the number of records fetched from the ledger and a bookmark.
QueryResultBytes hold the byte representation of a record returned by the peer.
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.
Used as response type in: Admin.GetStatus, Admin.StartServer
Used in:
SignedChaincodeDeploymentSpec carries the CDS along with endorsements
This is the bytes of the ChaincodeDeploymentSpec
This is the instantiation policy which is identical in structure to endorsement policy. This policy is checked by the VSCC at commit time on the instantiation (all peers will get the same policy as it will be part of the LSCC instantation record and will be part of the hash as well)
The endorsements of the above deployment spec, the owner's signature over chaincode_deployment_spec and Endorsement.endorser.
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;
Used as request type in: Endorser.ProcessProposal
Used as field type in:
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
SignedSnapshotRequest contains marshalled request bytes and signature
Used as request type in: Snapshot.Cancel, Snapshot.Generate, Snapshot.QueryPendings
The bytes of SnapshotRequest or SnapshotQuery
Signaure over request bytes; this signature is to be verified against the client identity
SnapshotQuery contains information for a query snapshot request
The signature header that contains creator identity and nonce
The channel ID
SnapshotRequest contains information for a generate/cancel snapshot request
The signature header that contains creator identity and nonce
The channel ID
The block number to generate a snapshot
Used in:
,StaticCollectionConfig constitutes the configuration parameters of a static collection object. Static collections are collections that are known at chaincode instantiation time, and that cannot be changed. Dynamic collections are deferred.
Used in:
the name of the collection inside the denoted chaincode
a reference to a policy residing / managed in the config block to define which orgs have access to this collection’s private data
The minimum number of peers private data will be sent to upon endorsement. The endorsement would fail if dissemination to at least this number of peers is not achieved.
The maximum number of peers that private data will be sent to upon endorsement. This number has to be bigger than required_peer_count.
The number of blocks after which the collection data expires. For instance if the value is set to 10, a key last modified by block number 100 will be purged at block number 111. A zero value is treated same as MaxUint64
The member only read access denotes whether only collection member clients can read the private data (if set to true), or even non members can read the data (if set to false, for example if you want to implement more granular access logic in the chaincode)
The member only write access denotes whether only collection member clients can write the private data (if set to true), or even non members can write the data (if set to false, for example if you want to implement more granular access logic in the chaincode)
a reference to a policy residing / managed in the config block to define the endorsement policy for this collection
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.
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
Used in:
VSCCArgs is passed (marshaled) as a parameter to the VSCC imlementation via the argument field of the ChaincodeValidation message.
A named reference to an endorsement policy,