Class: Commit

Commit

This class represents an Commit definition. This class allows an application to contain all proposal attributes and artifacts in one place during an endorsement commit.

new Commit(chaincodeId, channel)

Construct a Proposal object.
Parameters:
Name Type Description
chaincodeId string The chaincode this proposal will execute
channel Channel The channel of this proposal
Returns:
The Proposal instance.
Type
Proposal

Methods


build( [idContext], request)

This method is used to build the protobuf objects of the commit. The commit must next be signed before being sent to be committed.
Parameters:
Name Type Argument Description
idContext IdentityContext <optional>
The context is not used and is only specified here to be consistent with other ServiceAction build method calls.
request CommitBuildRequest The commit options of the request.
Returns:
The commits payload bytes to be signed.
Type
Array.<byte>

<async> send(request)

Send the proposal responses that contain the endorsements of a transaction proposal to an committer for further processing. This is the 2nd phase of the transaction lifecycle in the fabric. The committer will globally order the transactions in the context of this channel and deliver the resulting blocks to the committing peers for validation against the chaincode's endorsement policy. When the committing peers successfully validate the transactions, it will mark the transaction as valid inside the block. After all transactions in a block have been validated, and marked either as valid or invalid (with a reason code), the block will be appended (committed) to the channel's ledger on the peer.

This method will use the proposal responses returned from the Proposal#endorse along with the proposal that was sent for endorsement.
Parameters:
Name Type Description
request CommitSendRequest CommitRequest
Returns:
commit results

toString()

return a printable representation of this object