This commit is contained in:
Prema 2019-08-28 12:07:53 +05:30
commit 980c82e2a6
2 changed files with 39 additions and 39 deletions

View File

@ -394,41 +394,41 @@ export class BlockchainBlockController {
this.BlockPieChart, this.BlockPieChart,
); );
/** // /**
* @swagger // * @swagger
* /epic_explorer/v1/blockchain_block/hashrate: // * /epic_explorer/v1/blockchain_block/hashrate:
* get: // * get:
* tags: // * tags:
* - name: BLOCKCHAIN_BLOCK | BLOCKCHAIN_BLOCK CONTROLLER // * - name: BLOCKCHAIN_BLOCK | BLOCKCHAIN_BLOCK CONTROLLER
* description: To get Hash Rate of AR29 abd AT31 // * description: To get Hash Rate of AR29 abd AT31
* summary: To get Hash Rate of AR29 abd AT31 // * summary: To get Hash Rate of AR29 abd AT31
* consumes: // * consumes:
* - application/json // * - application/json
* produces: // * produces:
* - application/json // * - application/json
* parameters: // * parameters:
* - name: FromDate // * - name: FromDate
* description: Enter the From date // * description: Enter the From date
* in: query // * in: query
* type: string // * type: string
* - name: ToDate // * - name: ToDate
* description: Enter the To date // * description: Enter the To date
* in: query // * in: query
* type: string // * type: string
* - name: Interval // * - name: Interval
* description: Try to give Intevals such as 1 week/ 15 days/ 30 days/ 60 days/ 3 months // * description: Try to give Intevals such as 1 week/ 15 days/ 30 days/ 60 days/ 3 months
* in: query // * in: query
* type: string // * type: string
* responses: // * responses:
* 200: // * 200:
* description: Hash Rate of AR29 abd AT31 fetched successfully // * description: Hash Rate of AR29 abd AT31 fetched successfully
*/ // */
this.router.get( // this.router.get(
`${this.path}/hashrate`, // `${this.path}/hashrate`,
validationMiddleware(TotalDifficultyNBlockDto, true), // validationMiddleware(TotalDifficultyNBlockDto, true),
redisMiddleware(process.env.REDIS_EXPIRY), // redisMiddleware(process.env.REDIS_EXPIRY),
this.HashRate, // this.HashRate,
); // );
/** /**
* @swagger * @swagger

View File

@ -720,10 +720,10 @@ sum(bk.block_id_count) AS kernal_count, \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_input group by block_id) as bi \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_input group by block_id) as bi \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bi.block_id \ bi.block_id \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_kernel group by block_id) as bk \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_kernel where features != 'Coinbase' group by block_id) as bk \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bk.block_id \ bk.block_id \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_output group by block_id) as bo \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_output where output_type != 'Coinbase' group by block_id) as bo \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bo.block_id WHERE blockchain_block.timestamp >= '" + bo.block_id WHERE blockchain_block.timestamp >= '" +
fromdate + fromdate +
@ -858,10 +858,10 @@ sum(bk.block_id_count) AS kernal_count, \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_input group by block_id) as bi \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_input group by block_id) as bi \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bi.block_id \ bi.block_id \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_kernel group by block_id) as bk \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_kernel where features != 'Coinbase' group by block_id) as bk \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bk.block_id \ bk.block_id \
LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_output group by block_id) as bo \ LEFT JOIN (select block_id, count(block_id) as block_id_count from blockchain_output where output_type != 'Coinbase' group by block_id) as bo \
ON blockchain_block.hash = \ ON blockchain_block.hash = \
bo.block_id WHERE " + bo.block_id WHERE " +
timeIntervalQry + timeIntervalQry +