tools/PTE/pte-util.js
// find the name of the org that contains the peer
find the name of the org that contains the peer
find the name of the org that contains the peer
function findOrgnameFromPeer(fileList, peerName) {
    for (i = 0; i < fileList.length; i++) {
        let cpf = fileList[i];
        let temp = readConfigFile(cpf, 'test-network');
        let organzation;
        if (!isEmpty(temp['organizations'])) {
            peerOrg = temp['organizations'];
            for (let org in peerOrg) {
                if (!isEmpty(peerOrg[org]['peers']) && peerOrg[org]['peers'].includes(peerName)) {
                    logger.info('find peer(%s) in org(%s)', peerName, org);
                    return org;
                }
            }
        }
    }
    return null;
}
function findOrgnameFromPeer ( fileList , peerName ) { for ( i = 0 ; i < fileList . length ; i ++ ) { let cpf = fileList [ i ] ; let temp = readConfigFile ( cpf , 'test-network' ) ; let organzation ; if ( ! isEmpty ( temp [ 'organizations' ] ) ) { peerOrg = temp [ 'organizations' ] ; for ( let org in peerOrg ) { if ( ! isEmpty ( peerOrg [ org ] [ 'peers' ] ) && peerOrg [ org ] [ 'peers' ] . includes ( peerName ) ) { logger . info ( 'find peer(%s) in org(%s)' , peerName , org ) ; return org ; } } } } return null ; }
find the name of the org that contains the peer
find the name of the org that contains the peer