Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create development vs production environment hooks into net scripts #6974

Merged
merged 3 commits into from
Nov 15, 2019
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
16 changes: 12 additions & 4 deletions genesis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
&timing::duration_as_ms(&PohConfig::default().target_tick_duration).to_string();
let default_ticks_per_slot = &clock::DEFAULT_TICKS_PER_SLOT.to_string();
let default_slots_per_epoch = &EpochSchedule::default().slots_per_epoch.to_string();
let default_operating_mode = "softlaunch";

let matches = App::new(crate_name!())
.about(crate_description!())
Expand Down Expand Up @@ -295,9 +296,16 @@ fn main() -> Result<(), Box<dyn error::Error>> {
.help("The location of pubkey for primordial accounts and balance"),
)
.arg(
Arg::with_name("development")
.long("dev")
.help("Configure the cluster for development mode where all features are available at epoch 0"),
Arg::with_name("operating_mode")
.long("operating-mode")
.possible_value("development")
.possible_value("softlaunch")
.takes_value(true)
.default_value(default_operating_mode)
.help(
"Configure the cluster for \"development\" mode where all features are available at epoch 0, \
or \"softlaunch\" mode where some features are disabled at epoch 0"
),
)
.get_matches();

Expand Down Expand Up @@ -380,7 +388,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
}
}

let operating_mode = if matches.is_present("development") {
let operating_mode = if matches.value_of("operating_mode").unwrap() == "development" {
OperatingMode::Development
} else {
OperatingMode::SoftLaunch
Expand Down
2 changes: 1 addition & 1 deletion multinode-demo/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ default_arg --bootstrap-storage-pubkey "$SOLANA_CONFIG_DIR"/bootstrap-leader/sto
default_arg --ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader
default_arg --mint "$SOLANA_CONFIG_DIR"/mint-keypair.json
default_arg --hashes-per-tick auto
default_arg --dev
default_arg --operating-mode development
$solana_genesis "${args[@]}"

(
Expand Down
17 changes: 15 additions & 2 deletions net/net.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ Operate a configured testnet

--use-move - Build the move-loader-program and add it to the cluster

--operating-mode development|softlaunch
- Specify whether or not to launch the cluster in "development" mode with all features enabled at epoch 0,
or "softlaunch" mode with some features disabled at epoch 0 (default: development)

sanity/start-specific options:
-F - Discard validator nodes that didn't bootup successfully
-o noInstallCheck - Skip solana-install sanity
Expand Down Expand Up @@ -167,6 +171,17 @@ while [[ -n $1 ]]; do
elif [[ $1 = --lamports ]]; then
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --operating-mode ]]; then
case "$2" in
development|softlaunch)
;;
*)
echo "Unexpected operating mode: \"$2\""
exit 1
;;
esac
genesisOptions="$genesisOptions $1 $2"
shift 2
elif [[ $1 = --no-snapshot-fetch ]]; then
maybeNoSnapshot="$1"
shift 1
Expand Down Expand Up @@ -835,7 +850,6 @@ deploy() {
echo "Network start logs in $netLogDir"
}


stopNode() {
local ipAddress=$1
local block=$2
Expand Down Expand Up @@ -907,7 +921,6 @@ stop() {
echo "Stopping nodes took $SECONDS seconds"
}


checkPremptibleInstances() {
# The validatorIpList nodes may be preemptible instances that can disappear at
# any time. Try to detect when a validator has been preempted to help the user
Expand Down