Merge branch 'master' into auth-bft

This commit is contained in:
keorn
2016-11-25 10:51:06 +00:00
138 changed files with 5226 additions and 1070 deletions

View File

@@ -102,7 +102,7 @@ fn import(i: ImportAccounts) -> Result<String, String> {
let from = DiskDirectory::at(path);
imported += try!(import_accounts(&from, &to).map_err(|_| "Importing accounts failed.")).len();
}
Ok(format!("{}", imported))
Ok(format!("{} account(s) imported", imported))
}
fn import_geth(i: ImportFromGethAccounts) -> Result<String, String> {

View File

@@ -132,6 +132,7 @@ usage! {
or |c: &Config| otry!(c.network).reserved_peers.clone().map(Some),
flag_reserved_only: bool = false,
or |c: &Config| otry!(c.network).reserved_only.clone(),
flag_no_ancient_blocks: bool = false, or |_| None,
// -- API and Console Options
// RPC
@@ -533,6 +534,7 @@ mod tests {
flag_node_key: None,
flag_reserved_peers: Some("./path_to_file".into()),
flag_reserved_only: false,
flag_no_ancient_blocks: false,
// -- API and Console Options
// RPC

View File

@@ -32,7 +32,7 @@ Operating Options:
(default: {flag_mode_alarm}).
--chain CHAIN Specify the blockchain type. CHAIN may be either a
JSON chain specification file or olympic, frontier,
homestead, mainnet, morden, classic, expanse,
homestead, mainnet, morden, ropsten, classic, expanse,
testnet or dev (default: {flag_chain}).
-d --db-path PATH Specify the database & configuration directory path
(default: {flag_db_path}).
@@ -95,6 +95,8 @@ Networking Options:
all - connect to any IP address.
(default: {flag_allow_ips})
--max-pending-peers NUM Allow up to NUM pending connections. (default: {flag_max_pending_peers})
--no-ancient-blocks Disable downloading old blocks after snapshot restoration
or warp sync. (default: {flag_no_ancient_blocks})
API and Console Options:
--no-jsonrpc Disable the JSON-RPC API server. (default: {flag_no_jsonrpc})

View File

@@ -250,6 +250,7 @@ impl Configuration {
custom_bootnodes: self.args.flag_bootnodes.is_some(),
no_periodic_snapshot: self.args.flag_no_periodic_snapshot,
check_seal: !self.args.flag_no_seal_check,
download_old_blocks: !self.args.flag_no_ancient_blocks,
};
Cmd::Run(run_cmd)
};
@@ -313,7 +314,7 @@ impl Configuration {
fn chain(&self) -> String {
if self.args.flag_testnet {
"morden".to_owned()
"ropsten".to_owned()
} else {
self.args.flag_chain.clone()
}
@@ -871,6 +872,7 @@ mod tests {
fat_db: Default::default(),
no_periodic_snapshot: false,
check_seal: true,
download_old_blocks: true,
}));
}
@@ -905,7 +907,7 @@ mod tests {
// then
assert_eq!(conf.network_settings(), NetworkSettings {
name: "testname".to_owned(),
chain: "morden".to_owned(),
chain: "ropsten".to_owned(),
network_port: 30303,
rpc_enabled: true,
rpc_interface: "local".to_owned(),

View File

@@ -91,6 +91,7 @@ pub struct RunCmd {
pub custom_bootnodes: bool,
pub no_periodic_snapshot: bool,
pub check_seal: bool,
pub download_old_blocks: bool,
}
pub fn open_ui(dapps_conf: &dapps::Configuration, signer_conf: &signer::Configuration) -> Result<(), String> {
@@ -202,6 +203,7 @@ pub fn execute(cmd: RunCmd, logger: Arc<RotatingLogger>) -> Result<(), String> {
}
sync_config.fork_block = spec.fork_block();
sync_config.warp_sync = cmd.warp_sync;
sync_config.download_old_blocks = cmd.download_old_blocks;
// prepare account provider
let account_provider = Arc::new(try!(prepare_account_provider(&cmd.dirs, cmd.acc_conf)));