Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Add support to use existing database snapshot #193

Merged

Conversation

nagdahimanshu
Copy link
Contributor

@nagdahimanshu nagdahimanshu commented Oct 23, 2023

What was the problem?

This PR resolves #191

How was it solved?

  • Add flag network, snapshot-path, snapshot-url
    • Any one of these (snapshot-path, snapshot-url) is required with network
  • Skip all node validation when snapshot-path or snapshot-url is passed
  • Use DB snapshot directly to create snapshot block
  • Add support to download, validate and extract snapshot in case of snapshot-url flag
  • Add support to extract snapshot when snapshot is .taz.gz
  • Migrator is able to create snapshot block
  • Lisk Core v4 node should start
  • Update docs
  • Add unit tests

How was it tested?

Locally against mainnet

  • ./bin/run -s SNAPSHOT_HEIGHT --snapshot-path SNAPSHOT_PATH (either extracted path or path ends with .tar.gz) --network NETWORK
  • ./bin/run -s SNAPSHOT_HEIGHT --snapshot-url SNAPSHOT_URL (url starts with http/https and ends with .tar.gz) --network NETWORK
  • ./bin/run -s SNAPSHOT_HEIGHT --auto-start-lisk-core-v4

@nagdahimanshu nagdahimanshu self-assigned this Oct 23, 2023
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Merging #193 (1204b11) into release/2.0.0 (566854f) will increase coverage by 0.85%.
The diff coverage is 98.07%.

Impacted file tree graph

@@                Coverage Diff                @@
##           release/2.0.0     #193      +/-   ##
=================================================
+ Coverage          81.23%   82.08%   +0.85%     
=================================================
  Files                 24       25       +1     
  Lines                778      815      +37     
  Branches             111      117       +6     
=================================================
+ Hits                 632      669      +37     
  Misses               146      146              
Files Coverage Δ
src/assets/pos.ts 90.14% <ø> (-1.43%) ⬇️
src/utils/block.ts 53.19% <100.00%> (+9.60%) ⬆️
src/utils/fs.ts 100.00% <100.00%> (ø)
src/utils/network.ts 92.59% <100.00%> (+9.25%) ⬆️
src/utils/number.ts 100.00% <100.00%> (ø)
src/utils/path.ts 100.00% <100.00%> (ø)
src/utils/node.ts 43.96% <0.00%> (ø)

@nagdahimanshu nagdahimanshu force-pushed the 191-add-support-to-use-existing-database-snapshot branch from 9dbd2b4 to 2613c73 Compare October 23, 2023 20:54
@nagdahimanshu nagdahimanshu force-pushed the 191-add-support-to-use-existing-database-snapshot branch 2 times, most recently from 6ae387c to 75ff4c9 Compare October 24, 2023 09:45
@nagdahimanshu nagdahimanshu force-pushed the 191-add-support-to-use-existing-database-snapshot branch from 75ff4c9 to 233a75b Compare October 24, 2023 09:46
@nagdahimanshu nagdahimanshu force-pushed the 191-add-support-to-use-existing-database-snapshot branch from da7c553 to 8449f43 Compare October 24, 2023 11:27
@nagdahimanshu nagdahimanshu marked this pull request as ready for review October 24, 2023 11:48
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/utils/block.ts Outdated Show resolved Hide resolved
@sameersubudhi sameersubudhi force-pushed the 191-add-support-to-use-existing-database-snapshot branch from 9b29cd1 to c98377c Compare October 24, 2023 14:04
@sameersubudhi sameersubudhi force-pushed the 191-add-support-to-use-existing-database-snapshot branch from c98377c to eb2009f Compare October 24, 2023 14:32
@sameersubudhi sameersubudhi force-pushed the 191-add-support-to-use-existing-database-snapshot branch from fc47492 to 323cc7a Compare October 24, 2023 17:11
@sameersubudhi sameersubudhi force-pushed the 191-add-support-to-use-existing-database-snapshot branch from 323cc7a to 3fd0955 Compare October 24, 2023 17:12
@sameersubudhi sameersubudhi force-pushed the 191-add-support-to-use-existing-database-snapshot branch from 835a6f9 to 0d20744 Compare October 25, 2023 08:00
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@sameersubudhi sameersubudhi merged commit 56c29db into release/2.0.0 Oct 25, 2023
8 checks passed
@sameersubudhi sameersubudhi deleted the 191-add-support-to-use-existing-database-snapshot branch October 25, 2023 09:47
@sameersubudhi sameersubudhi self-assigned this Oct 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants