tools/PTE/pte-execRequest.js
// assign peer list from all org for peer failover
assign peer list from all org for peer failover
assign peer list from all org for peer failover
function assignPeerList(channel, client, org) {
    logger.info('[Nid:chan:id=%d:%s:%d assignPeerList]', Nid, channel.getName(), pid);
    var peerTmp;
    var eh;
    var data;
    for (let orgtmp in cpOrgs) {
        for (let i = 0; i < cpOrgs[orgtmp]['peers'].length; i++) {
            var key = cpOrgs[orgtmp]['peers'][i];
            if (cpPeers.hasOwnProperty(key)) {
                if (cpPeers[key].url) {
                    if (TLS > testUtil.TLSDISABLED) {
                        data = testUtil.getTLSCert(orgtmp, key, cpf, cpPath);
                        if (data !== null) {
                            peerTmp = client.newPeer(
                                cpPeers[key].url,
                                {
                                    pem: Buffer.from(data).toString(),
                                    'ssl-target-name-override': cpPeers[key]['grpcOptions']['ssl-target-name-override']
                                }
                            );
                            peerList.push(peerTmp);
                        }
                    } else {
                        peerTmp = client.newPeer(cpPeers[key].url);
                        peerList.push(peerTmp);
                    }
                }
            }
        }
    }
    logger.info('[Nid:chan:id=%d:%s:%d assignPeerList] peerList', Nid, channel.getName(), pid, peerList);
}
function assignPeerList ( channel , client , org ) { logger . info ( '[Nid:chan:id=%d:%s:%d assignPeerList]' , Nid , channel . getName ( ) , pid ) ; var peerTmp ; var eh ; var data ; for ( let orgtmp in cpOrgs ) { for ( let i = 0 ; i < cpOrgs [ orgtmp ] [ 'peers' ] . length ; i ++ ) { var key = cpOrgs [ orgtmp ] [ 'peers' ] [ i ] ; if ( cpPeers . hasOwnProperty ( key ) ) { if ( cpPeers [ key ] . url ) { if ( TLS > testUtil . TLSDISABLED ) { data = testUtil . getTLSCert ( orgtmp , key , cpf , cpPath ) ; if ( data !== null ) { peerTmp = client . newPeer ( cpPeers [ key ] . url , { pem : Buffer . from ( data ) . toString ( ) , 'ssl-target-name-override' : cpPeers [ key ] [ 'grpcOptions' ] [ 'ssl-target-name-override' ] } ) ; peerList . push ( peerTmp ) ; } } else { peerTmp = client . newPeer ( cpPeers [ key ] . url ) ; peerList . push ( peerTmp ) ; } } } } } logger . info ( '[Nid:chan:id=%d:%s:%d assignPeerList] peerList' , Nid , channel . getName ( ) , pid , peerList ) ; }
assign peer list from all org for peer failover
assign peer list from all org for peer failover