Skip to content

Trace blocks to file#516

Open
endale98 wants to merge 2 commits into
BuildOnViction:masterfrom
endale98:trace-blocks-to-file
Open

Trace blocks to file#516
endale98 wants to merge 2 commits into
BuildOnViction:masterfrom
endale98:trace-blocks-to-file

Conversation

@endale98
Copy link
Copy Markdown

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:

  • Added a new trace-outdir flag (utils.TraceOutdirFlag) to specify the directory for saving trace outputs. This flag is integrated into the CLI in cmd/tomo/main.go and defined in cmd/utils/flags.go. [1] [2]
  • Updated the SetEthConfig function in cmd/utils/flags.go to handle the trace-outdir flag, including setting the directory path, creating the folder if it doesn’t exist, and logging the output path.
  • Added a new global variable StoreTraceFolder in common/constants.go to store the directory path for trace outputs.

Block Tracing Feature:

  • Implemented a new method StandardTraceBlocksToFile in eth/api_tracer.go to trace multiple blocks and save the outputs as JSON files in the specified directory.
  • Added a helper method standardTraceBlockToFile in eth/api_tracer.go to handle tracing for individual blocks, encoding the results as JSON, and writing them to files.

Web3 API Extension:

  • Added a new Web3 method standardTraceBlocksToFile in internal/web3ext/web3ext.go to expose the block tracing functionality via the Web3 API.

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.

1 participant