Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Add --faucet-port option
Browse files Browse the repository at this point in the history
(cherry picked from commit f804ce6)
  • Loading branch information
mvines committed Apr 14, 2021
1 parent ef3781d commit e92283c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion validator/src/bin/solana-test-validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum Output {

fn main() {
let default_rpc_port = rpc_port::DEFAULT_RPC_PORT.to_string();
let default_faucet_port = FAUCET_PORT.to_string();

let matches = App::new("solana-test-validator")
.about("Test Validator")
Expand Down Expand Up @@ -120,6 +121,15 @@ fn main() {
.conflicts_with("quiet")
.help("Log mode: stream the validator log"),
)
.arg(
Arg::with_name("faucet_port")
.long("faucet-port")
.value_name("PORT")
.takes_value(true)
.default_value(&default_faucet_port)
.validator(solana_validator::port_validator)
.help("Enable the faucet on this port"),
)
.arg(
Arg::with_name("rpc_port")
.long("rpc-port")
Expand Down Expand Up @@ -228,11 +238,12 @@ fn main() {
Output::Dashboard
};
let rpc_port = value_t_or_exit!(matches, "rpc_port", u16);
let faucet_port = value_t_or_exit!(matches, "faucet_port", u16);
let slots_per_epoch = value_t!(matches, "slots_per_epoch", Slot).ok();

let faucet_addr = Some(SocketAddr::new(
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
FAUCET_PORT,
faucet_port,
));
let bpf_jit = !matches.is_present("no_bpf_jit");

Expand Down

0 comments on commit e92283c

Please sign in to comment.