Merge branch 'master' into presale_wallet
This commit is contained in:
@@ -43,12 +43,20 @@ Protocol Options:
|
||||
[default: $HOME/.parity/keys].
|
||||
--identity NAME Specify your node's name.
|
||||
|
||||
DAO-Rescue Soft-fork Options:
|
||||
--help-rescue-dao Does nothing - on by default.
|
||||
--dont-help-rescue-dao Votes against the DAO-rescue soft-fork, but supports
|
||||
it if it is triggered anyway.
|
||||
Equivalent to --gas-floor-target=3141592.
|
||||
--dogmatic Ignores all DAO-rescue soft-fork behaviour. Even if
|
||||
it means losing mining rewards.
|
||||
|
||||
Account Options:
|
||||
--unlock ACCOUNTS Unlock ACCOUNTS for the duration of the execution.
|
||||
ACCOUNTS is a comma-delimited list of addresses.
|
||||
--password FILE Provide a file containing a password for unlocking
|
||||
an account.
|
||||
--keys-iterations NUM Specify the number of iterations to use when
|
||||
--keys-iterations NUM Specify the number of iterations to use when
|
||||
deriving key from the password (bigger is more
|
||||
secure) [default: 10240].
|
||||
--no-import-keys Do not import keys from legacy clients.
|
||||
@@ -230,6 +238,8 @@ pub struct Args {
|
||||
pub flag_chain: String,
|
||||
pub flag_db_path: String,
|
||||
pub flag_identity: String,
|
||||
pub flag_dont_help_rescue_dao: bool,
|
||||
pub flag_dogmatic: bool,
|
||||
pub flag_unlock: Option<String>,
|
||||
pub flag_password: Vec<String>,
|
||||
pub flag_cache: Option<usize>,
|
||||
|
||||
@@ -75,12 +75,18 @@ impl Configuration {
|
||||
}
|
||||
|
||||
pub fn gas_floor_target(&self) -> U256 {
|
||||
let d = &self.args.flag_gas_floor_target;
|
||||
U256::from_dec_str(d).unwrap_or_else(|_| {
|
||||
die!("{}: Invalid target gas floor given. Must be a decimal unsigned 256-bit number.", d)
|
||||
})
|
||||
if self.args.flag_dont_help_rescue_dao || self.args.flag_dogmatic {
|
||||
4_700_000.into()
|
||||
} else {
|
||||
let d = &self.args.flag_gas_floor_target;
|
||||
U256::from_dec_str(d).unwrap_or_else(|_| {
|
||||
die!("{}: Invalid target gas floor given. Must be a decimal unsigned 256-bit number.", d)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub fn gas_price(&self) -> U256 {
|
||||
match self.args.flag_gasprice.as_ref() {
|
||||
Some(d) => {
|
||||
@@ -115,16 +121,20 @@ impl Configuration {
|
||||
}
|
||||
|
||||
pub fn extra_data(&self) -> Bytes {
|
||||
match self.args.flag_extradata.as_ref().or(self.args.flag_extra_data.as_ref()) {
|
||||
Some(ref x) if x.len() <= 32 => x.as_bytes().to_owned(),
|
||||
None => version_data(),
|
||||
Some(ref x) => { die!("{}: Extra data must be at most 32 characters.", x); }
|
||||
if !self.args.flag_dont_help_rescue_dao {
|
||||
(b"rescuedao"[..]).to_owned()
|
||||
} else {
|
||||
match self.args.flag_extradata.as_ref().or(self.args.flag_extra_data.as_ref()) {
|
||||
Some(ref x) if x.len() <= 32 => x.as_bytes().to_owned(),
|
||||
None => version_data(),
|
||||
Some(ref x) => { die!("{}: Extra data must be at most 32 characters.", x); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn spec(&self) -> Spec {
|
||||
match self.chain().as_str() {
|
||||
"frontier" | "homestead" | "mainnet" => ethereum::new_frontier(),
|
||||
"frontier" | "homestead" | "mainnet" => ethereum::new_frontier(!self.args.flag_dogmatic),
|
||||
"morden" | "testnet" => ethereum::new_morden(),
|
||||
"olympic" => ethereum::new_olympic(),
|
||||
f => Spec::load(contents(f).unwrap_or_else(|_| {
|
||||
@@ -155,7 +165,6 @@ impl Configuration {
|
||||
|
||||
pub fn init_reserved_nodes(&self) -> Vec<String> {
|
||||
use std::fs::File;
|
||||
use std::io::BufRead;
|
||||
|
||||
if let Some(ref path) = self.args.flag_reserved_peers {
|
||||
let mut buffer = String::new();
|
||||
|
||||
@@ -150,7 +150,7 @@ pub fn setup_rpc<T: Extendable>(server: T, deps: Arc<Dependencies>, apis: ApiSet
|
||||
server.add_delegate(EthFilterClient::new(&deps.client, &deps.miner).to_delegate());
|
||||
|
||||
if deps.signer_port.is_some() {
|
||||
server.add_delegate(EthSigningQueueClient::new(&deps.signer_queue, &deps.miner).to_delegate());
|
||||
server.add_delegate(EthSigningQueueClient::new(&deps.signer_queue, &deps.client, &deps.miner).to_delegate());
|
||||
} else {
|
||||
server.add_delegate(EthSigningUnsafeClient::new(&deps.client, &deps.secret_store, &deps.miner).to_delegate());
|
||||
}
|
||||
@@ -162,7 +162,8 @@ pub fn setup_rpc<T: Extendable>(server: T, deps: Arc<Dependencies>, apis: ApiSet
|
||||
server.add_delegate(SignerClient::new(&deps.secret_store, &deps.client, &deps.miner, &deps.signer_queue).to_delegate());
|
||||
},
|
||||
Api::Ethcore => {
|
||||
server.add_delegate(EthcoreClient::new(&deps.client, &deps.miner, deps.logger.clone(), deps.settings.clone()).to_delegate())
|
||||
let queue = deps.signer_port.map(|_| deps.signer_queue.clone());
|
||||
server.add_delegate(EthcoreClient::new(&deps.client, &deps.miner, deps.logger.clone(), deps.settings.clone(), queue).to_delegate())
|
||||
},
|
||||
Api::EthcoreSet => {
|
||||
server.add_delegate(EthcoreSetClient::new(&deps.miner, &deps.net_service).to_delegate())
|
||||
|
||||
Reference in New Issue
Block a user