Skip to content

Commit 4950754

Browse files
committed
chore: remove generate-sui-wallet command
1 parent 570af9d commit 4950754

File tree

5 files changed

+3
-105
lines changed

5 files changed

+3
-105
lines changed

crates/walrus-service/src/client/cli/args.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ use walrus_sdk::config::UploadMode;
3232
use walrus_sui::{
3333
client::{ExpirySelectionPolicy, ReadClient, SuiContractClient},
3434
types::{StorageNode, move_structs::Authorized},
35-
utils::SuiNetwork,
3635
};
3736
use walrus_utils::read_blob_from_file;
3837

@@ -488,35 +487,6 @@ pub enum CliCommands {
488487
#[serde(default = "default::staking_amounts_frost")]
489488
amounts: Vec<u64>,
490489
},
491-
/// Generates a new Sui wallet.
492-
GenerateSuiWallet {
493-
/// The path where the wallet configuration will be stored.
494-
///
495-
/// If not specified, the command will try to create the wallet configuration at the default
496-
/// location `$HOME/.sui/sui_config/`. If the directory already exists, an error will be
497-
/// returned specifying to use the Sui CLI to manage the existing wallets.
498-
#[arg(long)]
499-
path: Option<PathBuf>,
500-
/// Sui network for which the wallet is generated.
501-
///
502-
/// Available options are `devnet`, `testnet`, `mainnet`, and `localnet`.
503-
#[arg(long, default_value_t = default::sui_network())]
504-
#[serde(default = "default::sui_network")]
505-
sui_network: SuiNetwork,
506-
/// Whether to attempt to get SUI tokens from the faucet.
507-
#[arg(long)]
508-
#[serde(default)]
509-
use_faucet: bool,
510-
/// Timeout for the faucet call.
511-
#[arg(
512-
long,
513-
value_parser = humantime::parse_duration,
514-
default_value = "1min",
515-
requires = "use_faucet")
516-
]
517-
#[serde(default = "default::faucet_timeout")]
518-
faucet_timeout: Duration,
519-
},
520490
/// Exchange SUI for WAL through the configured exchange. This command is only available on
521491
/// Testnet.
522492
GetWal {
@@ -690,7 +660,6 @@ impl CliCommands {
690660
CliCommands::ListBlobs { .. } => "list-blobs",
691661
CliCommands::Delete { .. } => "delete",
692662
CliCommands::Stake { .. } => "stake",
693-
CliCommands::GenerateSuiWallet { .. } => "generate-sui-wallet",
694663
CliCommands::GetWal { .. } => "get-wal",
695664
CliCommands::BurnBlobs { .. } => "burn-blobs",
696665
CliCommands::FundSharedBlob { .. } => "fund-shared-blob",
@@ -1814,8 +1783,6 @@ impl EpochArg {
18141783
pub(crate) mod default {
18151784
use std::{net::SocketAddr, time::Duration};
18161785

1817-
use walrus_sui::utils::SuiNetwork;
1818-
18191786
pub(crate) fn max_body_size_kib() -> usize {
18201787
10_240
18211788
}
@@ -1883,14 +1850,6 @@ pub(crate) mod default {
18831850
500_000_000 // 0.5 SUI
18841851
}
18851852

1886-
pub(crate) fn sui_network() -> SuiNetwork {
1887-
SuiNetwork::Testnet
1888-
}
1889-
1890-
pub(crate) fn faucet_timeout() -> Duration {
1891-
Duration::from_secs(60)
1892-
}
1893-
18941853
pub(crate) fn allowed_headers() -> Vec<String> {
18951854
vec![
18961855
"content-type".to_string(),

crates/walrus-service/src/client/cli/cli_output.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ use crate::client::{
6868
StakeOutput,
6969
StorageNodeInfo,
7070
StoreQuiltDryRunOutput,
71-
WalletOutput,
7271
},
7372
};
7473

@@ -862,16 +861,6 @@ impl CliOutput for StakeOutput {
862861
}
863862
}
864863

865-
impl CliOutput for WalletOutput {
866-
fn print_cli_output(&self) {
867-
println!(
868-
"{} Generated a new Sui wallet with address {}",
869-
success(),
870-
self.wallet_address
871-
);
872-
}
873-
}
874-
875864
impl CliOutput for ExchangeOutput {
876865
fn print_cli_output(&self) {
877866
println!(

crates/walrus-service/src/client/cli/runner.rs

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use itertools::Itertools as _;
2020
use rand::seq::SliceRandom;
2121
use reqwest::Url;
2222
use serde_json;
23-
use sui_config::{SUI_CLIENT_CONFIG, sui_config_dir};
2423
use sui_types::base_types::ObjectID;
2524
use walrus_core::{
2625
BlobId,
@@ -67,7 +66,6 @@ use walrus_sdk::{
6766
},
6867
config::WalletConfig,
6968
types::move_structs::{Authorized, BlobAttribute, EpochState},
70-
utils::SuiNetwork,
7169
},
7270
utils::styled_spinner,
7371
};
@@ -150,11 +148,10 @@ use crate::{
150148
ShareBlobOutput,
151149
StakeOutput,
152150
StoreQuiltDryRunOutput,
153-
WalletOutput,
154151
},
155152
},
156153
common::telemetry::TracingSubscriberBuilder,
157-
utils::{self, MetricsAndLoggingRuntime, generate_sui_wallet},
154+
utils::{self, MetricsAndLoggingRuntime},
158155
};
159156

160157
fn apply_upload_mode_to_config(
@@ -343,32 +340,6 @@ impl ClientCommandRunner {
343340
self.stake_with_node_pools(node_ids, amounts).await
344341
}
345342

346-
CliCommands::GenerateSuiWallet {
347-
path,
348-
sui_network,
349-
use_faucet,
350-
faucet_timeout,
351-
} => {
352-
let wallet_path = if let Some(path) = path {
353-
path
354-
} else {
355-
// This automatically creates the Sui configuration directory if it doesn't
356-
// exist.
357-
let config_dir = sui_config_dir()?;
358-
anyhow::ensure!(
359-
config_dir.read_dir()?.next().is_none(),
360-
"The Sui configuration directory {} is not empty; please specify a \
361-
different wallet path using `--path` or manage the wallet using the Sui \
362-
CLI.",
363-
config_dir.display()
364-
);
365-
config_dir.join(SUI_CLIENT_CONFIG)
366-
};
367-
368-
self.generate_sui_wallet(&wallet_path, sui_network, use_faucet, faucet_timeout)
369-
.await
370-
}
371-
372343
CliCommands::GetWal {
373344
exchange_id,
374345
amount,
@@ -1726,18 +1697,6 @@ impl ClientCommandRunner {
17261697
StakeOutput { staked_wal }.print_output(self.json)
17271698
}
17281699

1729-
pub(crate) async fn generate_sui_wallet(
1730-
self,
1731-
path: &Path,
1732-
sui_network: SuiNetwork,
1733-
use_faucet: bool,
1734-
faucet_timeout: Duration,
1735-
) -> Result<()> {
1736-
let wallet_address =
1737-
generate_sui_wallet(sui_network, path, use_faucet, faucet_timeout).await?;
1738-
WalletOutput { wallet_address }.print_output(self.json)
1739-
}
1740-
17411700
pub(crate) async fn exchange_sui_for_wal(
17421701
self,
17431702
exchange_id: Option<ObjectID>,

crates/walrus-service/src/client/responses.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use chrono::{DateTime, Utc};
1515
use futures::{StreamExt as _, stream};
1616
use serde::Serialize;
1717
use serde_with::{DisplayFromStr, base64::Base64, serde_as};
18-
use sui_types::base_types::{ObjectID, SuiAddress};
18+
use sui_types::base_types::ObjectID;
1919
use walrus_core::{
2020
BlobId,
2121
DEFAULT_ENCODING,
@@ -611,14 +611,6 @@ pub struct StakeOutput {
611611
pub staked_wal: Vec<StakedWal>,
612612
}
613613

614-
#[derive(Debug, Clone, Serialize)]
615-
#[serde(rename_all = "camelCase")]
616-
/// The output of the `walrus generate-sui-wallet` command.
617-
pub struct WalletOutput {
618-
/// The address of the generated wallet.
619-
pub wallet_address: SuiAddress,
620-
}
621-
622614
#[derive(Debug, Clone, Serialize)]
623615
#[serde(rename_all = "camelCase")]
624616
/// The output of the `walrus get-wal` command.

docs/book/usage/networks.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ available.
6363
Interacting with Walrus requires a valid Sui Testnet wallet with some amount of SUI tokens. The
6464
normal way to set this up is via the Sui CLI; see the [installation
6565
instructions](https://docs.sui.io/guides/developer/getting-started/sui-install) in the Sui
66-
documentation. If you do not want to install the Sui CLI, you can also generate a new Sui wallet for
67-
Testnet using `walrus generate-sui-wallet --network testnet`.
66+
documentation.
6867

6968
After installing the Sui CLI, you need to set up a Testnet wallet by running `sui client`, which
7069
prompts you to set up a new configuration. Make sure to point it to Sui Testnet, you can use the

0 commit comments

Comments
 (0)