tools/PTE/pte-snapshot.js
/**
 * commands to fetch snapshot generation timestamps
 *
 * @param {string} peer The peer name
 * @param {insteger} blk The block number
 * @param {boolean} isKube The isKube environment
 * @returns {object} The object of two commands to fetch snapshot generating and generated timestamps
 */
commands to fetch snapshot generation timestamps
@param {string} peer The peer name
@param {insteger} blk The block number
@param {boolean} isKube The isKube environment
@returns {object} The object of two commands to fetch snapshot generating and generated timestamps
commands to fetch snapshot generation timestamps @param { string } peer The peer name @param { insteger } blk The block number @param { boolean } isKube The isKube environment @returns { object } The object of two commands to fetch snapshot generating and generated timestamps
async function genTimeCmd(peer, blk, isKube) {
    let cmd;
    if (isKube) {
        cmd = `kubectl logs ${peer}-0 -c ${peer} | grep snapshot`;
    } else {
        cmd = `docker logs ${peer} 2>&1 | grep snapshot`;
    }
    let subcmd1 = `${cmd} | grep Generating | grep =${blk}`;
    let subcmd2 = `${cmd} | grep Generated | grep =${blk}`;
    return {subcmd1, subcmd2};
}
async function genTimeCmd ( peer , blk , isKube ) { let cmd ; if ( isKube ) { cmd = ` ${ peer } ${ peer } ` ; } else { cmd = ` ${ peer } ` ; } let subcmd1 = ` ${ cmd } ${ blk } ` ; let subcmd2 = ` ${ cmd } ${ blk } ` ; return { subcmd1 , subcmd2 } ; }
commands to fetch snapshot generation timestamps
 @param {string} peer The peer name
 @param {insteger} blk The block number
 @param {boolean} isKube The isKube environment
 @returns {object} The object of two commands to fetch snapshot generating and generated timestamps
commands to fetch snapshot generation timestamps @param { string } peer The peer name @param { insteger } blk The block number @param { boolean } isKube The isKube environment @returns { object } The object of two commands to fetch snapshot generating and generated timestamps