Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtimes] separate runtimes for diem_node and cli #203

Merged
merged 28 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
33eb9d1
Extended query tool
davidrotari19 Feb 14, 2024
2104770
[fix] epoch trigger feature flag (#168)
0xzoz Feb 12, 2024
7e945cc
[feature] show indexed coin value (#171)
0xzoz Feb 12, 2024
8800740
[fix] change community wallet default n-of-m to reduce threshold (#172)
0xzoz Feb 13, 2024
eded0ff
ci: use self-hosted runners with more resources. (#173)
kalvkusk Feb 13, 2024
8c3f593
ci: fix paths for prover utils (#174)
kalvkusk Feb 14, 2024
2d59c75
Clippy and fmt run
davidrotari19 Feb 15, 2024
e692445
Merge remote-tracking branch 'upstream/main'
davidrotari19 Feb 15, 2024
1907147
Fixed: Error:unable to parse HashValue
davidrotari19 Feb 18, 2024
a6711e5
Merge remote-tracking branch 'upstream/main'
davidrotari19 Feb 25, 2024
3d2bc2c
Fixed error HashValue can not be parse
davidrotari19 Feb 25, 2024
ca86937
Fixed HashValue can not be parse
Feb 25, 2024
775d510
Merge branch '0LNetworkCommunity:main' into main
davidrotari19 Feb 26, 2024
1cfe7da
Merge remote-tracking branch 'upstream/main'
davidrotari19 Feb 27, 2024
a4e2b8f
Run clippyy
davidrotari19 Feb 27, 2024
b994ec5
Added unified validator file
davidrotari19 Feb 27, 2024
0f2473e
Added genesis and waypoint initialization for Validator
davidrotari19 Feb 27, 2024
4e66552
Merge branch 'main' into unified_yaml_david
0o-de-lally Feb 28, 2024
3025752
Merge branch '0LNetworkCommunity:main' into unified_yaml_david
davidrotari19 Feb 28, 2024
5712363
Merge remote-tracking branch 'upstream/main' into unified_yaml_david
davidrotari19 Feb 28, 2024
40d181e
Merged Cargo.lock from upstream
davidrotari19 Feb 28, 2024
758f730
[fixed] dynamic latest point acquisition
davidrotari19 Feb 29, 2024
8985b10
Merge branch '0LNetworkCommunity:main' into unified_yaml_david
davidrotari19 Mar 1, 2024
d851ae9
Merge branch '0LNetworkCommunity:main' into unified_yaml_david
davidrotari19 Mar 7, 2024
5df6ab6
runtimes
davidrotari19 Mar 7, 2024
0ba494f
Separate runtimes for diem_node and cli
davidrotari19 Mar 7, 2024
1c96213
Merge branch 'main' into runtimes
0o-de-lally Mar 11, 2024
c0810b7
Merge branch 'main' into runtimes
davidrotari19 Mar 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 44 additions & 25 deletions tools/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,55 @@ enum Sub {
Wallet(WalletCli),
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
fn main() -> anyhow::Result<()> {
let cli = LibraCli::parse();
match cli.command {
Some(Sub::Config(config_cli)) => {
config_cli.run().await?;
}
Some(Sub::Move(move_tool)) => {
move_tool
.execute()
.await
.map_err(|e| anyhow!("Failed to execute move tool, message: {}", &e))?;
}
Some(Sub::Node(n)) => {
n.run().await?;
}
Some(Sub::Query(query_cli)) => {
query_cli.run().await?;
}
Some(Sub::Tower(tower_cli)) => {
tower_cli.run().await?;
}
Some(Sub::Txs(txs_cli)) => {
txs_cli.run().await?;
}
Some(Sub::Wallet(wallet_cli)) => {
wallet_cli.run().await?;
n.run()?;
}
_ => {
println!("\nliving is easy with eyes closed")
let rt = tokio::runtime::Runtime::new()?;
rt.block_on(async {
match cli.command {
Some(Sub::Config(config_cli)) => {
if let Err(e) = config_cli.run().await {
eprintln!("Failed to execute config tool, message: {}", &e);
}
}
Some(Sub::Move(move_tool)) => {
if let Err(e) = move_tool
.execute()
.await
.map_err(|e| anyhow!("Failed to execute move tool, message: {}", &e))
{
eprintln!("Failed to execute move tool, message: {}", &e);
}
}
Some(Sub::Query(query_cli)) => {
if let Err(e) = query_cli.run().await {
eprintln!("Failed to execute query tool, message: {}", &e);
}
}
Some(Sub::Tower(tower_cli)) => {
if let Err(e) = tower_cli.run().await {
eprintln!("Failed to execute tower tool, message: {}", &e);
}
}
Some(Sub::Txs(txs_cli)) => {
if let Err(e) = txs_cli.run().await {
eprintln!("Failed to execute txs tool, message: {}", &e);
}
}
Some(Sub::Wallet(wallet_cli)) => {
if let Err(e) = wallet_cli.run().await {
eprintln!("Failed to execute wallet tool, message: {}", &e);
}
}
_ => {
println!("\nliving is easy with eyes closed")
}
}
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/cli/src/node_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct NodeCli {
}

impl NodeCli {
pub async fn run(&self) -> anyhow::Result<()> {
pub fn run(&self) -> anyhow::Result<()> {
// validators typically aren't looking for verbose logs.
// but they can set it if they wish with RUST_LOG=info
if std::env::var("RUST_LOG").is_err() {
Expand Down
Loading