Trace blocks to file#516
Open
endale98 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature for tracing Ethereum blocks and saving the trace output to files. The changes include adding a new command-line flag, updating configurations, and implementing methods to handle block tracing and file output. Below are the most important changes grouped by theme:
Command-line Flag and Configuration Updates:
trace-outdirflag (utils.TraceOutdirFlag) to specify the directory for saving trace outputs. This flag is integrated into the CLI incmd/tomo/main.goand defined incmd/utils/flags.go. [1] [2]SetEthConfigfunction incmd/utils/flags.goto handle thetrace-outdirflag, including setting the directory path, creating the folder if it doesn’t exist, and logging the output path.StoreTraceFolderincommon/constants.goto store the directory path for trace outputs.Block Tracing Feature:
StandardTraceBlocksToFileineth/api_tracer.goto trace multiple blocks and save the outputs as JSON files in the specified directory.standardTraceBlockToFileineth/api_tracer.goto handle tracing for individual blocks, encoding the results as JSON, and writing them to files.Web3 API Extension:
standardTraceBlocksToFileininternal/web3ext/web3ext.goto expose the block tracing functionality via the Web3 API.