Skip to content

Commit

Permalink
chore: update naming and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
petscheit committed Apr 9, 2024
1 parent 830f0c1 commit 8f48b13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ serde_with = { version = "3.7.0", features = ["hex"] }
serde_json = "1.0.114"

[[bin]]
name = "eth-trie-proofs"
name = "etp-cli"
path = "src/bin/cli.rs"
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,25 @@ A comprehensive proofs handler for Ethereum trie. Tested with various EIPs inclu
- [x] Verify proof

## CLI Tool

The CLI tool supports generating proofs for transactions and receipts. Use the following commands based on your requirements:

Install with: `cargo install --path ./`

Or, run without installing: `cargo run --bin etp-cli`


**Generate a Proof via CLI**

To generate a proof for a transaction, use the following command:

`cargo run --bin eth-trie-proofs tx <TRANSACTION_HASH> [RPC_URL]`
`etp-cli tx <TRANSACTION_HASH> [RPC_URL]`

To generate a receipt proof:

`cargo run --bin eth-trie-proofs receipt <TRANSACTION_HASH> [RPC_URL]`
`etp-cli receipt <TRANSACTION_HASH> [RPC_URL]`

As a default, `https://ethereum-rpc.publicnode.com` is used as an RPC provider. This will probably work for recent transactions, but it is advised to use a dedicated RPC.


## Installation

Use the following command to add `eth-trie-proofs` to your project:
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ struct Cli {

#[derive(Debug, Subcommand)]
enum Commands {
#[command(about = "Generate a tx proof")]
#[command(about = "Generate a MPT proof for a transaction")]
Tx {
/// Target transaction hash
tx_hash: String,
/// Ethereum node RPC URL
rpc_url: Option<String>,
},
#[command(about = "Generate a receipt proof")]
#[command(about = "Generate a MPT proof for a transaction receipt")]
Receipt {
/// Receipt transaction hash
tx_hash: String,
Expand Down

0 comments on commit 8f48b13

Please sign in to comment.