-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Boottime Feature #439
Adding Boottime Feature #439
Conversation
8871e56
to
4dde9e4
Compare
} | ||
} | ||
|
||
const missingBlocks = await this.persistence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check whether data is flowing through the missingBlocks section. since when we have new blocks added, latest blocks are also synced and added into db in the above section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, data is flowing through the missingBlocks section as expected. As new blocks are added, the latest blocks are being synced and added into the database in the above section without any issues. Everything seems to be working as expected.
|
||
// Syncing Details | ||
logger.info( | ||
`Syncing blocks from ${startingBlockHeight} to ${latestBlockHeight}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the condition when number of blocks in config.json is greater than the number of blocks in ledger.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been handled. if the blocks that are mentioned in the config.json file, is greater than the blocks available, it will sync the blocks that are available at that point of time.
blockHeight | ||
); | ||
if (block) { | ||
await this.processBlockEvent(client, block, noDiscovery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before calling processBlockEvent, can you please check block is available in db. If not you can add.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed this by adding a conditional check in the code. Now, before calling processBlockEvent, we verify whether the block is available in the database. If the block is not present, we add it as needed. This check ensures that processBlockEvent is only executed when the required data is available in the database, helping to maintain the integrity as expected.
hi @Web-Dev-Manoj , |
14019ca
to
37968d4
Compare
"name": "Test Network", | ||
"profile": "./connection-profile/test-network.json", | ||
"enableAuthentication": false, | ||
"bootMode": "ALL", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the "noOfBlocks" as "0" in ALL mode as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added, noOfBlocks parameter as "0" below "ALL" mode also.
@@ -540,6 +564,22 @@ export class CRUDService { | |||
} | |||
// Orderer BE-303 | |||
|
|||
/** | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add what this function returns here for better understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added what the function is returning as mentioned.
* @memberof CRUDService | ||
*/ | ||
async isBlockAvailableInDB(channel_genesis_hash: string, blockHeight: any) { | ||
const count: any = await this.sql.getRowsBySQlCase( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please give specific datatype instead of 'any'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the type to 'number' replacing 'any'.
`SELECT COUNT(*) FROM blocks WHERE channel_genesis_hash= $1 AND blocknum = $2`, | ||
[channel_genesis_hash, blockHeight] | ||
); | ||
console.log(count.count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove the console log here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
dc2f5de
to
bf65828
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, in the channels tab, the complete no. of txns needs to be displayed. Please fix that issue.
2.As suggested in the Readme, make a note saying that if the noOfBlocks in Custom mode is selected 0, there is still the latest block is available in postgres db.
3.In the Readme, please add the noOfBlocks in ALL mode.
bf65828
to
f2a7d03
Compare
|
f8b2222
to
5870831
Compare
d2439b3
to
0d1d899
Compare
0d1d899
to
62d5bd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the test-case file to the same PR. Please also squash the commits.
Signed-off-by: Web-Dev-Manoj <manojbhargav.mv@gmail.com>
62d5bd6
to
950c362
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
What this PR does / why we need it:
Load only the blocks and transactions as per the configuration. Currently the configuration defines to archive or delete old data from the database. But at the bootstrap time, the Explorer tries to read every data from block 0. This can be configured to load only the data from certain point in time that is as expected by the Explorer's configuration.
This will help in speeding up the bootstrap time of Explorer, the tool and the UI will be ready in shorter period.
Which issue(s) this PR fixes:
Fixes #393
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation, usage docs, etc.: