Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions substrate/cli/src/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions substrate/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion substrate/runtime/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ impl<T: Trait> Module<T> {
/// 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
Expand Down