Auto-generated documentation.
Plot a chart of transaction gas prices and limits.
polycli plot [flags]plot generates interactive HTML charts analyzing transaction gas prices and limits across a range of blocks. It fetches block data from an Ethereum-compatible RPC endpoint and produces an HTML chart showing gas price distribution, transaction gas limits, block gas limits, and block gas usage over time.
Generate a chart for the last 500 blocks:
polycli plot --rpc-url http://localhost:8545This will create a file named plot.html in the current directory.
Analyze blocks 9356826 to 9358826:
polycli plot --rpc-url https://sepolia.infura.io/v3/YOUR_API_KEY \
--start-block 9356826 \
--end-block 9358826 \
--output "sepolia_analysis.html"Track transactions involving a specific address (either sent from or to):
polycli plot --rpc-url http://localhost:8545 \
--target-address "0xeE76bECaF80fFe451c8B8AFEec0c21518Def02f9" \
--start-block 1000 \
--end-block 2000Target transactions will be highlighted in the chart and logged during execution.
When fetching large block ranges, adjust rate limiting and concurrency.
Process 10 blocks concurrently with 10 requests/second rate limit:
polycli plot --rpc-url http://localhost:8545 \
--concurrency 10 \
--rate-limit 10 \
--start-block 1000 \
--end-block 5000Remove rate limiting entirely (use with caution):
polycli plot --rpc-url http://localhost:8545 \
--rate-limit -1 \
--concurrency 20Choose between SVG (default) and Canvas rendering. Both output HTML files but use different rendering technologies.
Use SVG renderer (default, sharper at any zoom level):
polycli plot --rpc-url http://localhost:8545 \
--renderer "svg" \
--output "svg_chart.html"Use Canvas renderer (better performance for large datasets):
polycli plot --rpc-url http://localhost:8545 \
--renderer "canvas" \
--output "canvas_chart.html"The generated chart displays key metrics and is interactive:
- Transaction Gas Prices: Individual transaction gas prices plotted as points, with target address transactions highlighted
- Transaction Gas Limits: Gas limits for individual transactions (grouped by size)
- Block Gas Limits: Maximum gas limit per block
- Block Gas Used: Actual gas consumed per block
- 30-block Avg Gas Price: Rolling average of gas prices
Interactive features:
- Tooltips: Hover over data points for details
- Zoom: Use the slider or scroll to zoom into specific block ranges
- Legend Toggle: Click legend items to show/hide series
Analyzing gas price patterns during network congestion:
polycli plot --rpc-url https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY \
--start-block 18000000 \
--end-block 18001000 \
--output mainnet_congestion.htmlTracking your contract deployment gas costs:
polycli plot --rpc-url http://localhost:8545 \
--target-address 0xYourContractAddress \
--output my_contract_gas.htmlAnalyzing test network behavior:
polycli plot --rpc-url http://localhost:8545 \
--concurrency 1 \
--rate-limit 4 \
--output local_test.htmlTo avoid re-fetching block data from the RPC endpoint, use the --cache flag to store data in an NDJSON file:
# First run: fetches from RPC and writes to cache
polycli plot --rpc-url http://localhost:8545 \
--start-block 1000 \
--end-block 2000 \
--cache blocks.ndjson
# Subsequent runs: reads from cache (much faster)
polycli plot --rpc-url http://localhost:8545 \
--start-block 1000 \
--end-block 2000 \
--cache blocks.ndjson
# Target address filtering works with cache
polycli plot --rpc-url http://localhost:8545 \
--cache blocks.ndjson \
--target-address 0xYourAddressThis is useful when iterating on chart options (renderer, target-address) without waiting for RPC queries.
- If
--start-blockis not set, the command analyzes the last 500 blocks - If
--end-blockexceeds the latest block or is not set, it defaults to the latest block - The command logs the 20 most frequently used gas prices at debug level
- Charts are saved in HTML format with interactive features
- Cache files use NDJSON format (one JSON object per line) for efficient streaming
--cache string cache file path for block data (.ndjson); if set, reads from cache if exists, otherwise fetches and writes to cache
-c, --concurrency uint number of tasks to perform concurrently (default: one at a time) (default 1)
--end-block uint ending block number (inclusive) (default 18446744073709551615)
-h, --help help for plot
-o, --output string output file path (default "plot.html")
--rate-limit float requests per second limit (use negative value to remove limit) (default 4)
--renderer string chart renderer (options: svg, canvas) (default "svg")
--rpc-url string RPC URL of network (default "http://localhost:8545")
--start-block uint starting block number (inclusive) (default 18446744073709551615)
--target-address string address that will have tx sent from or to highlighted in the chartThe command also inherits flags from parent commands.
--config string config file (default is $HOME/.polygon-cli.yaml)
--pretty-logs output logs in pretty format instead of JSON (default true)
-v, --verbosity string log level (string or int):
0 - silent
100 - panic
200 - fatal
300 - error
400 - warn
500 - info (default)
600 - debug
700 - trace (default "info")- polycli - A Swiss Army knife of blockchain tools.