-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.rs
More file actions
143 lines (123 loc) · 5.16 KB
/
cli.rs
File metadata and controls
143 lines (123 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! CLI structure and argument definitions.
use clap::{Parser, Subcommand};
use crate::commands::{
create_dkg::CreateDkgArgs,
create_enr::CreateEnrArgs,
enr::EnrArgs,
relay::RelayArgs,
test::{
all::TestAllArgs, beacon::TestBeaconArgs, infra::TestInfraArgs, mev::TestMevArgs,
peers::TestPeersArgs, validator::TestValidatorArgs,
},
version::VersionArgs,
};
/// Pluto - Proof of Stake Ethereum Distributed Validator Client
#[derive(Parser)]
#[command(
name = "pluto",
version,
about = "Pluto - Proof of Stake Ethereum Distributed Validator Client",
long_about = "Pluto enables the operation of Ethereum validators in a fault tolerant manner by splitting the validating keys across a group of trusted parties using threshold cryptography."
)]
pub struct Cli {
/// The subcommand to execute.
#[command(subcommand)]
pub command: Commands,
}
/// Available commands.
#[derive(Subcommand)]
pub enum Commands {
#[command(
about = "Print the ENR that identifies this client",
long_about = "Prints an Ethereum Node Record (ENR) from this client's pluto-enr-private-key. This serves as a public key that identifies this client to its peers."
)]
Enr(EnrArgs),
#[command(
about = "Create artifacts for a distributed validator cluster",
long_about = "Create artifacts for a distributed validator cluster. These commands can be used to facilitate the creation of a distributed validator cluster between a group of operators by performing a distributed key generation ceremony, or they can be used to create a local cluster for single operator use cases."
)]
Create(CreateArgs),
#[command(about = "Print version and exit", long_about = "Output version info")]
Version(VersionArgs),
#[command(
about = "Start a libp2p relay server",
long_about = "Starts a libp2p circuit relay that charon clients can use to discover and connect to their peers."
)]
Relay(Box<RelayArgs>),
#[command(
about = "Alpha subcommands provide early access to in-development features",
long_about = "Alpha subcommands represent features that are currently under development. They're not yet released for general use, but offer a glimpse into future functionalities planned for the distributed cluster system."
)]
Alpha(AlphaArgs),
}
/// Arguments for the alpha command
#[derive(clap::Args)]
pub struct AlphaArgs {
#[command(subcommand)]
pub command: AlphaCommands,
}
/// Alpha subcommands
#[derive(clap::Subcommand)]
pub enum AlphaCommands {
#[command(
about = "Test subcommands provide test suite to evaluate current cluster setup",
long_about = "Test subcommands provide test suite to evaluate current cluster setup. The full validator stack can be tested - charon peers, consensus layer, validator client, MEV. Current machine's infra can be examined as well."
)]
Test(Box<TestArgs>),
}
/// Arguments for the test command
#[derive(clap::Args)]
pub struct TestArgs {
#[command(subcommand)]
pub command: TestCommands,
}
/// Test subcommands
#[derive(clap::Subcommand)]
pub enum TestCommands {
#[command(
about = "Run multiple tests towards peer nodes",
long_about = "Run multiple tests towards peer nodes. Verify that Charon can efficiently interact with Validator Client."
)]
Peers(TestPeersArgs),
#[command(
about = "Run multiple tests towards beacon nodes",
long_about = "Run multiple tests towards beacon nodes. Verify that Charon can efficiently interact with Beacon Node(s)."
)]
Beacon(TestBeaconArgs),
#[command(
about = "Run multiple tests towards validator client",
long_about = "Run multiple tests towards validator client. Verify that Charon can efficiently interact with its validator client."
)]
Validator(TestValidatorArgs),
#[command(
about = "Run multiple tests towards MEV relays",
long_about = "Run multiple tests towards MEV relays. Verify that Charon can efficiently interact with MEV relay(s)."
)]
Mev(TestMevArgs),
#[command(
about = "Run multiple hardware and internet connectivity tests",
long_about = "Run multiple hardware and internet connectivity tests. Verify that Charon is running on host with sufficient capabilities."
)]
Infra(TestInfraArgs),
#[command(
about = "Run tests towards peer nodes, beacon nodes, validator client, MEV relays, own hardware and internet connectivity.",
long_about = "Run tests towards peer nodes, beacon nodes, validator client, MEV relays, own hardware and internet connectivity. Verify that Pluto can efficiently do its duties on the tested setup."
)]
All(Box<TestAllArgs>),
}
/// Arguments for the create command
#[derive(clap::Args)]
pub struct CreateArgs {
#[command(subcommand)]
pub command: CreateCommands,
}
/// Create subcommands
#[derive(Subcommand)]
pub enum CreateCommands {
/// Create a cluster definition file for a new Distributed Key Generation
/// ceremony
Dkg(Box<CreateDkgArgs>),
/// Create an Ethereum Node Record (ENR) private key to identify this charon
/// client
Enr(CreateEnrArgs),
}