tools/PTE/pte-execRequest.js
// assign Orderer List for orderer failover
assign Orderer List for orderer failover
assign Orderer List for orderer failover
function assignOrdererList(channel, client) {
    logger.info('[Nid:chan:org:id=%d:%s:%s:%d assignOrdererList] ', Nid, channelName, org, pid);
    var data;
    var ordererTmp;
    for (let key in orderersCPFList) {
        if (orderersCPFList[key].url) {
            if (TLS > testUtil.TLSDISABLED) {
                data = testUtil.getTLSCert('orderer', key, cpf, cpPath);
                if (data !== null) {
                    let caroots = Buffer.from(data).toString();
                    ordererTmp = client.newOrderer(
                        orderersCPFList[key].url,
                        {
                            pem: caroots,
                            'ssl-target-name-override': orderersCPFList[key]['grpcOptions']['ssl-target-name-override']
                        }
                    )
                    ordererList.push(ordererTmp);
                }
            } else {
                ordererTmp = client.newOrderer(orderersCPFList[key].url);
                ordererList.push(ordererTmp);
            }
        }
    }
    logger.info('[Nid:chan:org:id=%d:%s:%s:%d assignOrdererList] orderer list: %s', Nid, channelName, org, pid, ordererList);
}
function assignOrdererList ( channel , client ) { logger . info ( '[Nid:chan:org:id=%d:%s:%s:%d assignOrdererList] ' , Nid , channelName , org , pid ) ; var data ; var ordererTmp ; for ( let key in orderersCPFList ) { if ( orderersCPFList [ key ] . url ) { if ( TLS > testUtil . TLSDISABLED ) { data = testUtil . getTLSCert ( 'orderer' , key , cpf , cpPath ) ; if ( data !== null ) { let caroots = Buffer . from ( data ) . toString ( ) ; ordererTmp = client . newOrderer ( orderersCPFList [ key ] . url , { pem : caroots , 'ssl-target-name-override' : orderersCPFList [ key ] [ 'grpcOptions' ] [ 'ssl-target-name-override' ] } ) ordererList . push ( ordererTmp ) ; } } else { ordererTmp = client . newOrderer ( orderersCPFList [ key ] . url ) ; ordererList . push ( ordererTmp ) ; } } } logger . info ( '[Nid:chan:org:id=%d:%s:%s:%d assignOrdererList] orderer list: %s' , Nid , channelName , org , pid , ordererList ) ; }
assign Orderer List for orderer failover
assign Orderer List for orderer failover