-
Notifications
You must be signed in to change notification settings - Fork 212
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
Conversation
There was a problem hiding this 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.
apps/arweave/src/ar_doctor_dump.erl
Outdated
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"). |
There was a problem hiding this comment.
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
apps/arweave/src/ar_doctor_dump.erl
Outdated
false; | ||
dump(Args) -> | ||
[MinHeight, MaxHeight, DataDir, OutputDir] = Args, | ||
[IncludeTXs, H, MinHeight, DataDir, OutputDir] = Args, |
There was a problem hiding this comment.
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.
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 |
No description provided.