Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mining-cli"
version = "1.3.2"
version = "1.3.3"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
3 changes: 1 addition & 2 deletions config/config.base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ withdrawal_gnark_prover_url = "https://v1.base-prod.mining-gateway.intmax.xyz/v1
claim_gnark_prover_url = "https://v1.base-prod.mining-gateway.intmax.xyz/v1/gnark-claim-circuit"
withdrawal_server_url = "https://v1.base-prod.mining-gateway.intmax.xyz/v1/withdrawal"
circulation_server_url = "https://v1.base-prod.mining-gateway.intmax.xyz/v1/mining"
event_server_url = "https://v1.base-prod.mining-gateway.intmax.xyz/v1/deposits"
tree_data_repository = "InternetMaximalism/intmax2-mining"
tree_data_directory = "base-data"
tree_data_branch = "main"
Expand All @@ -12,8 +13,6 @@ gnark_get_proof_cooldown_in_sec = 60

[blockchain]
chain_id = 8453
graph_url = "https://v1.base-prod.graph.intmax.xyz/subgraphs/name/prod-int1"
graph_health_check_timeout_in_sec = 60
int1_address = "0x195F9b5F42435bB71E9765E66a9bdFE40d44A895"
minter_address = "0x1f5a5Eb6C3894351425BD51ea2AE1ef3FEC93976"
token_address = "0xf95117e3a5B7968703CeD3B66A9CbE0Bc9e1D8bf"
Expand Down
3 changes: 1 addition & 2 deletions config/config.mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ withdrawal_gnark_prover_url = "https://v1.mining-gateway.intmax.xyz/v1/gnark-wit
claim_gnark_prover_url = "https://v1.mining-gateway.intmax.xyz/v1/gnark-claim-circuit"
withdrawal_server_url = "https://v1.mining-gateway.intmax.xyz/v1/withdrawal"
circulation_server_url = "https://v1.mining-gateway.intmax.xyz/v1/mining"
event_server_url = "https://v1.mining-gateway.intmax.xyz/v1/deposits"
tree_data_repository = "InternetMaximalism/intmax2-mining"
tree_data_directory = "data"
tree_data_branch = "main"
Expand All @@ -12,8 +13,6 @@ gnark_get_proof_cooldown_in_sec = 60

[blockchain]
chain_id = 1
graph_url = "https://mainnet.graph.intmax.xyz/subgraphs/name/legacy-int1"
graph_health_check_timeout_in_sec = 60
int1_address = "0x0Ac498bCA32B00E2584171844fb9A5943398D9c1"
minter_address = "0x38DE07d2526Ae929f1903E5F109B70C50e12A8E0"
token_address = "0xe24e207c6156241cAfb41D025B3b5F0677114C81"
Expand Down
14 changes: 3 additions & 11 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ::console::{style, Term};
use alloy::primitives::B256;
use configure::recover_withdrawal_private_key;
use console::clear_console;
use mode_selection::{legacy_select_mode, select_mode};
use mode_selection::legacy_select_mode;
use term_of_use::make_agreement;

use crate::{
Expand Down Expand Up @@ -52,11 +52,7 @@ pub async fn run(mode: Option<RunMode>) -> anyhow::Result<()> {
}

let mut mode = if is_interactive {
if is_legacy() {
legacy_select_mode()?
} else {
select_mode()?
}
legacy_select_mode()?
} else {
mode.unwrap()
};
Expand Down Expand Up @@ -136,11 +132,7 @@ async fn mode_loop(
// if not in interactive mode, we only run once
break;
}
*mode = if is_legacy() {
legacy_select_mode()?
} else {
select_mode()?
};
*mode = legacy_select_mode()?;
}
Ok(())
}
Expand Down
46 changes: 0 additions & 46 deletions src/cli/mode_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,6 @@ use dialoguer::Select;

use crate::state::mode::RunMode;

pub fn select_mode() -> anyhow::Result<RunMode> {
let items = [
format!(
"{} {}",
style("Mining:").bold(),
style("performs mining by repeatedly executing deposits and withdrawals").dim()
),
format!(
"{} {}",
style("Claim:").bold(),
style("claims available ITX tokens").dim()
),
format!(
"{} {}",
style("Exit:").bold(),
style("withdraws all balances currently and cancels pending deposits").dim()
),
format!(
"{} {}",
style("Export:").bold(),
style("export deposit private keys").dim()
),
format!(
"{} {}",
style("Check Update:").bold(),
style("check for updates of this CLI").dim()
),
];
let term = Term::stdout();
term.clear_screen()?;
let mode = Select::new()
.with_prompt("Select mode (press ctrl+c to abort)")
.items(&items)
.default(0)
.interact()?;
let mode = match mode {
0 => RunMode::Mining,
1 => RunMode::Claim,
2 => RunMode::Exit,
3 => RunMode::Export,
4 => RunMode::CheckUpdate,
_ => unreachable!(),
};
Ok(mode)
}

pub fn legacy_select_mode() -> anyhow::Result<RunMode> {
let items = [
format!(
Expand Down
Loading
Loading