Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add command line option --snapshot-to-json 📦 #11058

Open
wants to merge 2 commits into
base: develop-boxed
Choose a base branch
from

Conversation

heifner
Copy link
Contributor

@heifner heifner commented Feb 2, 2022

Change Description

  • Add new command line option --snapshot-to-json which reads given snapshot.bin and generates a JSON equivalent file.

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

@heifner heifner changed the title Add command line option --snapshot-to-json Add command line option --snapshot-to-json 📦 Feb 2, 2022
@matthewdarwin
Copy link

I wonder how long this takes to run on a wax snapshot? They're huge. I can't imagine the json file.

https://snapshots.eosnation.io/

@heifner
Copy link
Contributor Author

heifner commented Feb 4, 2022

I wonder how long this takes to run on a wax snapshot? They're huge. I can't imagine the json file.

https://snapshots.eosnation.io/

1hr to read WAX 21GB binary snapshot, 37 minutes to write the 59 GB JSON on my old mac.

@@ -963,6 +965,57 @@ void chain_plugin::plugin_initialize(const variables_map& options) {
EOS_THROW( extract_genesis_state_exception, "extracted genesis state from blocks.log" );
}

std::optional<chain_id_type> chain_id;
if( options.count("snapshot-to-json") ) {
my->snapshot_path = options.at( "snapshot-to-json" ).as<bfs::path>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move that code to the separate method

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.

4 participants