From cc1a334ba7d7c1bf35e47070c6bcbc51524ddc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Thu, 26 May 2016 18:21:15 +0200 Subject: [PATCH] Renaming dapps repos. Updating dapps (#1142) * Renaming dapps repos. Updating dapps * Skipping legacy options for compatibility. Fixing tabs * Fixing CLI options --- .travis.yml | 4 +- Cargo.lock | 166 +++++++++++++++-------- Cargo.toml | 8 +- cov.sh | 4 +- dapps/Cargo.toml | 40 ++++++ {webapp => dapps}/build.rs | 0 {webapp => dapps}/src/api/api.rs | 10 +- {webapp => dapps}/src/api/mod.rs | 0 {webapp => dapps}/src/api/mod.rs.in | 0 {webapp => dapps}/src/api/response.rs | 0 {webapp => dapps}/src/apps.rs | 38 +++--- {webapp => dapps}/src/endpoint.rs | 10 +- {webapp => dapps}/src/lib.rs | 8 +- {webapp => dapps}/src/page/mod.rs | 4 +- {webapp => dapps}/src/proxypac.rs | 0 {webapp => dapps}/src/router/auth.rs | 0 {webapp => dapps}/src/router/mod.rs | 0 {webapp => dapps}/src/router/redirect.rs | 0 {webapp => dapps}/src/router/url.rs | 0 {webapp => dapps}/src/rpc.rs | 0 doc.sh | 2 +- fmt.sh | 2 +- hook.sh | 2 +- parity/cli.rs | 27 ++-- parity/{webapp.rs => dapps.rs} | 22 +-- parity/main.rs | 30 ++-- test.sh | 2 +- webapp/Cargo.toml | 39 ------ 28 files changed, 236 insertions(+), 182 deletions(-) create mode 100644 dapps/Cargo.toml rename {webapp => dapps}/build.rs (100%) rename {webapp => dapps}/src/api/api.rs (88%) rename {webapp => dapps}/src/api/mod.rs (100%) rename {webapp => dapps}/src/api/mod.rs.in (100%) rename {webapp => dapps}/src/api/response.rs (100%) rename {webapp => dapps}/src/apps.rs (65%) rename {webapp => dapps}/src/endpoint.rs (94%) rename {webapp => dapps}/src/lib.rs (97%) rename {webapp => dapps}/src/page/mod.rs (98%) rename {webapp => dapps}/src/proxypac.rs (100%) rename {webapp => dapps}/src/router/auth.rs (100%) rename {webapp => dapps}/src/router/mod.rs (100%) rename {webapp => dapps}/src/router/redirect.rs (100%) rename {webapp => dapps}/src/router/url.rs (100%) rename {webapp => dapps}/src/rpc.rs (100%) rename parity/{webapp.rs => dapps.rs} (89%) delete mode 100644 webapp/Cargo.toml diff --git a/.travis.yml b/.travis.yml index 1f88bcecf..253b69d03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ env: global: # GH_TOKEN - secure: bumJASbZSU8bxJ0EyPUJmu16AiV9EXOpyOj86Jlq/Ty9CfwGqsSXt96uDyE+OUJf34RUFQMsw0nk37/zC4lcn6kqk2wpuH3N/o85Zo/cVZY/NusBWLQqtT5VbYWsV+u2Ua4Tmmsw8yVYQhYwU2ZOejNpflL+Cs9XGgORp1L+/gMRMC2y5Se6ZhwnKPQlRJ8LGsG1dzjQULxzADIt3/zuspNBS8a2urJwlHfGMkvHDoUWCviP/GXoSqw3TZR7FmKyxE19I8n9+iSvm9+oZZquvcgfUxMHn8Gq/b44UbPvjtFOg2yam4xdWXF/RyWCHdc/R9EHorSABeCbefIsm+zcUF3/YQxwpSxM4IZEeH2rTiC7dcrsKw3XsO16xFQz5YI5Bay+CT/wTdMmJd7DdYz7Dyf+pOvcM9WOf/zorxYWSBOMYy0uzbusU2iyIghQ82s7E/Ahg+WARtPgkuTLSB5aL1oCTBKHqQscMr7lo5Ti6RpWLxEdTQMBznc+bMr+6dEtkEcG9zqc6cE9XX+ox3wTU6+HVMfQ1ltCntJ4UKcw3A6INEbw9wgocQa812CIASQ2fE+SCAbz6JxBjIAlFUnD1lUB7S8PdMPwn9plfQgKQ2A5YZqg6FnBdf0rQXIJYxQWKHXj/rBHSUCT0tHACDlzTA+EwWggvkP5AGIxRxm8jhw= - - TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethminer -p ethjson -p ethcore-webapp" + - TARGETS="-p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethminer -p ethjson -p ethcore-dapps" - ARCHIVE_SUFFIX="-${TRAVIS_OS_NAME}-${TRAVIS_TAG}" - KCOV_FEATURES="" - KCOV_CMD="./kcov-master/tmp/usr/local/bin/kcov --exclude-pattern /usr/,/.cargo,/root/.multirust,src/tests,util/json-tests,util/src/network/tests,sync/src/tests,ethcore/src/tests,ethcore/src/evm/tests target/kcov" @@ -70,7 +70,7 @@ after_success: | $KCOV_CMD target/debug/deps/ethcore-* && $KCOV_CMD target/debug/deps/ethsync-* && $KCOV_CMD target/debug/deps/ethcore_rpc-* && - $KCOV_CMD target/debug/deps/ethcore_webapp-* && + $KCOV_CMD target/debug/deps/ethcore_dapps-* && $KCOV_CMD target/debug/deps/ethminer-* && $KCOV_CMD target/debug/deps/ethjson-* && $KCOV_CMD target/debug/parity-* && diff --git a/Cargo.lock b/Cargo.lock index cd40d0974..bb44cdab6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,13 +9,13 @@ dependencies = [ "docopt 0.6.80 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "ethcore 1.2.0", + "ethcore-dapps 1.2.0", "ethcore-devtools 1.2.0", "ethcore-ipc 1.2.0", "ethcore-ipc-codegen 1.2.0", "ethcore-ipc-nano 1.2.0", "ethcore-rpc 1.2.0", "ethcore-util 1.2.0", - "ethcore-webapp 1.2.0", "ethminer 1.2.0", "ethsync 1.2.0", "fdlimit 0.1.0", @@ -255,6 +255,31 @@ dependencies = [ "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "ethcore-dapps" +version = "1.2.0" +dependencies = [ + "clippy 0.0.69 (registry+https://github.com/rust-lang/crates.io-index)", + "ethcore-rpc 1.2.0", + "ethcore-util 1.2.0", + "hyper 0.9.3 (git+https://github.com/ethcore/hyper)", + "jsonrpc-core 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonrpc-http-server 5.1.0 (git+https://github.com/ethcore/jsonrpc-http-server.git)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", + "parity-dapps-builtins 0.5.0 (git+https://github.com/ethcore/parity-dapps-builtins-rs.git)", + "parity-dapps-dao 0.3.0 (git+https://github.com/ethcore/parity-dapps-dao-rs.git)", + "parity-dapps-makerotc 0.2.0 (git+https://github.com/ethcore/parity-dapps-makerotc-rs.git)", + "parity-dapps-status 0.5.0 (git+https://github.com/ethcore/parity-dapps-status-rs.git)", + "parity-dapps-wallet 0.5.0 (git+https://github.com/ethcore/parity-dapps-wallet-rs.git)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ethcore-devtools" version = "1.2.0" @@ -351,31 +376,6 @@ dependencies = [ "vergen 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "ethcore-webapp" -version = "1.2.0" -dependencies = [ - "clippy 0.0.69 (registry+https://github.com/rust-lang/crates.io-index)", - "ethcore-rpc 1.2.0", - "ethcore-util 1.2.0", - "hyper 0.9.3 (git+https://github.com/ethcore/hyper)", - "jsonrpc-core 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "jsonrpc-http-server 5.1.0 (git+https://github.com/ethcore/jsonrpc-http-server.git)", - "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-daodapp 0.2.1 (git+https://github.com/ethcore/parity-daodapp-rs.git)", - "parity-idmanager 0.3.2 (git+https://github.com/ethcore/parity-idmanager-rs.git)", - "parity-makerotc 0.1.3 (git+https://github.com/ethcore/parity-makerotc-rs.git)", - "parity-status 0.4.3 (git+https://github.com/ethcore/parity-status.git)", - "parity-wallet 0.4.1 (git+https://github.com/ethcore/parity-wallet.git)", - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", - "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_codegen 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syntex 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ethjson" version = "0.1.0" @@ -676,6 +676,17 @@ dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime_guess" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.5.1" @@ -843,49 +854,92 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "parity-daodapp" -version = "0.2.1" -source = "git+https://github.com/ethcore/parity-daodapp-rs.git#333478fac5b0dfa3c17a740316eda51e5305fc42" +name = "parity-dapps" +version = "0.3.0" +source = "git+https://github.com/ethcore/parity-dapps-rs.git#01ff8c2a3e61ea436f0d47acbbb8ac4bea4cd234" dependencies = [ - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", + "aster 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quasi_codegen 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syntex_syntax 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "parity-idmanager" -version = "0.3.2" -source = "git+https://github.com/ethcore/parity-idmanager-rs.git#5bc85d456455f7b9f6f257021dab9394de9e66b4" +name = "parity-dapps-builtins" +version = "0.5.0" +source = "git+https://github.com/ethcore/parity-dapps-builtins-rs.git#eb86a2954f04d3aa5547a8c4bb77ae7aad09bf55" dependencies = [ - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", ] [[package]] -name = "parity-makerotc" -version = "0.1.3" -source = "git+https://github.com/ethcore/parity-makerotc-rs.git#5fec743658e82b365e1db739a966a69e557b5873" +name = "parity-dapps-dao" +version = "0.3.0" +source = "git+https://github.com/ethcore/parity-dapps-dao-rs.git#5723ccc5b93010caa8f4aee248d89ae13401389b" dependencies = [ - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", ] [[package]] -name = "parity-status" -version = "0.4.3" -source = "git+https://github.com/ethcore/parity-status.git#606dfe6d272792f2fdb90909318f2439d58330a5" -dependencies = [ - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", -] - -[[package]] -name = "parity-wallet" -version = "0.4.1" -source = "git+https://github.com/ethcore/parity-wallet.git#6e714a31cdc26cc86f0edb14fd1ae1dc7d496d1e" -dependencies = [ - "parity-webapp 0.2.0 (git+https://github.com/ethcore/parity-webapp.git)", -] - -[[package]] -name = "parity-webapp" +name = "parity-dapps-makerotc" version = "0.2.0" -source = "git+https://github.com/ethcore/parity-webapp.git#f31681af69631bcadfbef89a7e60dcc49552f7c6" +source = "git+https://github.com/ethcore/parity-dapps-makerotc-rs.git#39e654469ab659dc5570ba1ec94ca0f943aaff16" +dependencies = [ + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", +] + +[[package]] +name = "parity-dapps-status" +version = "0.5.0" +source = "git+https://github.com/ethcore/parity-dapps-status-rs.git#e1caeeacf4b29da586572798881974521e6e8caf" +dependencies = [ + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", +] + +[[package]] +name = "parity-dapps-wallet" +version = "0.5.0" +source = "git+https://github.com/ethcore/parity-dapps-wallet-rs.git#37b1691d74ad9bdabc64f58684d9d0a6d1aeef66" +dependencies = [ + "parity-dapps 0.3.0 (git+https://github.com/ethcore/parity-dapps-rs.git)", +] + +[[package]] +name = "phf" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "primal" diff --git a/Cargo.toml b/Cargo.toml index 5193e2435..eb1b87dfe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ ethsync = { path = "sync" } ethminer = { path = "miner" } ethcore-devtools = { path = "devtools" } ethcore-rpc = { path = "rpc", optional = true } -ethcore-webapp = { path = "webapp", optional = true } +ethcore-dapps = { path = "dapps", optional = true } semver = "0.2" ethcore-ipc-nano = { path = "ipc/nano" } ethcore-ipc = { path = "ipc/rpc" } @@ -42,11 +42,11 @@ version = "0.8" default-features = false [features] -default = ["rpc", "webapp"] +default = ["rpc", "dapps"] rpc = ["ethcore-rpc"] -webapp = ["ethcore-webapp"] +dapps = ["ethcore-dapps"] dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethminer/dev", -"ethcore-webapp/dev"] +"ethcore-dapps/dev"] travis-beta = ["ethcore/json-tests"] travis-nightly = ["ethcore/json-tests", "dev"] diff --git a/cov.sh b/cov.sh index 1698d6f36..7145dfab4 100755 --- a/cov.sh +++ b/cov.sh @@ -23,7 +23,7 @@ cargo test \ -p ethcore-rpc \ -p parity \ -p ethminer \ - -p ethcore-webapp \ + -p ethcore-dapps \ --no-run || exit $? rm -rf target/coverage mkdir -p target/coverage @@ -34,6 +34,6 @@ kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage t kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_util-* kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethsync-* kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_rpc-* -kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_webapp-* +kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethcore_dapps-* kcov --exclude-pattern $EXCLUDE --include-pattern src --verify target/coverage target/debug/deps/ethminer-* xdg-open target/coverage/index.html diff --git a/dapps/Cargo.toml b/dapps/Cargo.toml new file mode 100644 index 000000000..219904b4c --- /dev/null +++ b/dapps/Cargo.toml @@ -0,0 +1,40 @@ +[package] +description = "Parity Dapps crate" +name = "ethcore-dapps" +version = "1.2.0" +license = "GPL-3.0" +authors = ["Ethcore &'static str { } pub fn utils() -> Box { - Box::new(PageEndpoint::with_prefix(parity_idmanager::App::default(), UTILS_PATH.to_owned())) + Box::new(PageEndpoint::with_prefix(parity_dapps_builtins::App::default(), UTILS_PATH.to_owned())) } pub fn all_endpoints() -> Endpoints { let mut pages = Endpoints::new(); pages.insert("proxy".to_owned(), ProxyPac::boxed()); - insert::(&mut pages, "status"); - insert::(&mut pages, "parity"); - insert::(&mut pages, "home"); + insert::(&mut pages, "status"); + insert::(&mut pages, "parity"); + insert::(&mut pages, "home"); wallet_page(&mut pages); daodapp_page(&mut pages); @@ -50,28 +50,28 @@ pub fn all_endpoints() -> Endpoints { pages } -#[cfg(feature = "parity-wallet")] +#[cfg(feature = "parity-dapps-wallet")] fn wallet_page(pages: &mut Endpoints) { - extern crate parity_wallet; - insert::(pages, "wallet"); + extern crate parity_dapps_wallet; + insert::(pages, "wallet"); } -#[cfg(not(feature = "parity-wallet"))] +#[cfg(not(feature = "parity-dapps-wallet"))] fn wallet_page(_pages: &mut Endpoints) {} -#[cfg(feature = "parity-daodapp")] +#[cfg(feature = "parity-dapps-daodapp")] fn daodapp_page(pages: &mut Endpoints) { - extern crate parity_daodapp; - insert::(pages, "dao"); + extern crate parity_dapps_daodapp; + insert::(pages, "dao"); } -#[cfg(not(feature = "parity-daodapp"))] +#[cfg(not(feature = "parity-dapps-daodapp"))] fn daodapp_page(_pages: &mut Endpoints) {} -#[cfg(feature = "parity-makerotc")] +#[cfg(feature = "parity-dapps-makerotc")] fn makerotc_page(pages: &mut Endpoints) { - extern crate parity_makerotc; - insert::(pages, "makerotc"); + extern crate parity_dapps_makerotc; + insert::(pages, "makerotc"); } -#[cfg(not(feature = "parity-makerotc"))] +#[cfg(not(feature = "parity-dapps-makerotc"))] fn makerotc_page(_pages: &mut Endpoints) {} fn insert(pages: &mut Endpoints, id: &str) { diff --git a/webapp/src/endpoint.rs b/dapps/src/endpoint.rs similarity index 94% rename from webapp/src/endpoint.rs rename to dapps/src/endpoint.rs index ebb665b9d..60708f549 100644 --- a/webapp/src/endpoint.rs +++ b/dapps/src/endpoint.rs @@ -32,11 +32,11 @@ pub struct EndpointPath { #[derive(Debug, PartialEq)] pub struct EndpointInfo { - pub name: String, - pub description: String, - pub version: String, - pub author: String, - pub icon_url: String, + pub name: &'static str, + pub description: &'static str, + pub version: &'static str, + pub author: &'static str, + pub icon_url: &'static str, } pub trait Endpoint : Send + Sync { diff --git a/webapp/src/lib.rs b/dapps/src/lib.rs similarity index 97% rename from webapp/src/lib.rs rename to dapps/src/lib.rs index 4cf8f0764..c6e75072d 100644 --- a/webapp/src/lib.rs +++ b/dapps/src/lib.rs @@ -17,11 +17,11 @@ //! Ethcore Webapplications for Parity //! ``` //! extern crate jsonrpc_core; -//! extern crate ethcore_webapp; +//! extern crate ethcore_dapps; //! //! use std::sync::Arc; //! use jsonrpc_core::IoHandler; -//! use ethcore_webapp::*; +//! use ethcore_dapps::*; //! //! struct SayHello; //! impl MethodCommand for SayHello { @@ -51,7 +51,7 @@ extern crate serde; extern crate serde_json; extern crate jsonrpc_core; extern crate jsonrpc_http_server; -extern crate parity_webapp; +extern crate parity_dapps; mod endpoint; mod apps; @@ -75,7 +75,7 @@ pub struct ServerBuilder { } impl ServerBuilder { - /// Construct new webapps + /// Construct new dapps server pub fn new() -> Self { ServerBuilder { handler: Arc::new(IoHandler::new()) diff --git a/webapp/src/page/mod.rs b/dapps/src/page/mod.rs similarity index 98% rename from webapp/src/page/mod.rs rename to dapps/src/page/mod.rs index a7c49dced..71989bca7 100644 --- a/webapp/src/page/mod.rs +++ b/dapps/src/page/mod.rs @@ -23,7 +23,7 @@ use hyper::status::StatusCode; use hyper::net::HttpStream; use hyper::{Decoder, Encoder, Next}; use endpoint::{Endpoint, EndpointInfo, EndpointPath}; -use parity_webapp::{WebApp, Info}; +use parity_dapps::{WebApp, Info}; pub struct PageEndpoint { /// Content of the files @@ -159,7 +159,7 @@ impl server::Handler for PageHandler { #[cfg(test)] -use parity_webapp::File; +use parity_dapps::File; #[cfg(test)] #[derive(Default)] diff --git a/webapp/src/proxypac.rs b/dapps/src/proxypac.rs similarity index 100% rename from webapp/src/proxypac.rs rename to dapps/src/proxypac.rs diff --git a/webapp/src/router/auth.rs b/dapps/src/router/auth.rs similarity index 100% rename from webapp/src/router/auth.rs rename to dapps/src/router/auth.rs diff --git a/webapp/src/router/mod.rs b/dapps/src/router/mod.rs similarity index 100% rename from webapp/src/router/mod.rs rename to dapps/src/router/mod.rs diff --git a/webapp/src/router/redirect.rs b/dapps/src/router/redirect.rs similarity index 100% rename from webapp/src/router/redirect.rs rename to dapps/src/router/redirect.rs diff --git a/webapp/src/router/url.rs b/dapps/src/router/url.rs similarity index 100% rename from webapp/src/router/url.rs rename to dapps/src/router/url.rs diff --git a/webapp/src/rpc.rs b/dapps/src/rpc.rs similarity index 100% rename from webapp/src/rpc.rs rename to dapps/src/rpc.rs diff --git a/doc.sh b/doc.sh index 9b0f13817..68f2e2b4d 100755 --- a/doc.sh +++ b/doc.sh @@ -7,6 +7,6 @@ cargo doc --no-deps --verbose \ -p ethcore \ -p ethsync \ -p ethcore-rpc \ - -p ethcore-webapp \ + -p ethcore-dapps \ -p parity \ -p ethminer diff --git a/fmt.sh b/fmt.sh index 4d835967f..81bd4fafc 100755 --- a/fmt.sh +++ b/fmt.sh @@ -9,7 +9,7 @@ $RUSTFMT ./json/src/lib.rs $RUSTFMT ./miner/src/lib.rs $RUSTFMT ./parity/main.rs $RUSTFMT ./rpc/src/lib.rs -$RUSTFMT ./webapp/src/lib.rs +$RUSTFMT ./dapps/src/lib.rs $RUSTFMT ./sync/src/lib.rs $RUSTFMT ./util/src/lib.rs diff --git a/hook.sh b/hook.sh index 7fac4a834..667daafe4 100755 --- a/hook.sh +++ b/hook.sh @@ -7,6 +7,6 @@ echo "set -e" >> $FILE echo "cargo build --features dev" >> $FILE # Build tests echo "cargo test --no-run --features dev \\" >> $FILE -echo " -p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethminer -p ethcore-webapp" >> $FILE +echo " -p ethash -p ethcore-util -p ethcore -p ethsync -p ethcore-rpc -p parity -p ethminer -p ethcore-dapps" >> $FILE echo "" >> $FILE chmod +x $FILE diff --git a/parity/cli.rs b/parity/cli.rs index 6d5cdee19..4bb74f188 100644 --- a/parity/cli.rs +++ b/parity/cli.rs @@ -84,19 +84,18 @@ API and Console Options: --ipc-apis APIS Specify custom API set available via JSON-RPC over IPC [default: web3,eth,net,personal,ethcore]. - --webapp-off Disable the web applications server (e.g. status - page). - --webapp-port PORT Specify the port portion of the WebApps server + --dapps-off Disable the Dapps server (e.g. status page). + --dapps-port PORT Specify the port portion of the Dapps server [default: 8080]. - --webapp-interface IP Specify the hostname portion of the WebApps + --dapps-interface IP Specify the hostname portion of the Dapps server, IP should be an interface's IP address, or all (all interfaces) or local [default: local]. - --webapp-user USERNAME Specify username for WebApps server. It will be + --dapps-user USERNAME Specify username for Dapps server. It will be used in HTTP Basic Authentication Scheme. - If --webapp-pass is not specified you will be + If --dapps-pass is not specified you will be asked for password on startup. - --webapp-pass PASSWORD Specify password for WebApps server. Use only in - conjunction with --webapp-user. + --dapps-pass PASSWORD Specify password for Dapps server. Use only in + conjunction with --dapps-user. Sealing/Mining Options: --force-sealing Force the node to author new blocks as if it were @@ -168,7 +167,7 @@ Legacy Options: --nodekey KEY Equivalent to --node-key KEY. --nodiscover Equivalent to --no-discovery. -j --jsonrpc Does nothing; JSON-RPC is on by default now. - -w --webapp Does nothing; web app server is on by default now. + -w --webapp Does nothing; dapps server is on by default now. --rpc Does nothing; JSON-RPC is on by default now. --rpcaddr IP Equivalent to --jsonrpc-interface IP. --rpcport PORT Equivalent to --jsonrpc-port PORT. @@ -230,11 +229,11 @@ pub struct Args { pub flag_ipc_off: bool, pub flag_ipc_path: String, pub flag_ipc_apis: String, - pub flag_webapp_off: bool, - pub flag_webapp_port: u16, - pub flag_webapp_interface: String, - pub flag_webapp_user: Option, - pub flag_webapp_pass: Option, + pub flag_dapps_off: bool, + pub flag_dapps_port: u16, + pub flag_dapps_interface: String, + pub flag_dapps_user: Option, + pub flag_dapps_pass: Option, pub flag_force_sealing: bool, pub flag_author: String, pub flag_usd_per_tx: String, diff --git a/parity/webapp.rs b/parity/dapps.rs similarity index 89% rename from parity/webapp.rs rename to parity/dapps.rs index d9ec32c60..1646d7f35 100644 --- a/parity/webapp.rs +++ b/parity/dapps.rs @@ -26,9 +26,9 @@ use util::keys::store::{AccountService}; use util::network_settings::NetworkSettings; use die::*; -#[cfg(feature = "webapp")] -pub use ethcore_webapp::Server as WebappServer; -#[cfg(not(feature = "webapp"))] +#[cfg(feature = "dapps")] +pub use ethcore_dapps::Server as WebappServer; +#[cfg(not(feature = "dapps"))] pub struct WebappServer; pub struct Configuration { @@ -74,11 +74,11 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option, @@ -86,16 +86,16 @@ pub fn setup_webapp_server( die!("Your Parity version has been compiled without WebApps support.") } -#[cfg(feature = "webapp")] -pub fn setup_webapp_server( +#[cfg(feature = "dapps")] +pub fn setup_dapps_server( deps: Dependencies, url: &SocketAddr, auth: Option<(String, String)> ) -> WebappServer { use ethcore_rpc::v1::*; - use ethcore_webapp as webapp; + use ethcore_dapps as dapps; - let server = webapp::ServerBuilder::new(); + let server = dapps::ServerBuilder::new(); server.add_delegate(Web3Client::new().to_delegate()); server.add_delegate(NetClient::new(&deps.sync).to_delegate()); server.add_delegate(EthClient::new(&deps.client, &deps.sync, &deps.secret_store, &deps.miner, &deps.external_miner).to_delegate()); @@ -113,7 +113,7 @@ pub fn setup_webapp_server( }; match start_result { - Err(webapp::ServerError::IoError(err)) => die_with_io_error("WebApps", err), + Err(dapps::ServerError::IoError(err)) => die_with_io_error("WebApps", err), Err(e) => die!("WebApps: {:?}", e), Ok(server) => { server.set_panic_handler(move || { diff --git a/parity/main.rs b/parity/main.rs index 5bdbce9c5..36972e609 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -47,8 +47,8 @@ extern crate json_ipc_server as jsonipc; #[cfg(feature = "rpc")] extern crate ethcore_rpc; -#[cfg(feature = "webapp")] -extern crate ethcore_webapp; +#[cfg(feature = "dapps")] +extern crate ethcore_dapps; #[macro_use] mod die; @@ -57,7 +57,7 @@ mod upgrade; mod hypervisor; mod setup_log; mod rpc; -mod webapp; +mod dapps; mod informant; mod io_handler; mod cli; @@ -81,7 +81,7 @@ use informant::Informant; use die::*; use cli::print_version; use rpc::RpcServer; -use webapp::WebappServer; +use dapps::WebappServer; use io_handler::ClientIoHandler; use configuration::Configuration; @@ -198,14 +198,14 @@ fn execute_client(conf: Configuration) { // setup ipc rpc let _ipc_server = rpc::new_ipc(conf.ipc_settings(), &dependencies); - if conf.args.flag_webapp { println!("WARNING: Flag -w/--webapp is deprecated. Web app server is now on by default. Ignoring."); } - let webapp_server = webapp::new(webapp::Configuration { - enabled: !conf.args.flag_webapp_off, - interface: conf.args.flag_webapp_interface.clone(), - port: conf.args.flag_webapp_port, - user: conf.args.flag_webapp_user.clone(), - pass: conf.args.flag_webapp_pass.clone(), - }, webapp::Dependencies { + if conf.args.flag_webapp { println!("WARNING: Flag -w/--webapp is deprecated. Dapps server is now on by default. Ignoring."); } + let dapps_server = dapps::new(dapps::Configuration { + enabled: !conf.args.flag_dapps_off, + interface: conf.args.flag_dapps_interface.clone(), + port: conf.args.flag_dapps_port, + user: conf.args.flag_dapps_user.clone(), + pass: conf.args.flag_dapps_pass.clone(), + }, dapps::Dependencies { panic_handler: panic_handler.clone(), client: client.clone(), sync: sync.clone(), @@ -226,7 +226,7 @@ fn execute_client(conf: Configuration) { service.io().register_handler(io_handler).expect("Error registering IO handler"); // Handle exit - wait_for_exit(panic_handler, rpc_server, webapp_server); + wait_for_exit(panic_handler, rpc_server, dapps_server); } fn flush_stdout() { @@ -396,7 +396,7 @@ fn execute_import(conf: Configuration) { do_import(bytes); } } - DataFormat::Hex => { + DataFormat::Hex => { for line in BufReader::new(instream).lines() { let s = line.unwrap_or_else(|_| die!("Error reading from the file/stream.")); let s = if first_read > 0 {str::from_utf8(&first_bytes).unwrap().to_owned() + &(s[..])} else {s}; @@ -438,7 +438,7 @@ fn execute_account_cli(conf: Configuration) { } } -fn wait_for_exit(panic_handler: Arc, _rpc_server: Option, _webapp_server: Option) { +fn wait_for_exit(panic_handler: Arc, _rpc_server: Option, _dapps_server: Option) { let exit = Arc::new(Condvar::new()); // Handle possible exits diff --git a/test.sh b/test.sh index 5094158cc..786ae2b37 100755 --- a/test.sh +++ b/test.sh @@ -7,7 +7,7 @@ cargo test --features ethcore/json-tests $1 \ -p ethcore \ -p ethsync \ -p ethcore-rpc \ - -p ethcore-webapp \ + -p ethcore-dapps \ -p parity \ -p ethminer \ -p bigint diff --git a/webapp/Cargo.toml b/webapp/Cargo.toml deleted file mode 100644 index c8eebc4d5..000000000 --- a/webapp/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -description = "Parity WebApplications crate" -name = "ethcore-webapp" -version = "1.2.0" -license = "GPL-3.0" -authors = ["Ethcore