Endorsement Support in Postman Collections

Oracle Blockchain Platform Digital Assets Edition adds support for endorsement parameters to the Postman collections generated by Blockchain App Builder.

Blockchain App Builder enables you to create a Postman collection that includes example payloads for all of your chaincode controller APIs. For more information, see Generate a Postman Collection Using the CLI and Generate a Postman Collection Using Visual Studio Code.

Oracle Blockchain Platform Digital Assets Edition extends that functionality by including an additional parameter in the request payload for all setter methods. The new parameter is either endorsers or sameOrgEndorser. The sameOrgEndorser parameter, if true, indicates that transaction endorsements must be from the same organization as the requester. The endorsers parameter specifies a list of peers that must endorse the transaction.

The sameOrgEndorserOptionInWrapperAPI parameter in the .ochain.json file in the chaincode specifies which APIs require a sameOrgEndorser value. APIs that are associated with the sameOrgEndorserOptionInWrapperAPI parameter have the sameOrgEndorser parameter set to true in their payloads. All other APIs include the endorsers parameter instead of the sameOrgEndorser parameter.

The following snippet shows the sameOrgEndorserOptionInWrapperAPI parameter in the .ochain.json file in the wholesale CBDC chaincode package.
"sameOrgEndorserOptionInWrapperAPI": ["addConversionRate","addTokenAdmin","addTokenAuditor","approveBurn","approveMint","burnTokens","createExchangePoolAccounts","deleteHistoricalTransactions","initializeCBDCToken","initializeExchangePoolUser","issueTokens","mintWithFundingExchangePool","rejectBurn","rejectMint","removeTokenAdmin","removeTokenAuditor","requestBurn","requestMint","updateCBDCToken","updateConversionRate"]
You can customize this parameter as needed. When the wrapper API is generated, the specified APIs will have the sameOrgEndorser parameter set to true in their payloads.

The following example payloads show these endorsement parameters.

addOrgAdmin
{
    "chaincode": "{{bc-chaincode-name}}",
    "args": [
        "addOrgAdmin",
        "{{bc-org-id}}",
        "{{bc-user-id}}"
    ],
    "timeout": {{bc-timeout}},
    "sync": {{bc-sync}},
    "endorsers": {{endorsers}}
}
addTokenAdmin
{
    "chaincode": "{{bc-chaincode-name}}",
    "args": [
        "addTokenAdmin",
        "{{bc-org-id}}",
        "{{bc-user-id}}"
    ],
    "timeout": {{bc-timeout}},
    "sync": {{bc-sync}},
    "sameOrgEndorser": true
}