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

Improve the speed of doctor-dump and allow omitting txs #630

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

JamesPiechota
Copy link
Collaborator

No description provided.

@JamesPiechota JamesPiechota requested a review from humaite October 11, 2024 16:47
Copy link
Collaborator

@humaite humaite left a comment

Choose a reason for hiding this comment

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

Except "style", it looks good to me. Perhaps creating a tool a bit more flexible to extract blocks and/or txs could be even better, with a way to extract a range for each of them:

# dump both blocks and txs
data-doctor dump min_height max_height data_dir output_dir

# dump only a block
data-doctor dump-block min_height max_height data_dir output_dir

# dump only a tx min_height max_height data_dir output_dir
data-doctor dump-tx min_height max_height data_dir output_dir

the syntax stays the same, but we can now select what kind of data we want to dump to verify/export.

ar:console(" data_dir: Full path to your data_dir.~n"),
ar:console(" output_dir: Full path to a directory where the dumped data will be written.~n"),
ar:console("~nExample:~n"),
ar:console("data-doctor dump /mnt/arweave-data /mnt/output~n").
ar:console("data-doctor dump true ZR7zbobdw55a1z6Tzndi9ikTa_qY29CUx3xeZAInKBodmW7m45VopRpUabEkLD0V 100000 /mnt/arweave-data /mnt/output~n").
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a huge value, truncate it. I think if someone is using this tool, he will understand.

data-doctor dump true ZR7zbob...abEkLD0V 100000 /mnt/arweave-data /mnt/output~n

false;
dump(Args) ->
[MinHeight, MaxHeight, DataDir, OutputDir] = Args,
[IncludeTXs, H, MinHeight, DataDir, OutputDir] = Args,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably do something a bit more explicit:

dump([IncludeTXs, H, MinHeight, DataDir, OutputDir]) -> ...;
dump(_) -> error.

@JamesPiechota
Copy link
Collaborator Author

re: style. yeah agree this is not a well-polished tool. Just an emergency tool for internal use (and I'm the only one who's ever actually used it). Once we have an external use case that we need to solve, we should give some more thought to the UX. but for now it's really just a dev tool.

other changes made

@JamesPiechota JamesPiechota merged commit 36bd008 into master Oct 11, 2024
65 checks passed
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.

2 participants