-
Notifications
You must be signed in to change notification settings - Fork 285
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
feat(core-snapshots): implement core-snapshots package #3672
Conversation
… package, add tests
…store method in core-snapshot package
…pCompression to meta data
# Conflicts: # packages/core-database/src/repositories/index.ts # packages/core-kernel/src/contracts/index.ts
bfbffde
to
e181fff
Compare
# Conflicts: # yarn.lock
This pull request introduces 2 alerts when merging 6a28684 into 932cfec - view on LGTM.com new alerts:
|
# Conflicts: # packages/core-database/src/index.ts # packages/core-kernel/src/contracts/index.ts # packages/core-kernel/src/exceptions/index.ts
This pull request introduces 1 alert when merging f654e30 into 027c6de - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 894a633 into 027c6de - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 9332474 into 027c6de - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 1b68e2d into 027c6de - view on LGTM.com new alerts:
|
Summary
This PR adds new core-snapshots package with included tests. Changes also exists inside core package for running snapshot package from CLI. Package is rewritten from start and includes similar functionality like previous implementation from 2.6 version. Package use node workers to speed up execution and impact dump method the most. Implemented methods:
Truncate
Remove all blocks, rounds and transactions from database.
Rollback
Rollback database to specific block height or rollback database for specified number of blocks.
Dump
This method will make a snapshot from database and save exported data into the default snapshot location. There is possibility to set range of exported data based on block height parameter, use zlib compression and set desired codec. Meta data are also exported and contains information like exported range, used codec and compression.
Verify
Verify data exported with dump command. Validation is successful when all the blocks, rounds and transactions are successful, otherwise it will log first invalid item and stop execution.
Restore
Will restore all the data from dumped snapshot. Optionally it can be run with truncate method, if this is defined in parameters.
Checklist