diff --git a/docs/cli/help.rs b/docs/cli/help.rs index a3a71514e5..30c769b9ff 100755 --- a/docs/cli/help.rs +++ b/docs/cli/help.rs @@ -62,6 +62,10 @@ struct Args { #[arg(long)] root_summary: bool, + /// Whether to generate TypeScript sidebar files + #[arg(long)] + sidebar: bool, + /// Print verbose output #[arg(short, long)] verbose: bool, @@ -140,10 +144,18 @@ fn main() -> io::Result<()> { if args.verbose { println!("Updating root summary in \"{}\"", path.to_string_lossy()); } - // TODO: This is where we update the cli reference sidebar.ts update_root_summary(path, &root_summary)?; } + // Generate TypeScript sidebar files. + if args.sidebar { + let vocs_dir = Path::new(args.root_dir.as_str()).join("vocs"); + if args.verbose { + println!("Generating TypeScript sidebar files in \"{}\"", vocs_dir.display()); + } + generate_sidebar_files(&vocs_dir, &output, args.verbose)?; + } + Ok(()) } @@ -247,6 +259,186 @@ fn update_root_summary(root_dir: &Path, root_summary: &str) -> io::Result<()> { write_file(&summary_file, root_summary) } +/// Generates TypeScript sidebar files for each command. +fn generate_sidebar_files(vocs_dir: &Path, output: &[(Cmd, String)], verbose: bool) -> io::Result<()> { + // Group commands by their root command name (reth or op-reth) + // Also create a map of commands to their help output + let mut commands_by_root: std::collections::HashMap> = std::collections::HashMap::new(); + let mut help_map: std::collections::HashMap = std::collections::HashMap::new(); + + for (cmd, help_output) in output { + let root_name = cmd.command_name().to_string(); + commands_by_root.entry(root_name.clone()).or_insert_with(Vec::new).push(cmd); + // Store help output for each command using its string representation as key + help_map.insert(cmd.to_string(), help_output.clone()); + } + + // Generate sidebar file for each root command + for (root_name, cmds) in commands_by_root { + // Get root help output + let root_help = help_map.get(&root_name).map(|s| s.as_str()); + let sidebar_content = generate_sidebar_ts(&root_name, cmds, root_help, &help_map)?; + let file_name = match root_name.as_str() { + "reth" => "sidebar-cli-reth.ts", + "op-reth" => "sidebar-cli-op-reth.ts", + _ => { + if verbose { + println!("Skipping unknown command: {}", root_name); + } + continue; + } + }; + + let sidebar_file = vocs_dir.join(file_name); + if verbose { + println!("Writing sidebar file: {}", sidebar_file.display()); + } + write_file(&sidebar_file, &sidebar_content)?; + } + + Ok(()) +} + +/// Generates TypeScript code for a sidebar file. +fn generate_sidebar_ts( + root_name: &str, + commands: Vec<&Cmd>, + root_help: Option<&str>, + help_map: &std::collections::HashMap, +) -> io::Result { + // Find all top-level commands (commands with exactly one subcommand) + let mut top_level_commands: Vec<&Cmd> = commands + .iter() + .copied() + .filter(|cmd| cmd.subcommands.len() == 1) + .collect(); + + // Remove duplicates using a set + let mut seen = std::collections::HashSet::new(); + top_level_commands.retain(|cmd| { + let key = &cmd.subcommands[0]; + seen.insert(key.clone()) + }); + + // Sort by the order they appear in help output, not alphabetically + if let Some(help) = root_help { + let help_order = parse_sub_commands(help); + top_level_commands.sort_by(|a, b| { + let a_name = &a.subcommands[0]; + let b_name = &b.subcommands[0]; + let a_pos = help_order.iter().position(|x| x == a_name).unwrap_or(usize::MAX); + let b_pos = help_order.iter().position(|x| x == b_name).unwrap_or(usize::MAX); + a_pos.cmp(&b_pos) + }); + } + + // Generate TypeScript code + let var_name = match root_name { + "reth" => "rethCliSidebar", + "op-reth" => "opRethCliSidebar", + _ => "cliSidebar", + }; + + let mut ts_code = String::from("import { SidebarItem } from \"vocs\";\n\n"); + ts_code.push_str(&format!("export const {}: SidebarItem = {{\n", var_name)); + ts_code.push_str(&format!(" text: \"{}\",\n", root_name)); + ts_code.push_str(&format!(" link: \"/cli/{}\",\n", root_name)); + ts_code.push_str(" collapsed: false,\n"); + ts_code.push_str(" items: [\n"); + + for (idx, cmd) in top_level_commands.iter().enumerate() { + let is_last = idx == top_level_commands.len() - 1; + if let Some(item_str) = build_sidebar_item(root_name, cmd, &commands, 1, help_map, is_last) { + ts_code.push_str(&item_str); + } + } + + ts_code.push_str(" ]\n"); + ts_code.push_str("};\n\n"); + + Ok(ts_code) +} + +/// Builds a sidebar item for a command and its children. +/// Returns TypeScript code string. +fn build_sidebar_item( + root_name: &str, + cmd: &Cmd, + all_commands: &[&Cmd], + depth: usize, + help_map: &std::collections::HashMap, + is_last: bool, +) -> Option { + let full_cmd_name = cmd.to_string(); + let link_path = format!("/cli/{}", full_cmd_name.replace(" ", "/")); + + // Find all direct child commands (commands whose subcommands start with this command's subcommands) + let mut children: Vec<&Cmd> = all_commands + .iter() + .copied() + .filter(|other_cmd| { + other_cmd.subcommands.len() == cmd.subcommands.len() + 1 + && other_cmd.subcommands[..cmd.subcommands.len()] == cmd.subcommands[..] + }) + .collect(); + + // Sort children by the order they appear in help output, not alphabetically + if children.len() > 1 { + // Get help output for this command to determine subcommand order + if let Some(help_output) = help_map.get(&full_cmd_name) { + let help_order = parse_sub_commands(help_output); + children.sort_by(|a, b| { + let a_name = a.subcommands.last().unwrap(); + let b_name = b.subcommands.last().unwrap(); + let a_pos = help_order.iter().position(|x| x == a_name).unwrap_or(usize::MAX); + let b_pos = help_order.iter().position(|x| x == b_name).unwrap_or(usize::MAX); + a_pos.cmp(&b_pos) + }); + } else { + // Fall back to alphabetical if we can't get help + children.sort_by(|a, b| { + a.subcommands.last().unwrap().cmp(b.subcommands.last().unwrap()) + }); + } + } + + let indent = " ".repeat(depth); + let mut item_str = String::new(); + + item_str.push_str(&format!("{}{{\n", indent)); + item_str.push_str(&format!("{} text: \"{}\",\n", indent, full_cmd_name)); + item_str.push_str(&format!("{} link: \"{}\"", indent, link_path)); + + if !children.is_empty() { + item_str.push_str(",\n"); + item_str.push_str(&format!("{} collapsed: true,\n", indent)); + item_str.push_str(&format!("{} items: [\n", indent)); + + for (idx, child_cmd) in children.iter().enumerate() { + let child_is_last = idx == children.len() - 1; + if let Some(child_str) = build_sidebar_item(root_name, child_cmd, all_commands, depth + 1, help_map, child_is_last) { + item_str.push_str(&child_str); + } + } + + item_str.push_str(&format!("{} ]\n", indent)); + if is_last { + item_str.push_str(&format!("{}}}\n", indent)); + } else { + item_str.push_str(&format!("{}}},\n", indent)); + } + } else { + item_str.push_str("\n"); + if is_last { + item_str.push_str(&format!("{}}}\n", indent)); + } else { + item_str.push_str(&format!("{}}},\n", indent)); + } + } + + Some(item_str) +} + /// Preprocesses the help output of a command. fn preprocess_help(s: &str) -> Cow<'_, str> { static REPLACEMENTS: LazyLock> = LazyLock::new(|| { diff --git a/docs/cli/update.sh b/docs/cli/update.sh index 17f5ffdf72..9ec5b9473c 100755 --- a/docs/cli/update.sh +++ b/docs/cli/update.sh @@ -14,6 +14,7 @@ cmd=( --root-dir "$DOCS_ROOT/" --root-indentation 2 --root-summary + --sidebar --verbose --out-dir "$VOCS_PAGES_ROOT/cli/" "$RETH" "$OP_RETH" diff --git a/docs/vocs/sidebar-cli-op-reth.ts b/docs/vocs/sidebar-cli-op-reth.ts new file mode 100644 index 0000000000..a35dab3e0b --- /dev/null +++ b/docs/vocs/sidebar-cli-op-reth.ts @@ -0,0 +1,242 @@ +import { SidebarItem } from "vocs"; + +export const opRethCliSidebar: SidebarItem = { + text: "op-reth", + link: "/cli/op-reth", + collapsed: false, + items: [ + { + text: "op-reth node", + link: "/cli/op-reth/node" + }, + { + text: "op-reth init", + link: "/cli/op-reth/init" + }, + { + text: "op-reth init-state", + link: "/cli/op-reth/init-state" + }, + { + text: "op-reth import-op", + link: "/cli/op-reth/import-op" + }, + { + text: "op-reth import-receipts-op", + link: "/cli/op-reth/import-receipts-op" + }, + { + text: "op-reth dump-genesis", + link: "/cli/op-reth/dump-genesis" + }, + { + text: "op-reth db", + link: "/cli/op-reth/db", + collapsed: true, + items: [ + { + text: "op-reth db stats", + link: "/cli/op-reth/db/stats" + }, + { + text: "op-reth db list", + link: "/cli/op-reth/db/list" + }, + { + text: "op-reth db checksum", + link: "/cli/op-reth/db/checksum" + }, + { + text: "op-reth db diff", + link: "/cli/op-reth/db/diff" + }, + { + text: "op-reth db get", + link: "/cli/op-reth/db/get", + collapsed: true, + items: [ + { + text: "op-reth db get mdbx", + link: "/cli/op-reth/db/get/mdbx" + }, + { + text: "op-reth db get static-file", + link: "/cli/op-reth/db/get/static-file" + } + ] + }, + { + text: "op-reth db drop", + link: "/cli/op-reth/db/drop" + }, + { + text: "op-reth db clear", + link: "/cli/op-reth/db/clear", + collapsed: true, + items: [ + { + text: "op-reth db clear mdbx", + link: "/cli/op-reth/db/clear/mdbx" + }, + { + text: "op-reth db clear static-file", + link: "/cli/op-reth/db/clear/static-file" + } + ] + }, + { + text: "op-reth db repair-trie", + link: "/cli/op-reth/db/repair-trie" + }, + { + text: "op-reth db static-file-header", + link: "/cli/op-reth/db/static-file-header", + collapsed: true, + items: [ + { + text: "op-reth db static-file-header block", + link: "/cli/op-reth/db/static-file-header/block" + }, + { + text: "op-reth db static-file-header path", + link: "/cli/op-reth/db/static-file-header/path" + } + ] + }, + { + text: "op-reth db version", + link: "/cli/op-reth/db/version" + }, + { + text: "op-reth db path", + link: "/cli/op-reth/db/path" + }, + { + text: "op-reth db settings", + link: "/cli/op-reth/db/settings", + collapsed: true, + items: [ + { + text: "op-reth db settings get", + link: "/cli/op-reth/db/settings/get" + }, + { + text: "op-reth db settings set", + link: "/cli/op-reth/db/settings/set", + collapsed: true, + items: [ + { + text: "op-reth db settings set receipts_in_static_files", + link: "/cli/op-reth/db/settings/set/receipts_in_static_files" + }, + { + text: "op-reth db settings set transaction_senders_in_static_files", + link: "/cli/op-reth/db/settings/set/transaction_senders_in_static_files" + } + ] + } + ] + }, + { + text: "op-reth db account-storage", + link: "/cli/op-reth/db/account-storage" + } + ] + }, + { + text: "op-reth stage", + link: "/cli/op-reth/stage", + collapsed: true, + items: [ + { + text: "op-reth stage run", + link: "/cli/op-reth/stage/run" + }, + { + text: "op-reth stage drop", + link: "/cli/op-reth/stage/drop" + }, + { + text: "op-reth stage dump", + link: "/cli/op-reth/stage/dump", + collapsed: true, + items: [ + { + text: "op-reth stage dump execution", + link: "/cli/op-reth/stage/dump/execution" + }, + { + text: "op-reth stage dump storage-hashing", + link: "/cli/op-reth/stage/dump/storage-hashing" + }, + { + text: "op-reth stage dump account-hashing", + link: "/cli/op-reth/stage/dump/account-hashing" + }, + { + text: "op-reth stage dump merkle", + link: "/cli/op-reth/stage/dump/merkle" + } + ] + }, + { + text: "op-reth stage unwind", + link: "/cli/op-reth/stage/unwind", + collapsed: true, + items: [ + { + text: "op-reth stage unwind to-block", + link: "/cli/op-reth/stage/unwind/to-block" + }, + { + text: "op-reth stage unwind num-blocks", + link: "/cli/op-reth/stage/unwind/num-blocks" + } + ] + } + ] + }, + { + text: "op-reth p2p", + link: "/cli/op-reth/p2p", + collapsed: true, + items: [ + { + text: "op-reth p2p header", + link: "/cli/op-reth/p2p/header" + }, + { + text: "op-reth p2p body", + link: "/cli/op-reth/p2p/body" + }, + { + text: "op-reth p2p rlpx", + link: "/cli/op-reth/p2p/rlpx", + collapsed: true, + items: [ + { + text: "op-reth p2p rlpx ping", + link: "/cli/op-reth/p2p/rlpx/ping" + } + ] + }, + { + text: "op-reth p2p bootnode", + link: "/cli/op-reth/p2p/bootnode" + } + ] + }, + { + text: "op-reth config", + link: "/cli/op-reth/config" + }, + { + text: "op-reth prune", + link: "/cli/op-reth/prune" + }, + { + text: "op-reth re-execute", + link: "/cli/op-reth/re-execute" + } + ] +}; diff --git a/docs/vocs/sidebar-cli-reth.ts b/docs/vocs/sidebar-cli-reth.ts new file mode 100644 index 0000000000..5e5e7f9303 --- /dev/null +++ b/docs/vocs/sidebar-cli-reth.ts @@ -0,0 +1,250 @@ +import { SidebarItem } from "vocs"; + +export const rethCliSidebar: SidebarItem = { + text: "reth", + link: "/cli/reth", + collapsed: false, + items: [ + { + text: "reth node", + link: "/cli/reth/node" + }, + { + text: "reth init", + link: "/cli/reth/init" + }, + { + text: "reth init-state", + link: "/cli/reth/init-state" + }, + { + text: "reth import", + link: "/cli/reth/import" + }, + { + text: "reth import-era", + link: "/cli/reth/import-era" + }, + { + text: "reth export-era", + link: "/cli/reth/export-era" + }, + { + text: "reth dump-genesis", + link: "/cli/reth/dump-genesis" + }, + { + text: "reth db", + link: "/cli/reth/db", + collapsed: true, + items: [ + { + text: "reth db stats", + link: "/cli/reth/db/stats" + }, + { + text: "reth db list", + link: "/cli/reth/db/list" + }, + { + text: "reth db checksum", + link: "/cli/reth/db/checksum" + }, + { + text: "reth db diff", + link: "/cli/reth/db/diff" + }, + { + text: "reth db get", + link: "/cli/reth/db/get", + collapsed: true, + items: [ + { + text: "reth db get mdbx", + link: "/cli/reth/db/get/mdbx" + }, + { + text: "reth db get static-file", + link: "/cli/reth/db/get/static-file" + } + ] + }, + { + text: "reth db drop", + link: "/cli/reth/db/drop" + }, + { + text: "reth db clear", + link: "/cli/reth/db/clear", + collapsed: true, + items: [ + { + text: "reth db clear mdbx", + link: "/cli/reth/db/clear/mdbx" + }, + { + text: "reth db clear static-file", + link: "/cli/reth/db/clear/static-file" + } + ] + }, + { + text: "reth db repair-trie", + link: "/cli/reth/db/repair-trie" + }, + { + text: "reth db static-file-header", + link: "/cli/reth/db/static-file-header", + collapsed: true, + items: [ + { + text: "reth db static-file-header block", + link: "/cli/reth/db/static-file-header/block" + }, + { + text: "reth db static-file-header path", + link: "/cli/reth/db/static-file-header/path" + } + ] + }, + { + text: "reth db version", + link: "/cli/reth/db/version" + }, + { + text: "reth db path", + link: "/cli/reth/db/path" + }, + { + text: "reth db settings", + link: "/cli/reth/db/settings", + collapsed: true, + items: [ + { + text: "reth db settings get", + link: "/cli/reth/db/settings/get" + }, + { + text: "reth db settings set", + link: "/cli/reth/db/settings/set", + collapsed: true, + items: [ + { + text: "reth db settings set receipts_in_static_files", + link: "/cli/reth/db/settings/set/receipts_in_static_files" + }, + { + text: "reth db settings set transaction_senders_in_static_files", + link: "/cli/reth/db/settings/set/transaction_senders_in_static_files" + } + ] + } + ] + }, + { + text: "reth db account-storage", + link: "/cli/reth/db/account-storage" + } + ] + }, + { + text: "reth download", + link: "/cli/reth/download" + }, + { + text: "reth stage", + link: "/cli/reth/stage", + collapsed: true, + items: [ + { + text: "reth stage run", + link: "/cli/reth/stage/run" + }, + { + text: "reth stage drop", + link: "/cli/reth/stage/drop" + }, + { + text: "reth stage dump", + link: "/cli/reth/stage/dump", + collapsed: true, + items: [ + { + text: "reth stage dump execution", + link: "/cli/reth/stage/dump/execution" + }, + { + text: "reth stage dump storage-hashing", + link: "/cli/reth/stage/dump/storage-hashing" + }, + { + text: "reth stage dump account-hashing", + link: "/cli/reth/stage/dump/account-hashing" + }, + { + text: "reth stage dump merkle", + link: "/cli/reth/stage/dump/merkle" + } + ] + }, + { + text: "reth stage unwind", + link: "/cli/reth/stage/unwind", + collapsed: true, + items: [ + { + text: "reth stage unwind to-block", + link: "/cli/reth/stage/unwind/to-block" + }, + { + text: "reth stage unwind num-blocks", + link: "/cli/reth/stage/unwind/num-blocks" + } + ] + } + ] + }, + { + text: "reth p2p", + link: "/cli/reth/p2p", + collapsed: true, + items: [ + { + text: "reth p2p header", + link: "/cli/reth/p2p/header" + }, + { + text: "reth p2p body", + link: "/cli/reth/p2p/body" + }, + { + text: "reth p2p rlpx", + link: "/cli/reth/p2p/rlpx", + collapsed: true, + items: [ + { + text: "reth p2p rlpx ping", + link: "/cli/reth/p2p/rlpx/ping" + } + ] + }, + { + text: "reth p2p bootnode", + link: "/cli/reth/p2p/bootnode" + } + ] + }, + { + text: "reth config", + link: "/cli/reth/config" + }, + { + text: "reth prune", + link: "/cli/reth/prune" + }, + { + text: "reth re-execute", + link: "/cli/reth/re-execute" + } + ] +}; diff --git a/docs/vocs/sidebar.ts b/docs/vocs/sidebar.ts index 988d38caba..31d2d8d726 100644 --- a/docs/vocs/sidebar.ts +++ b/docs/vocs/sidebar.ts @@ -1,4 +1,6 @@ import { SidebarItem } from "vocs"; +import { rethCliSidebar } from "./sidebar-cli-reth"; +import { opRethCliSidebar } from "./sidebar-cli-op-reth"; export const sidebar: SidebarItem[] = [ { @@ -288,494 +290,8 @@ export const sidebar: SidebarItem[] = [ link: "/cli/cli", collapsed: false, items: [ - { - text: "reth", - link: "/cli/reth", - collapsed: false, - items: [ - { - text: "reth node", - link: "/cli/reth/node" - }, - { - text: "reth init", - link: "/cli/reth/init" - }, - { - text: "reth init-state", - link: "/cli/reth/init-state" - }, - { - text: "reth import", - link: "/cli/reth/import" - }, - { - text: "reth import-era", - link: "/cli/reth/import-era" - }, - { - text: "reth export-era", - link: "/cli/reth/export-era" - }, - { - text: "reth dump-genesis", - link: "/cli/reth/dump-genesis" - }, - { - text: "reth db", - link: "/cli/reth/db", - collapsed: true, - items: [ - { - text: "reth db stats", - link: "/cli/reth/db/stats" - }, - { - text: "reth db list", - link: "/cli/reth/db/list" - }, - { - text: "reth db checksum", - link: "/cli/reth/db/checksum" - }, - { - text: "reth db diff", - link: "/cli/reth/db/diff" - }, - { - text: "reth db get", - link: "/cli/reth/db/get", - collapsed: true, - items: [ - { - text: "reth db get mdbx", - link: "/cli/reth/db/get/mdbx" - }, - { - text: "reth db get static-file", - link: "/cli/reth/db/get/static-file" - } - ] - }, - { - text: "reth db drop", - link: "/cli/reth/db/drop" - }, - { - text: "reth db clear", - link: "/cli/reth/db/clear", - collapsed: true, - items: [ - { - text: "reth db clear mdbx", - link: "/cli/reth/db/clear/mdbx" - }, - { - text: "reth db clear static-file", - link: "/cli/reth/db/clear/static-file" - } - ] - }, - { - text: "reth db repair-trie", - link: "/cli/reth/db/repair-trie" - }, - { - text: "reth db static-file-header", - link: "/cli/reth/db/static-file-header", - collapsed: true, - items: [ - { - text: "reth db static-file-header block", - link: "/cli/reth/db/static-file-header/block" - }, - { - text: "reth db static-file-header path", - link: "/cli/reth/db/static-file-header/path" - } - ] - }, - { - text: "reth db version", - link: "/cli/reth/db/version" - }, - { - text: "reth db path", - link: "/cli/reth/db/path" - }, - { - text: "reth db settings", - link: "/cli/reth/db/settings", - collapsed: true, - items: [ - { - text: "reth db settings get", - link: "/cli/reth/db/settings/get" - }, - { - text: "reth db settings set", - link: "/cli/reth/db/settings/set", - collapsed: true, - items: [ - { - text: "reth db settings set receipts_in_static_files", - link: "/cli/reth/db/settings/set/receipts_in_static_files" - }, - { - text: "reth db settings set transaction_senders_in_static_files", - link: "/cli/reth/db/settings/set/transaction_senders_in_static_files" - } - ] - } - ] - }, - { - text: "reth db account-storage", - link: "/cli/reth/db/account-storage" - } - ] - }, - { - text: "reth download", - link: "/cli/reth/download" - }, - { - text: "reth stage", - link: "/cli/reth/stage", - collapsed: true, - items: [ - { - text: "reth stage run", - link: "/cli/reth/stage/run" - }, - { - text: "reth stage drop", - link: "/cli/reth/stage/drop" - }, - { - text: "reth stage dump", - link: "/cli/reth/stage/dump", - collapsed: true, - items: [ - { - text: "reth stage dump execution", - link: "/cli/reth/stage/dump/execution" - }, - { - text: "reth stage dump storage-hashing", - link: "/cli/reth/stage/dump/storage-hashing" - }, - { - text: "reth stage dump account-hashing", - link: "/cli/reth/stage/dump/account-hashing" - }, - { - text: "reth stage dump merkle", - link: "/cli/reth/stage/dump/merkle" - } - ] - }, - { - text: "reth stage unwind", - link: "/cli/reth/stage/unwind", - collapsed: true, - items: [ - { - text: "reth stage unwind to-block", - link: "/cli/reth/stage/unwind/to-block" - }, - { - text: "reth stage unwind num-blocks", - link: "/cli/reth/stage/unwind/num-blocks" - } - ] - } - ] - }, - { - text: "reth p2p", - link: "/cli/reth/p2p", - collapsed: true, - items: [ - { - text: "reth p2p header", - link: "/cli/reth/p2p/header" - }, - { - text: "reth p2p body", - link: "/cli/reth/p2p/body" - }, - { - text: "reth p2p rlpx", - link: "/cli/reth/p2p/rlpx", - collapsed: true, - items: [ - { - text: "reth p2p rlpx ping", - link: "/cli/reth/p2p/rlpx/ping" - } - ] - }, - { - text: "reth p2p bootnode", - link: "/cli/reth/p2p/bootnode" - } - ] - }, - { - text: "reth config", - link: "/cli/reth/config" - }, - { - text: "reth prune", - link: "/cli/reth/prune" - }, - { - text: "reth re-execute", - link: "/cli/reth/re-execute" - } - ] - }, - { - text: "op-reth", - link: "/cli/op-reth", - collapsed: false, - items: [ - { - text: "op-reth node", - link: "/cli/op-reth/node" - }, - { - text: "op-reth init", - link: "/cli/op-reth/init" - }, - { - text: "op-reth init-state", - link: "/cli/op-reth/init-state" - }, - { - text: "op-reth import-op", - link: "/cli/op-reth/import-op" - }, - { - text: "op-reth import-receipts-op", - link: "/cli/op-reth/import-receipts-op" - }, - { - text: "op-reth dump-genesis", - link: "/cli/op-reth/dump-genesis" - }, - { - text: "op-reth db", - link: "/cli/op-reth/db", - collapsed: true, - items: [ - { - text: "op-reth db stats", - link: "/cli/op-reth/db/stats" - }, - { - text: "op-reth db list", - link: "/cli/op-reth/db/list" - }, - { - text: "op-reth db checksum", - link: "/cli/op-reth/db/checksum" - }, - { - text: "op-reth db diff", - link: "/cli/op-reth/db/diff" - }, - { - text: "op-reth db get", - link: "/cli/op-reth/db/get", - collapsed: true, - items: [ - { - text: "op-reth db get mdbx", - link: "/cli/op-reth/db/get/mdbx" - }, - { - text: "op-reth db get static-file", - link: "/cli/op-reth/db/get/static-file" - } - ] - }, - { - text: "op-reth db drop", - link: "/cli/op-reth/db/drop" - }, - { - text: "op-reth db clear", - link: "/cli/op-reth/db/clear", - collapsed: true, - items: [ - { - text: "op-reth db clear mdbx", - link: "/cli/op-reth/db/clear/mdbx" - }, - { - text: "op-reth db clear static-file", - link: "/cli/op-reth/db/clear/static-file" - } - ] - }, - { - text: "op-reth db version", - link: "/cli/op-reth/db/version" - }, - { - text: "op-reth db path", - link: "/cli/op-reth/db/path" - }, - { - text: "op-reth db account-storage", - link: "/cli/op-reth/db/account-storage" - }, - { - text: "op-reth db repair-trie", - link: "/cli/op-reth/db/repair-trie" - }, - { - text: "op-reth db settings", - link: "/cli/op-reth/db/settings", - collapsed: true, - items: [ - { - text: "op-reth db settings get", - link: "/cli/op-reth/db/settings/get" - }, - { - text: "op-reth db settings set", - link: "/cli/op-reth/db/settings/set", - collapsed: true, - items: [ - { - text: "op-reth db settings set receipts_in_static_files", - link: "/cli/op-reth/db/settings/set/receipts_in_static_files" - }, - { - text: "op-reth db settings set transaction_senders_in_static_files", - link: "/cli/op-reth/db/settings/set/transaction_senders_in_static_files" - } - ] - } - ] - }, - { - text: "op-reth db static-file-header", - link: "/cli/op-reth/db/static-file-header", - collapsed: true, - items: [ - { - text: "op-reth db static-file-header block", - link: "/cli/op-reth/db/static-file-header/block" - }, - { - text: "op-reth db static-file-header path", - link: "/cli/op-reth/db/static-file-header/path" - } - ] - } - ] - }, - { - text: "op-reth stage", - link: "/cli/op-reth/stage", - collapsed: true, - items: [ - { - text: "op-reth stage run", - link: "/cli/op-reth/stage/run" - }, - { - text: "op-reth stage drop", - link: "/cli/op-reth/stage/drop" - }, - { - text: "op-reth stage dump", - link: "/cli/op-reth/stage/dump", - collapsed: true, - items: [ - { - text: "op-reth stage dump execution", - link: "/cli/op-reth/stage/dump/execution" - }, - { - text: "op-reth stage dump storage-hashing", - link: "/cli/op-reth/stage/dump/storage-hashing" - }, - { - text: "op-reth stage dump account-hashing", - link: "/cli/op-reth/stage/dump/account-hashing" - }, - { - text: "op-reth stage dump merkle", - link: "/cli/op-reth/stage/dump/merkle" - } - ] - }, - { - text: "op-reth stage unwind", - link: "/cli/op-reth/stage/unwind", - collapsed: true, - items: [ - { - text: "op-reth stage unwind to-block", - link: "/cli/op-reth/stage/unwind/to-block" - }, - { - text: "op-reth stage unwind num-blocks", - link: "/cli/op-reth/stage/unwind/num-blocks" - } - ] - } - ] - }, - { - text: "op-reth p2p", - link: "/cli/op-reth/p2p", - collapsed: true, - items: [ - { - text: "op-reth p2p header", - link: "/cli/op-reth/p2p/header" - }, - { - text: "op-reth p2p body", - link: "/cli/op-reth/p2p/body" - }, - { - text: "op-reth p2p bootnode", - link: "/cli/op-reth/p2p/bootnode" - }, - { - text: "op-reth p2p rlpx", - link: "/cli/op-reth/p2p/rlpx", - collapsed: true, - items: [ - { - text: "op-reth p2p rlpx ping", - link: "/cli/op-reth/p2p/rlpx/ping" - } - ] - } - ] - }, - { - text: "op-reth config", - link: "/cli/op-reth/config" - }, - { - text: "op-reth prune", - link: "/cli/op-reth/prune" - }, - { - text: "op-reth re-execute", - link: "/cli/op-reth/re-execute" - } - ] - } + rethCliSidebar, + opRethCliSidebar ] }, ] \ No newline at end of file