mirror of
https://github.com/Qortal/piratewallet-light-cli.git
synced 2025-02-01 03:12:15 +00:00
update wallet location
This commit is contained in:
parent
bb3bbf2b29
commit
59196cb5d0
@ -15,7 +15,7 @@ Run `zecwallet-cli help` to see a list of all commands.
|
|||||||
|
|
||||||
## Notes:
|
## Notes:
|
||||||
* If you want to run your own server, please see [zecwallet lightwalletd](https://github.com/adityapk00/lightwalletd), and then run `./zecwallet-cli --server http://127.0.0.1:9067`.
|
* If you want to run your own server, please see [zecwallet lightwalletd](https://github.com/adityapk00/lightwalletd), and then run `./zecwallet-cli --server http://127.0.0.1:9067`.
|
||||||
* The log file is in `~/.zcash/zecwallet-light-wallet.debug.log`. Wallet is stored in `~/.zcash/zecwallet-light-wallet.dat`
|
* The log file is in `~/.zero/zerowallet-light-wallet.debug.log`. Wallet is stored in `~/.zero/zerowallet-light-wallet.dat`
|
||||||
|
|
||||||
### Note Management
|
### Note Management
|
||||||
Zecwallet-CLI does automatic note and utxo management, which means it doesn't allow you to manually select which address to send outgoing transactions from. It follows these principles:
|
Zecwallet-CLI does automatic note and utxo management, which means it doesn't allow you to manually select which address to send outgoing transactions from. It follows these principles:
|
||||||
|
@ -67,7 +67,7 @@ pub fn report_permission_error() {
|
|||||||
eprintln!("HOME: {}", home);
|
eprintln!("HOME: {}", home);
|
||||||
eprintln!("Executable: {}", current_executable.display());
|
eprintln!("Executable: {}", current_executable.display());
|
||||||
if home == "/" {
|
if home == "/" {
|
||||||
eprintln!("User {} must have permission to write to '{}.zcash/' .",
|
eprintln!("User {} must have permission to write to '{}.zero/' .",
|
||||||
user,
|
user,
|
||||||
home);
|
home);
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,8 +39,8 @@ use crate::ANCHOR_OFFSET;
|
|||||||
mod checkpoints;
|
mod checkpoints;
|
||||||
|
|
||||||
pub const DEFAULT_SERVER: &str = "https://lightwalletd.zeromachine.io:443";
|
pub const DEFAULT_SERVER: &str = "https://lightwalletd.zeromachine.io:443";
|
||||||
pub const WALLET_NAME: &str = "zecwallet-light-wallet.dat";
|
pub const WALLET_NAME: &str = "zerowallet-light-wallet.dat";
|
||||||
pub const LOGFILE_NAME: &str = "zecwallet-light-wallet.debug.log";
|
pub const LOGFILE_NAME: &str = "zerowallet-light-wallet.debug.log";
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct WalletStatus {
|
pub struct WalletStatus {
|
||||||
@ -113,7 +113,7 @@ impl LightClientConfig {
|
|||||||
pub fn get_log_config(&self) -> io::Result<Config> {
|
pub fn get_log_config(&self) -> io::Result<Config> {
|
||||||
let window_size = 3; // log0, log1, log2
|
let window_size = 3; // log0, log1, log2
|
||||||
let fixed_window_roller =
|
let fixed_window_roller =
|
||||||
FixedWindowRoller::builder().build("zecwallet-light-wallet-log{}",window_size).unwrap();
|
FixedWindowRoller::builder().build("zerowallet-light-wallet-log{}",window_size).unwrap();
|
||||||
let size_limit = 5 * 1024 * 1024; // 5MB as max log file size to roll
|
let size_limit = 5 * 1024 * 1024; // 5MB as max log file size to roll
|
||||||
let size_trigger = SizeTrigger::new(size_limit);
|
let size_trigger = SizeTrigger::new(size_limit);
|
||||||
let compound_policy = CompoundPolicy::new(Box::new(size_trigger),Box::new(fixed_window_roller));
|
let compound_policy = CompoundPolicy::new(Box::new(size_trigger),Box::new(fixed_window_roller));
|
||||||
@ -146,10 +146,10 @@ impl LightClientConfig {
|
|||||||
} else {
|
} else {
|
||||||
if cfg!(target_os="macos") || cfg!(target_os="windows") {
|
if cfg!(target_os="macos") || cfg!(target_os="windows") {
|
||||||
zcash_data_location = dirs::data_dir().expect("Couldn't determine app data directory!");
|
zcash_data_location = dirs::data_dir().expect("Couldn't determine app data directory!");
|
||||||
zcash_data_location.push("Zcash");
|
zcash_data_location.push("Zero");
|
||||||
} else {
|
} else {
|
||||||
zcash_data_location = dirs::home_dir().expect("Couldn't determine home directory!");
|
zcash_data_location = dirs::home_dir().expect("Couldn't determine home directory!");
|
||||||
zcash_data_location.push(".zcash");
|
zcash_data_location.push(".zero");
|
||||||
};
|
};
|
||||||
|
|
||||||
match &self.chain_name[..] {
|
match &self.chain_name[..] {
|
||||||
@ -166,8 +166,8 @@ impl LightClientConfig {
|
|||||||
match std::fs::create_dir_all(zcash_data_location.clone()) {
|
match std::fs::create_dir_all(zcash_data_location.clone()) {
|
||||||
Ok(_) => {},
|
Ok(_) => {},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("Couldn't create zcash directory!\n{}", e);
|
eprintln!("Couldn't create zero directory!\n{}", e);
|
||||||
panic!("Couldn't create zcash directory!");
|
panic!("Couldn't create zero directory!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ impl LightClientConfig {
|
|||||||
use std::time::{SystemTime, UNIX_EPOCH};
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
|
|
||||||
let mut backup_file_path = self.get_zcash_data_path().into_path_buf();
|
let mut backup_file_path = self.get_zcash_data_path().into_path_buf();
|
||||||
backup_file_path.push(&format!("zecwallet-light-wallet.backup.{}.dat", SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()));
|
backup_file_path.push(&format!("zerowallet-light-wallet.backup.{}.dat", SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()));
|
||||||
|
|
||||||
let backup_file_str = backup_file_path.to_string_lossy().to_string();
|
let backup_file_str = backup_file_path.to_string_lossy().to_string();
|
||||||
std::fs::copy(self.get_wallet_path(), backup_file_path).map_err(|e| format!("{}", e))?;
|
std::fs::copy(self.get_wallet_path(), backup_file_path).map_err(|e| format!("{}", e))?;
|
||||||
|
Loading…
Reference in New Issue
Block a user