V2.5.6 stable (#10961)
- Fix cargo audit (#10921) - Add support for Energy Web Foundation's new chains (#10957) - Kaspersky AV whitelisting (#10919) - Avast whitelist script (#10900) - Docker images renaming (#10863) - Remove excessive warning (#10831) - Allow --nat extip:your.host.here.org (#10830) - When updating the client or when called from RPC, sleep should mean sleep (#10814) - added new ropsten-bootnode and removed old one (#10794) - ethkey no longer uses byteorder (#10786) - Do not drop the peer with None difficulty (#10772) - docs: Update Readme with TOC, Contributor Guideline. Update Cargo package descriptions (#10652)
This commit is contained in:
@@ -300,7 +300,7 @@ usage! {
|
||||
|
||||
ARG arg_chain: (String) = "foundation", or |c: &Config| c.parity.as_ref()?.chain.clone(),
|
||||
"--chain=[CHAIN]",
|
||||
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, tobalaba, expanse, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, or dev.",
|
||||
"Specify the blockchain type. CHAIN may be either a JSON chain specification file or ethereum, classic, poacore, volta, ewc, expanse, musicoin, ellaism, mix, callisto, morden, ropsten, kovan, rinkeby, goerli, kotti, poasokol, testnet, or dev.",
|
||||
|
||||
ARG arg_keys_path: (String) = "$BASE/keys", or |c: &Config| c.parity.as_ref()?.keys_path.clone(),
|
||||
"--keys-path=[PATH]",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::time::Duration;
|
||||
use std::io::Read;
|
||||
use std::net::SocketAddr;
|
||||
use std::net::{SocketAddr, ToSocketAddrs};
|
||||
use std::num::NonZeroU32;
|
||||
use std::path::PathBuf;
|
||||
use std::collections::{HashSet, BTreeMap};
|
||||
@@ -725,9 +725,18 @@ impl Configuration {
|
||||
let port = self.args.arg_ports_shift + self.args.arg_port;
|
||||
let listen_address = SocketAddr::new(self.interface(&self.args.arg_interface).parse().unwrap(), port);
|
||||
let public_address = if self.args.arg_nat.starts_with("extip:") {
|
||||
let host = &self.args.arg_nat[6..];
|
||||
let host = host.parse().map_err(|_| format!("Invalid host given with `--nat extip:{}`", host))?;
|
||||
Some(SocketAddr::new(host, port))
|
||||
let host = self.args.arg_nat[6..].split(':').next().expect("split has at least one part; qed");
|
||||
let host = format!("{}:{}", host, port);
|
||||
match host.to_socket_addrs() {
|
||||
Ok(mut addr_iter) => {
|
||||
if let Some(addr) = addr_iter.next() {
|
||||
Some(addr)
|
||||
} else {
|
||||
return Err(format!("Invalid host given with `--nat extip:{}`", &self.args.arg_nat[6..]))
|
||||
}
|
||||
},
|
||||
Err(_) => return Err(format!("Invalid host given with `--nat extip:{}`", &self.args.arg_nat[6..]))
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@@ -1839,6 +1848,33 @@ mod tests {
|
||||
assert_eq!(conf1.ipfs_config().port, 5002);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_resolve_external_nat_hosts() {
|
||||
// Ip works
|
||||
let conf = parse(&["parity", "--nat", "extip:1.1.1.1"]);
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().ip().to_string(), "1.1.1.1");
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().port(), 30303);
|
||||
|
||||
// Ip with port works, port is discarded
|
||||
let conf = parse(&["parity", "--nat", "extip:192.168.1.1:123"]);
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().ip().to_string(), "192.168.1.1");
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().port(), 30303);
|
||||
|
||||
// Hostname works
|
||||
let conf = parse(&["parity", "--nat", "extip:ethereum.org"]);
|
||||
assert!(conf.net_addresses().unwrap().1.is_some());
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().port(), 30303);
|
||||
|
||||
// Hostname works, garbage at the end is discarded
|
||||
let conf = parse(&["parity", "--nat", "extip:ethereum.org:whatever bla bla 123"]);
|
||||
assert!(conf.net_addresses().unwrap().1.is_some());
|
||||
assert_eq!(conf.net_addresses().unwrap().1.unwrap().port(), 30303);
|
||||
|
||||
// Garbage is error
|
||||
let conf = parse(&["parity", "--nat", "extip:blabla"]);
|
||||
assert!(conf.net_addresses().is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_expose_all_servers() {
|
||||
// given
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
description = "Log implementation for Parity"
|
||||
description = "Parity Ethereum Logger Implementation"
|
||||
name = "ethcore-logger"
|
||||
version = "1.12.0"
|
||||
license = "GPL-3.0"
|
||||
|
||||
@@ -36,7 +36,8 @@ pub enum SpecType {
|
||||
Foundation,
|
||||
Classic,
|
||||
Poanet,
|
||||
Tobalaba,
|
||||
Volta,
|
||||
Ewc,
|
||||
Expanse,
|
||||
Musicoin,
|
||||
Ellaism,
|
||||
@@ -67,7 +68,8 @@ impl str::FromStr for SpecType {
|
||||
"ethereum" | "frontier" | "homestead" | "byzantium" | "foundation" | "mainnet" => SpecType::Foundation,
|
||||
"classic" | "frontier-dogmatic" | "homestead-dogmatic" => SpecType::Classic,
|
||||
"poanet" | "poacore" => SpecType::Poanet,
|
||||
"tobalaba" => SpecType::Tobalaba,
|
||||
"volta" => SpecType::Volta,
|
||||
"ewc" | "energyweb" => SpecType::Ewc,
|
||||
"expanse" => SpecType::Expanse,
|
||||
"musicoin" => SpecType::Musicoin,
|
||||
"ellaism" => SpecType::Ellaism,
|
||||
@@ -93,7 +95,8 @@ impl fmt::Display for SpecType {
|
||||
SpecType::Foundation => "foundation",
|
||||
SpecType::Classic => "classic",
|
||||
SpecType::Poanet => "poanet",
|
||||
SpecType::Tobalaba => "tobalaba",
|
||||
SpecType::Volta => "volta",
|
||||
SpecType::Ewc => "energyweb",
|
||||
SpecType::Expanse => "expanse",
|
||||
SpecType::Musicoin => "musicoin",
|
||||
SpecType::Ellaism => "ellaism",
|
||||
@@ -119,7 +122,8 @@ impl SpecType {
|
||||
SpecType::Foundation => Ok(ethereum::new_foundation(params)),
|
||||
SpecType::Classic => Ok(ethereum::new_classic(params)),
|
||||
SpecType::Poanet => Ok(ethereum::new_poanet(params)),
|
||||
SpecType::Tobalaba => Ok(ethereum::new_tobalaba(params)),
|
||||
SpecType::Volta => Ok(ethereum::new_volta(params)),
|
||||
SpecType::Ewc => Ok(ethereum::new_ewc(params)),
|
||||
SpecType::Expanse => Ok(ethereum::new_expanse(params)),
|
||||
SpecType::Musicoin => Ok(ethereum::new_musicoin(params)),
|
||||
SpecType::Ellaism => Ok(ethereum::new_ellaism(params)),
|
||||
@@ -376,7 +380,9 @@ mod tests {
|
||||
assert_eq!(SpecType::Classic, "homestead-dogmatic".parse().unwrap());
|
||||
assert_eq!(SpecType::Poanet, "poanet".parse().unwrap());
|
||||
assert_eq!(SpecType::Poanet, "poacore".parse().unwrap());
|
||||
assert_eq!(SpecType::Tobalaba, "tobalaba".parse().unwrap());
|
||||
assert_eq!(SpecType::Volta, "volta".parse().unwrap());
|
||||
assert_eq!(SpecType::Ewc, "ewc".parse().unwrap());
|
||||
assert_eq!(SpecType::Ewc, "energyweb".parse().unwrap());
|
||||
assert_eq!(SpecType::Expanse, "expanse".parse().unwrap());
|
||||
assert_eq!(SpecType::Musicoin, "musicoin".parse().unwrap());
|
||||
assert_eq!(SpecType::Ellaism, "ellaism".parse().unwrap());
|
||||
@@ -405,7 +411,8 @@ mod tests {
|
||||
assert_eq!(format!("{}", SpecType::Foundation), "foundation");
|
||||
assert_eq!(format!("{}", SpecType::Classic), "classic");
|
||||
assert_eq!(format!("{}", SpecType::Poanet), "poanet");
|
||||
assert_eq!(format!("{}", SpecType::Tobalaba), "tobalaba");
|
||||
assert_eq!(format!("{}", SpecType::Volta), "volta");
|
||||
assert_eq!(format!("{}", SpecType::Ewc), "energyweb");
|
||||
assert_eq!(format!("{}", SpecType::Expanse), "expanse");
|
||||
assert_eq!(format!("{}", SpecType::Musicoin), "musicoin");
|
||||
assert_eq!(format!("{}", SpecType::Ellaism), "ellaism");
|
||||
|
||||
Reference in New Issue
Block a user