From 2476a888e1897fa9ce88b291078b16f141f795bb Mon Sep 17 00:00:00 2001 From: Ivan S Date: Sat, 23 Nov 2024 10:12:04 +0800 Subject: [PATCH] block processing log --- main/src/modules/BlockProcessor/service.ts | 32 +++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/main/src/modules/BlockProcessor/service.ts b/main/src/modules/BlockProcessor/service.ts index 6b64279c..123a43db 100644 --- a/main/src/modules/BlockProcessor/service.ts +++ b/main/src/modules/BlockProcessor/service.ts @@ -137,6 +137,12 @@ export class BlocksProcessorService { blockHash, ) + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Info for block processing fetched ${blockId}`, + }) + const extrinsicsData: ExtrinsicsProcessorInput = { // eraId: activeEra, // epochId: epoch, @@ -145,9 +151,18 @@ export class BlocksProcessorService { extrinsics: signedBlock.block.extrinsics, } const extractedExtrinsics = await this.processExtrinsics(extrinsicsData) + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Extrinsics for block processed: ${blockId}`, + }) const processedEvents = this.processEvents(signedBlock.block.header.number.toNumber(), events) - + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Events for block processed: ${blockId}`, + }) // const lastDigestLogEntryIndex = signedBlock.block.header.digest.logs.length - 1 const block: BlockModel = { @@ -188,15 +203,30 @@ export class BlocksProcessorService { }) } } + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Exitrinsics transaction prepared: ${blockId}`, + }) // console.log(blockId + ': extrinsics saved') for (const event of processedEvents) { await this.databaseHelper.saveEvent(trx, event) } + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Events transaction prepared: ${blockId}`, + }) // console.log(blockId + ': events saved') await this.databaseHelper.saveBlock(trx, block) + this.logger.info({ + event: 'BlockProcessor.processBlock', + blockId, + message: `Block transaction prepared: ${blockId}`, + }) await this.databaseHelper.saveTotalIssuance(trx, block.block_id, totalIssuance.toString(10))