How to use the fabric-client.buildTransactionID function in fabric-client

To help you get started, we’ve selected a few fabric-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / fabric / test / tools / PTE / pte-execRequest.js View on Github external
function getMoveRequest() {
    if ( ccType == 'ccchecker') {
        arg0 ++;
        testInvokeArgs[1] = 'key_'+channelName+'_'+org+'_'+Nid+'_'+pid+'_'+arg0;
        // random payload
        var r = Math.floor(Math.random() * (payLoadMax - payLoadMin)) + payLoadMin;

        var buf = crypto.randomBytes(r);
        testInvokeArgs[2] = buf.toString('hex');
    }
    //console.log('d:id:chan:org=%d:%d:%s:%s getMoveRequest] testInvokeArgs[1]', Nid, pid, channelName, org, testInvokeArgs[1]);

    nonce = utils.getNonce();
    tx_id = hfc.buildTransactionID(nonce, the_user);
    utils.setConfigSetting('E2E_TX_ID', tx_id);
    logger.info('setConfigSetting("E2E_TX_ID") = %s', tx_id);

    request_invoke = {
        chaincodeId : chaincode_id,
        chaincodeVersion : chaincode_ver,
        chainId: channelName,
        fcn: uiContent.invoke.move.fcn,
        args: testInvokeArgs,
        txId: tx_id,
        nonce: nonce
    };


    if ( inv_m == nRequest ) {
        if (invokeCheck.toUpperCase() == 'TRUE') {
github hyperledger / fabric / test / tools / PTE / pte-execRequest.js View on Github external
function getQueryRequest() {
    if ( ccType == 'ccchecker') {
        arg0 ++;
        testQueryArgs[1] = 'key_'+channelName+'_'+org+'_'+Nid+'_'+pid+'_'+arg0;
    }
    //console.log('d:id:chan:org=%d:%d:%s:%s getQueryRequest] testQueryArgs[1]', Nid, pid, channelName, org, testQueryArgs[1]);

    nonce = utils.getNonce();
    tx_id = hfc.buildTransactionID(nonce, the_user);
    request_query = {
        chaincodeId : chaincode_id,
        chaincodeVersion : chaincode_ver,
        chainId: channelName,
        txId: tx_id,
        nonce: nonce,
        fcn: uiContent.invoke.query.fcn,
        args: testQueryArgs
    };

    //console.log('request_query: ', request_query);
}