Renaming dapps repos. Updating dapps (#1142)
* Renaming dapps repos. Updating dapps * Skipping legacy options for compatibility. Fixing tabs * Fixing CLI options
This commit is contained in:
@@ -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<String>,
|
||||
pub flag_webapp_pass: Option<String>,
|
||||
pub flag_dapps_off: bool,
|
||||
pub flag_dapps_port: u16,
|
||||
pub flag_dapps_interface: String,
|
||||
pub flag_dapps_user: Option<String>,
|
||||
pub flag_dapps_pass: Option<String>,
|
||||
pub flag_force_sealing: bool,
|
||||
pub flag_author: String,
|
||||
pub flag_usd_per_tx: String,
|
||||
|
||||
@@ -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<WebappSer
|
||||
(username.to_owned(), password)
|
||||
});
|
||||
|
||||
Some(setup_webapp_server(deps, &addr, auth))
|
||||
Some(setup_dapps_server(deps, &addr, auth))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "webapp"))]
|
||||
pub fn setup_webapp_server(
|
||||
#[cfg(not(feature = "dapps"))]
|
||||
pub fn setup_dapps_server(
|
||||
_deps: Dependencies,
|
||||
_url: &SocketAddr,
|
||||
_auth: Option<(String, String)>,
|
||||
@@ -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 || {
|
||||
@@ -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<PanicHandler>, _rpc_server: Option<RpcServer>, _webapp_server: Option<WebappServer>) {
|
||||
fn wait_for_exit(panic_handler: Arc<PanicHandler>, _rpc_server: Option<RpcServer>, _dapps_server: Option<WebappServer>) {
|
||||
let exit = Arc::new(Condvar::new());
|
||||
|
||||
// Handle possible exits
|
||||
|
||||
Reference in New Issue
Block a user