Enabling personal RPC over IPC by default (#3165)

This commit is contained in:
Tomasz Drwięga 2016-11-04 09:58:39 +01:00 committed by Gav Wood
parent c532032372
commit 68f60596dc
4 changed files with 9 additions and 4 deletions

View File

@ -47,7 +47,7 @@ hosts = ["none"]
[ipc] [ipc]
disable = false disable = false
path = "$HOME/.parity/jsonrpc.ipc" path = "$HOME/.parity/jsonrpc.ipc"
apis = ["web3", "eth", "net", "ethcore", "traces", "rpc", "personal_safe"] apis = ["web3", "eth", "net", "ethcore", "traces", "rpc", "personal", "personal_safe"]
[dapps] [dapps]
disable = false disable = false

View File

@ -155,7 +155,7 @@ usage! {
or |c: &Config| otry!(c.ipc).disable.clone(), or |c: &Config| otry!(c.ipc).disable.clone(),
flag_ipc_path: String = "$HOME/.parity/jsonrpc.ipc", flag_ipc_path: String = "$HOME/.parity/jsonrpc.ipc",
or |c: &Config| otry!(c.ipc).path.clone(), or |c: &Config| otry!(c.ipc).path.clone(),
flag_ipc_apis: String = "web3,eth,net,ethcore,traces,rpc,personal_safe", flag_ipc_apis: String = "web3,eth,net,ethcore,traces,rpc,personal,personal_safe",
or |c: &Config| otry!(c.ipc).apis.clone().map(|vec| vec.join(",")), or |c: &Config| otry!(c.ipc).apis.clone().map(|vec| vec.join(",")),
// DAPPS // DAPPS
@ -549,7 +549,7 @@ mod tests {
// IPC // IPC
flag_no_ipc: false, flag_no_ipc: false,
flag_ipc_path: "$HOME/.parity/jsonrpc.ipc".into(), flag_ipc_path: "$HOME/.parity/jsonrpc.ipc".into(),
flag_ipc_apis: "web3,eth,net,ethcore,traces,rpc,personal_safe".into(), flag_ipc_apis: "web3,eth,net,ethcore,traces,rpc,personal,personal_safe".into(),
// DAPPS // DAPPS
flag_no_dapps: false, flag_no_dapps: false,

View File

@ -63,7 +63,7 @@ impl Default for IpcConfiguration {
IpcConfiguration { IpcConfiguration {
enabled: true, enabled: true,
socket_addr: parity_ipc_path("$HOME/.parity/jsonrpc.ipc"), socket_addr: parity_ipc_path("$HOME/.parity/jsonrpc.ipc"),
apis: ApiSet::UnsafeContext, apis: ApiSet::IpcContext,
} }
} }
} }

View File

@ -69,6 +69,7 @@ impl FromStr for Api {
pub enum ApiSet { pub enum ApiSet {
SafeContext, SafeContext,
UnsafeContext, UnsafeContext,
IpcContext,
List(HashSet<Api>), List(HashSet<Api>),
} }
@ -139,6 +140,10 @@ impl ApiSet {
vec![Api::Web3, Api::Net, Api::Eth, Api::Ethcore, Api::Traces, Api::Rpc, Api::PersonalSafe] vec![Api::Web3, Api::Net, Api::Eth, Api::Ethcore, Api::Traces, Api::Rpc, Api::PersonalSafe]
.into_iter().collect() .into_iter().collect()
}, },
ApiSet::IpcContext => {
vec![Api::Web3, Api::Net, Api::Eth, Api::Ethcore, Api::Traces, Api::Rpc, Api::PersonalAccounts, Api::PersonalSafe]
.into_iter().collect()
},
ApiSet::SafeContext => { ApiSet::SafeContext => {
vec![Api::Web3, Api::Net, Api::Eth, Api::PersonalAccounts, Api::PersonalSafe, Api::Signer, Api::Ethcore, Api::EthcoreSet, Api::Traces, Api::Rpc] vec![Api::Web3, Api::Net, Api::Eth, Api::PersonalAccounts, Api::PersonalSafe, Api::Signer, Api::Ethcore, Api::EthcoreSet, Api::Traces, Api::Rpc]
.into_iter().collect() .into_iter().collect()