Skip to content
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

Merged
merged 46 commits into from May 5, 2020

Conversation

sebastijankuzner
Copy link
Contributor

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

  • Documentation (if necessary)
  • Tests (if necessary)
  • Ready to be merged

# Conflicts:
#	packages/core-database/src/repositories/index.ts
#	packages/core-kernel/src/contracts/index.ts
@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 2 alerts when merging 6a28684 into 932cfec - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable

# Conflicts:
#	packages/core-database/src/index.ts
#	packages/core-kernel/src/contracts/index.ts
#	packages/core-kernel/src/exceptions/index.ts
@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 1 alert when merging f654e30 into 027c6de - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 1 alert when merging 894a633 into 027c6de - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 1 alert when merging 9332474 into 027c6de - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link

lgtm-com bot commented May 4, 2020

This pull request introduces 1 alert when merging 1b68e2d into 027c6de - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

@faustbrian faustbrian merged commit 8df596a into develop May 5, 2020
@ghost ghost deleted the feature/core-snapshots branch May 5, 2020 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants