mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 08:18:04 +00:00
New flags to listen to all interfaces (#495)
* Add new flag to allow listening to all interfaces Fix #439 Fix #494 * Fix capitalisation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -301,8 +301,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") {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user