# How Much ? (howmuch-rs) — Usage Documentation A library providing helpers for various StarkNet fees-related tasks. It can be used as a library or as a CLI. This document covers CLI usage for a cleanroom inference environment. ## Prerequisites - [Rust](https://www.rust-lang.org/tools/install) ## Installation ```bash cargo install howmuch-rs ``` ## Usage ``` How much ? Usage: howmuch-rs Commands: fees Fees related subcommands help Print this message or the help of the given subcommand(s) Options: -h, --help Print help information -V, --version Print version information ``` ### Subcommand: `fees estimate-on-network` Estimate fees from one network to another. ``` Usage: howmuch-rs fees estimate-on-network ``` | Flag | Required | Default | Description | |---|---|---|---| | `--tx-hash ` | Yes | — | Transaction hash on the source network. | | `--source-network-gateway-url ` | No | `https://alpha4-2.starknet.io/feeder_gateway` (goerli 2 testnet) | Source network gateway URL. | | `--destination-network-gateway-url ` | No | `https://alpha-mainnet.starknet.io/feeder_gateway` (mainnet) | Destination network gateway URL. If identical to the source, it is ignored. | | `--source-block-number ` | No | latest block | Source block number. | | `--destination-block-number ` | No | latest block | Destination block number. | | `--usd ` | No | `false` | If true, display a dollar cost estimation in the output. | Short form: `-t` for `--tx-hash`. Example: ```bash RUST_LOG=debug howmuch-rs fees estimate-on-network \ --tx-hash=0x073251e7ff3843c4954aa2e7f38d8c29034e34a1ddbaeb1e62605ec10ca22367 \ --source-block-number=21410 \ --destination-block-number=15925 ``` ### Subcommand: `fees summary` Print a summary of the resources used by a transaction. ``` Usage: howmuch-rs fees summary ``` Input (one of): | Flag | Required | Default | Description | |---|---|---|---| | `--tx-hash ` | one of `--tx-hash` or `--transaction-file` | — | Transaction hash to fetch. | | `--gateway-url ` | No | `https://alpha4-2.starknet.io/feeder_gateway` | Gateway URL used when fetching by `--tx-hash`. | | `--transaction-file ` | one of `--tx-hash` or `--transaction-file` | — | File containing a transaction receipt. Overrides `--tx-hash` and `--gateway-url`. | Resource weight overrides (defaults shown): | Flag | Default | |---|---| | `--steps-weight ` | `0.05` | | `--pedersen-weight ` | `1.6` | | `--range-check-weight ` | `0.8` | | `--ecdsa-weight ` | `102.4` | | `--bitwise-weight ` | `3.2` | | `--ec_op-weight ` | `51.2` | Resource count overrides (replace the count parsed from the receipt): | Flag | Description | |---|---| | `--steps ` | Override the step count. | | `--pedersen ` | Override the pedersen count. | | `--range_check ` | Override the range_check count. | | `--ecdsa ` | Override the ecdsa count. | | `--bitwise ` | Override the bitwise count. | | `--ec_op ` | Override the ec_op count. | Short form: `-t` for `--tx-hash`. Examples: ```bash howmuch-rs fees summary \ --tx-hash=0x073251e7ff3843c4954aa2e7f38d8c29034e34a1ddbaeb1e62605ec10ca22367 ``` or with a local receipt file: ```bash howmuch-rs fees summary --transaction_file example_transaction.json ``` ## Input / output formats - **Transaction receipt input** (`--transaction-file`): a JSON object with a StarkNet transaction receipt, including `execution_resources` (with `n_steps`, `builtin_instance_counter`, `n_memory_holes`) and `actual_fee`. A sample receipt is provided in `example_transaction.json`. - **Output**: human-readable text summarizing fees / resource usage. - **Logging**: `RUST_LOG` environment variable controls log verbosity (e.g. `RUST_LOG=debug`).