feat: show possible values for reth stage (#872)

This commit is contained in:
Bjerg
2023-01-13 15:01:59 +01:00
committed by GitHub
parent 77f48b05ba
commit 02632cd888
3 changed files with 3 additions and 10 deletions

1
Cargo.lock generated
View File

@@ -3617,7 +3617,6 @@ dependencies = [
"serde",
"serde_json",
"shellexpand",
"strum",
"tempfile",
"thiserror",
"tokio",

View File

@@ -49,6 +49,5 @@ thiserror = "1.0"
tokio = { version = "1.21", features = ["sync", "macros", "rt-multi-thread"] }
tokio-stream = "0.1"
futures = "0.3.25"
strum = "0.24.1"
tempfile = { version = "3.3.0" }
backon = "0.2.0"

View File

@@ -20,10 +20,8 @@ use reth_stages::{
ExecInput, Stage, StageId, Transaction, UnwindInput,
};
use clap::Parser;
use serde::Deserialize;
use clap::{Parser, ValueEnum};
use std::{net::SocketAddr, sync::Arc};
use strum::{AsRefStr, EnumString, EnumVariantNames};
use tracing::*;
/// `reth stage` command
@@ -67,6 +65,7 @@ pub struct Command {
metrics: Option<SocketAddr>,
/// The name of the stage to run
#[arg(value_enum)]
stage: StageEnum,
/// The height to start at
@@ -89,11 +88,7 @@ pub struct Command {
network: NetworkOpts,
}
#[derive(
Debug, Clone, Copy, Eq, PartialEq, AsRefStr, EnumVariantNames, EnumString, Deserialize,
)]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "kebab-case")]
#[derive(Debug, Clone, Copy, Eq, PartialEq, PartialOrd, Ord, ValueEnum)]
enum StageEnum {
Headers,
Bodies,