Skip to content

Commit 7eeee49

Browse files
kariyclaude
andcommitted
chore(cli): annotate katana rpc subcommands with their JSON-RPC method names
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4b6fe9c commit 7eeee49

6 files changed

Lines changed: 33 additions & 36 deletions

File tree

bin/katana/src/cli/rpc/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use super::client::Client;
66
#[derive(Debug, Subcommand)]
77
#[cfg_attr(test, derive(PartialEq, Eq))]
88
pub enum NodeCommands {
9-
/// Get node identity and build information
9+
/// Get node identity and build information [node_getInfo]
1010
Info,
1111
}
1212

bin/katana/src/cli/rpc/starknet.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,86 +16,86 @@ use super::client::Client;
1616
#[derive(Debug, Subcommand)]
1717
#[cfg_attr(test, derive(PartialEq, Eq))]
1818
pub enum StarknetCommands {
19-
/// Get Starknet JSON-RPC specification version
19+
/// Get Starknet JSON-RPC specification version [starknet_specVersion]
2020
#[command(name = "spec")]
2121
SpecVersion,
2222

23-
/// Get block with full transactions
23+
/// Get block with full transactions [starknet_getBlockWithTxs]
2424
#[command(name = "block")]
2525
GetBlockWithTxs(GetBlockArgs),
2626

27-
/// Get state update for a block
27+
/// Get state update for a block [starknet_getStateUpdate]
2828
#[command(name = "state-update")]
2929
GetStateUpdate(BlockIdArgs),
3030

31-
/// Get storage value at address and key
31+
/// Get storage value at address and key [starknet_getStorageAt]
3232
#[command(name = "storage")]
3333
GetStorageAt(GetStorageAtArgs),
3434

35-
/// Get transaction by hash
35+
/// Get transaction by hash [starknet_getTransactionByHash]
3636
#[command(name = "tx")]
3737
GetTransactionByHash(GetTransactionArgs),
3838

39-
/// Get transaction by block ID and index
39+
/// Get transaction by block ID and index [starknet_getTransactionByBlockIdAndIndex]
4040
#[command(name = "tx-by-block")]
4141
GetTransactionByBlockIdAndIndex(GetTransactionByBlockIdAndIndexArgs),
4242

43-
/// Get transaction receipt
43+
/// Get transaction receipt [starknet_getTransactionReceipt]
4444
#[command(name = "receipt")]
4545
GetTransactionReceipt(TxHashArgs),
4646

47-
/// Get contract class definition
47+
/// Get contract class definition [starknet_getClass]
4848
#[command(name = "class")]
4949
GetClass(GetClassArgs),
5050

51-
/// Get contract class hash at address
51+
/// Get contract class hash at address [starknet_getClassHashAt]
5252
#[command(name = "class-at")]
5353
GetClassHashAt(GetClassHashAtArgs),
5454

55-
/// Get contract class at address
55+
/// Get contract class at address [starknet_getClassAt]
5656
#[command(name = "code")]
5757
GetClassAt(GetClassAtArgs),
5858

59-
/// Get number of transactions in block
59+
/// Get number of transactions in block [starknet_getBlockTransactionCount]
6060
#[command(name = "tx-count")]
6161
GetBlockTransactionCount(BlockIdArgs),
6262

63-
/// Call contract function
63+
/// Call contract function [starknet_call]
6464
#[command(name = "call")]
6565
Call(CallArgs),
6666

67-
/// Get latest block number
67+
/// Get latest block number [starknet_blockNumber]
6868
#[command(name = "block-number")]
6969
BlockNumber,
7070

71-
/// Get latest block hash and number
71+
/// Get latest block hash and number [starknet_blockHashAndNumber]
7272
BlockHashAndNumber,
7373

74-
/// Get chain ID
74+
/// Get chain ID [starknet_chainId]
7575
#[command(name = "id")]
7676
ChainId,
7777

78-
/// Get sync status
78+
/// Get sync status [starknet_syncing]
7979
#[command(name = "sync")]
8080
Syncing,
8181

82-
/// Get nonce for address
82+
/// Get nonce for address [starknet_getNonce]
8383
#[command(name = "nonce")]
8484
GetNonce(GetNonceArgs),
8585

86-
/// Get events matching filter criteria
86+
/// Get events matching filter criteria [starknet_getEvents]
8787
#[command(name = "events")]
8888
GetEvents(GetEventsArgs),
8989

90-
/// Get transaction execution trace
90+
/// Get transaction execution trace [starknet_traceTransaction]
9191
#[command(name = "trace")]
9292
TraceTransaction(TxHashArgs),
9393

94-
/// Get execution traces for all transactions in a block
94+
/// Get execution traces for all transactions in a block [starknet_traceBlockTransactions]
9595
#[command(name = "block-traces")]
9696
TraceBlockTransactions(TraceBlockTransactionsArg),
9797

98-
/// Get storage proofs for classes, contracts, and storage keys
98+
/// Get storage proofs for classes, contracts, and storage keys [starknet_getStorageProof]
9999
#[command(name = "proof")]
100100
GetStorageProof(GetStorageProofArgs),
101101
}
@@ -115,11 +115,11 @@ pub struct GetBlockArgs {
115115
#[arg(default_value = "latest")]
116116
block: BlockIdArg,
117117

118-
/// Return block with receipts
118+
/// Return block with receipts [starknet_getBlockWithReceipts]
119119
#[arg(long)]
120120
receipts: bool,
121121

122-
/// Return only transaction hashes instead of full transactions
122+
/// Return only transaction hashes instead of full transactions [starknet_getBlockWithTxHashes]
123123
#[arg(long, conflicts_with = "receipts")]
124124
tx_hashes_only: bool,
125125
}
@@ -139,7 +139,7 @@ pub struct GetTransactionArgs {
139139
#[arg(value_name = "TX_HASH")]
140140
tx_hash: TxHash,
141141

142-
/// Get only the transaction status instead of full transaction
142+
/// Get only the transaction status instead of full transaction [starknet_getTransactionStatus]
143143
#[arg(long)]
144144
status: bool,
145145
}

bin/katana/src/cli/rpc/tee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use super::client::Client;
77
#[derive(Debug, Subcommand)]
88
#[cfg_attr(test, derive(PartialEq, Eq))]
99
pub enum TeeCommands {
10-
/// Generate a TEE attestation quote for a block's state
10+
/// Generate a TEE attestation quote for a block's state [tee_generateQuote]
1111
#[command(name = "generate-quote")]
1212
GenerateQuote(GenerateQuoteArgs),
1313

14-
/// Get the Merkle inclusion proof for an event
14+
/// Get the Merkle inclusion proof for an event [tee_getEventProof]
1515
#[command(name = "event-proof")]
1616
EventProof(EventProofArgs),
1717
}

bin/katana/src/cli/rpc/txpool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ use super::client::Client;
77
#[derive(Debug, Subcommand)]
88
#[cfg_attr(test, derive(PartialEq, Eq))]
99
pub enum TxpoolCommands {
10-
/// Get pending and queued transaction counts
10+
/// Get pending and queued transaction counts [txpool_status]
1111
Status,
1212

13-
/// Get all transactions in the pool, grouped by sender and nonce
13+
/// Get all transactions in the pool, grouped by sender and nonce [txpool_content]
1414
Content,
1515

16-
/// Get pool contents filtered by sender address
16+
/// Get pool contents filtered by sender address [txpool_contentFrom]
1717
#[command(name = "content-from")]
1818
ContentFrom(AddressArgs),
1919

20-
/// Get a human-readable summary of the pool
20+
/// Get a human-readable summary of the pool [txpool_inspect]
2121
Inspect,
2222
}
2323

crates/cli/src/args.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,9 +713,7 @@ impl SequencerNodeArgs {
713713
}
714714

715715
fn tee_config(&self) -> Option<TeeConfig> {
716-
self.tee
717-
.provider
718-
.map(|provider_type| TeeConfig { provider_type, fork_block_number: None })
716+
self.tee.provider.map(|provider_type| TeeConfig { provider_type, fork_block_number: None })
719717
}
720718

721719
/// Parse the node config from the command line arguments and the config file,

crates/node/config/src/rpc.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ impl Default for RpcModulesList {
166166

167167
impl std::fmt::Display for RpcModulesList {
168168
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
169-
let mut names: Vec<String> =
170-
self.0.iter().map(|m| m.to_string().to_lowercase()).collect();
169+
let mut names: Vec<String> = self.0.iter().map(|m| m.to_string().to_lowercase()).collect();
171170
names.sort();
172171
f.write_str(&names.join(","))
173172
}

0 commit comments

Comments
 (0)