diff --git a/substrate/cli/src/cli.yml b/substrate/cli/src/cli.yml index 9c156061add9b..ace575e6760e5 100644 --- a/substrate/cli/src/cli.yml +++ b/substrate/cli/src/cli.yml @@ -46,6 +46,14 @@ args: value_name: PORT help: Specify p2p protocol TCP port takes_value: true + - rpc-external: + long: rpc-external + help: Listen to all RPC interfaces (default is local) + takes_value: false + - ws-external: + long: ws-external + help: Listen to all Websocket interfaces (default is local) + takes_value: false - rpc-port: long: rpc-port value_name: PORT diff --git a/substrate/cli/src/lib.rs b/substrate/cli/src/lib.rs index d3512a415f1e9..b4dd7f8b37afb 100644 --- a/substrate/cli/src/lib.rs +++ b/substrate/cli/src/lib.rs @@ -295,8 +295,11 @@ where config.keys.push("Alice".into()); } - config.rpc_http = Some(parse_address("127.0.0.1:9933", "rpc-port", &matches)?); - config.rpc_ws = Some(parse_address("127.0.0.1:9944", "ws-port", &matches)?); + let rpc_interface: &str = if matches.is_present("rpc-external") { "0.0.0.0" } else { "127.0.0.1" }; + let ws_interface: &str = if matches.is_present("ws-external") { "0.0.0.0" } else { "127.0.0.1" }; + + config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), "rpc-port", &matches)?); + config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), "ws-port", &matches)?); // Override telemetry if matches.is_present("no-telemetry") { diff --git a/substrate/runtime/staking/src/lib.rs b/substrate/runtime/staking/src/lib.rs index b0436c5fa30ae..f7c03972d574f 100644 --- a/substrate/runtime/staking/src/lib.rs +++ b/substrate/runtime/staking/src/lib.rs @@ -438,7 +438,7 @@ impl Module { /// Returns if the account was successfully updated or update has led to killing of the account. pub fn set_free_balance(who: &T::AccountId, balance: T::Balance) -> UpdateBalanceOutcome { // Commented out for no - but consider it instructive. -// assert!(!Self::voting_balance(who).is_zero()); + // assert!(!Self::voting_balance(who).is_zero()); if balance < Self::existential_deposit() { Self::on_free_too_low(who); UpdateBalanceOutcome::AccountKilled