Merge branch 'master' into switchrpcns
This commit is contained in:
@@ -96,6 +96,8 @@ API and Console Options:
|
||||
asked for password on startup.
|
||||
--dapps-pass PASSWORD Specify password for Dapps server. Use only in
|
||||
conjunction with --dapps-user.
|
||||
--dapps-path PATH Specify directory where dapps should be installed.
|
||||
[default: $HOME/.parity/dapps]
|
||||
|
||||
--signer Enable Trusted Signer WebSocket endpoint used by
|
||||
System UIs.
|
||||
@@ -239,6 +241,7 @@ pub struct Args {
|
||||
pub flag_dapps_interface: String,
|
||||
pub flag_dapps_user: Option<String>,
|
||||
pub flag_dapps_pass: Option<String>,
|
||||
pub flag_dapps_path: String,
|
||||
pub flag_signer: bool,
|
||||
pub flag_signer_port: u16,
|
||||
pub flag_force_sealing: bool,
|
||||
|
||||
@@ -40,6 +40,7 @@ pub struct Configuration {
|
||||
pub struct Directories {
|
||||
pub keys: String,
|
||||
pub db: String,
|
||||
pub dapps: String,
|
||||
}
|
||||
|
||||
impl Configuration {
|
||||
@@ -325,11 +326,14 @@ impl Configuration {
|
||||
&self.args.flag_keys_path
|
||||
}
|
||||
);
|
||||
::std::fs::create_dir_all(&db_path).unwrap_or_else(|e| die_with_io_error("main", e));
|
||||
::std::fs::create_dir_all(&keys_path).unwrap_or_else(|e| die_with_io_error("main", e));
|
||||
let dapps_path = Configuration::replace_home(&self.args.flag_dapps_path);
|
||||
::std::fs::create_dir_all(&dapps_path).unwrap_or_else(|e| die_with_io_error("main", e));
|
||||
|
||||
Directories {
|
||||
keys: keys_path,
|
||||
db: db_path,
|
||||
dapps: dapps_path,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ pub struct Configuration {
|
||||
pub port: u16,
|
||||
pub user: Option<String>,
|
||||
pub pass: Option<String>,
|
||||
pub dapps_path: String,
|
||||
}
|
||||
|
||||
pub struct Dependencies {
|
||||
@@ -63,12 +64,13 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option<WebappSer
|
||||
(username.to_owned(), password)
|
||||
});
|
||||
|
||||
Some(setup_dapps_server(deps, &addr, auth))
|
||||
Some(setup_dapps_server(deps, configuration.dapps_path, &addr, auth))
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "dapps"))]
|
||||
pub fn setup_dapps_server(
|
||||
_deps: Dependencies,
|
||||
_dapps_path: String,
|
||||
_url: &SocketAddr,
|
||||
_auth: Option<(String, String)>,
|
||||
) -> ! {
|
||||
@@ -78,12 +80,13 @@ pub fn setup_dapps_server(
|
||||
#[cfg(feature = "dapps")]
|
||||
pub fn setup_dapps_server(
|
||||
deps: Dependencies,
|
||||
dapps_path: String,
|
||||
url: &SocketAddr,
|
||||
auth: Option<(String, String)>
|
||||
) -> WebappServer {
|
||||
use ethcore_dapps as dapps;
|
||||
|
||||
let server = dapps::ServerBuilder::new();
|
||||
let server = dapps::ServerBuilder::new(dapps_path);
|
||||
let server = rpc_apis::setup_rpc(server, deps.apis.clone(), rpc_apis::ApiSet::UnsafeContext);
|
||||
let start_result = match auth {
|
||||
None => {
|
||||
|
||||
@@ -231,6 +231,7 @@ fn execute_client(conf: Configuration, spec: Spec, client_config: ClientConfig)
|
||||
port: conf.args.flag_dapps_port,
|
||||
user: conf.args.flag_dapps_user.clone(),
|
||||
pass: conf.args.flag_dapps_pass.clone(),
|
||||
dapps_path: conf.directories().dapps,
|
||||
}, dapps::Dependencies {
|
||||
panic_handler: panic_handler.clone(),
|
||||
apis: deps_for_rpc_apis.clone(),
|
||||
|
||||
@@ -51,7 +51,7 @@ fn do_start(conf: Configuration, deps: Dependencies) -> SignerServer {
|
||||
});
|
||||
|
||||
let start_result = {
|
||||
let server = signer::ServerBuilder::new();
|
||||
let server = signer::ServerBuilder::new(deps.apis.signer_queue.clone());
|
||||
let server = rpc_apis::setup_rpc(server, deps.apis, rpc_apis::ApiSet::SafeContext);
|
||||
server.start(addr)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user