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

Remove web wallet for the time being #2274

Merged
merged 1 commit into from
Jan 2, 2019
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
5 changes: 3 additions & 2 deletions src/bin/cmd/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ pub fn wallet_command(wallet_args: &ArgMatches<'_>, config: GlobalWalletConfig)
let wallet_config = config.members.unwrap().wallet;

// web wallet http server must be started from here
let _ = match wallet_args.subcommand() {
// NB: Turned off for the time being
/*let _ = match wallet_args.subcommand() {
("web", Some(_)) => start_webwallet_server(),
_ => {}
};
};*/

let node_client = HTTPNodeClient::new(&wallet_config.check_node_api_http_addr, None);
let res = wallet_args::wallet_command(wallet_args, wallet_config, node_client);
Expand Down
5 changes: 3 additions & 2 deletions src/bin/grin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,9 @@ subcommands:
takes_value: true
- owner_api:
about: Runs the wallet's local web API
- web:
about: Runs the local web wallet which can be accessed through a browser
# Turned off, for now
# - web:
# about: Runs the local web wallet which can be accessed through a browser
- send:
about: Builds a transaction to send coins and sends to the specified listener directly
args:
Expand Down
17 changes: 9 additions & 8 deletions src/build/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use std::process::Command;

use tar::Archive;

const WEB_WALLET_TAG: &str = "0.3.0.1";
const _WEB_WALLET_TAG: &str = "0.3.0.1";

fn main() {
// Setting up git hooks in the project: rustfmt and so on.
Expand Down Expand Up @@ -59,18 +59,19 @@ fn main() {
format!("{}{}", env::var("OUT_DIR").unwrap(), "/built.rs"),
);

let web_wallet_install = install_web_wallet();
// NB: Removed for the time being
/*let web_wallet_install = install_web_wallet();
match web_wallet_install {
Ok(true) => {}
_ => println!(
"WARNING : Web wallet could not be installed due to {:?}",
web_wallet_install
),
}
}*/
}

fn download_and_decompress(target_file: &str) -> Result<bool, Box<std::error::Error>> {
let req_path = format!("https://github.com/mimblewimble/grin-web-wallet/releases/download/{}/grin-web-wallet.tar.gz", WEB_WALLET_TAG);
fn _download_and_decompress(target_file: &str) -> Result<bool, Box<std::error::Error>> {
let req_path = format!("https://github.com/mimblewimble/grin-web-wallet/releases/download/{}/grin-web-wallet.tar.gz", _WEB_WALLET_TAG);
let mut resp = reqwest::get(&req_path)?;

if !resp.status().is_success() {
Expand All @@ -95,11 +96,11 @@ fn download_and_decompress(target_file: &str) -> Result<bool, Box<std::error::Er
}

/// Download and unzip tagged web-wallet build
fn install_web_wallet() -> Result<bool, Box<std::error::Error>> {
fn _install_web_wallet() -> Result<bool, Box<std::error::Error>> {
let target_file = format!(
"{}/grin-web-wallet-{}.tar",
env::var("OUT_DIR")?,
WEB_WALLET_TAG
_WEB_WALLET_TAG
);
let out_dir = env::var("OUT_DIR")?;
let mut out_path = PathBuf::from(&out_dir);
Expand All @@ -110,7 +111,7 @@ fn install_web_wallet() -> Result<bool, Box<std::error::Error>> {
// only re-download if needed
println!("{}", target_file);
if !Path::new(&target_file).is_file() {
let success = download_and_decompress(&target_file)?;
let success = _download_and_decompress(&target_file)?;
if !success {
return Ok(false); // could not download and decompress
}
Expand Down