Create development vs softlaunch environment hooks into net scripts (#6974)
This commit is contained in:
parent
0ca943f49b
commit
946e937549
|
@ -111,6 +111,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
&timing::duration_as_ms(&PohConfig::default().target_tick_duration).to_string();
|
&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_ticks_per_slot = &clock::DEFAULT_TICKS_PER_SLOT.to_string();
|
||||||
let default_slots_per_epoch = &EpochSchedule::default().slots_per_epoch.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!())
|
let matches = App::new(crate_name!())
|
||||||
.about(crate_description!())
|
.about(crate_description!())
|
||||||
|
@ -296,9 +297,16 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
.help("The location of pubkey for primordial accounts and balance"),
|
.help("The location of pubkey for primordial accounts and balance"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("development")
|
Arg::with_name("operating_mode")
|
||||||
.long("dev")
|
.long("operating-mode")
|
||||||
.help("Configure the cluster for development mode where all features are available at epoch 0"),
|
.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();
|
.get_matches();
|
||||||
|
|
||||||
|
@ -381,7 +389,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
|
OperatingMode::Development
|
||||||
} else {
|
} else {
|
||||||
OperatingMode::SoftLaunch
|
OperatingMode::SoftLaunch
|
||||||
|
|
|
@ -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 --ledger "$SOLANA_CONFIG_DIR"/bootstrap-leader
|
||||||
default_arg --mint "$SOLANA_CONFIG_DIR"/mint-keypair.json
|
default_arg --mint "$SOLANA_CONFIG_DIR"/mint-keypair.json
|
||||||
default_arg --hashes-per-tick auto
|
default_arg --hashes-per-tick auto
|
||||||
default_arg --dev
|
default_arg --operating-mode development
|
||||||
$solana_genesis "${args[@]}"
|
$solana_genesis "${args[@]}"
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
17
net/net.sh
17
net/net.sh
|
@ -88,6 +88,10 @@ Operate a configured testnet
|
||||||
|
|
||||||
--use-move - Build the move-loader-program and add it to the cluster
|
--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:
|
sanity/start-specific options:
|
||||||
-F - Discard validator nodes that didn't bootup successfully
|
-F - Discard validator nodes that didn't bootup successfully
|
||||||
-o noInstallCheck - Skip solana-install sanity
|
-o noInstallCheck - Skip solana-install sanity
|
||||||
|
@ -171,6 +175,17 @@ while [[ -n $1 ]]; do
|
||||||
elif [[ $1 = --lamports ]]; then
|
elif [[ $1 = --lamports ]]; then
|
||||||
genesisOptions="$genesisOptions $1 $2"
|
genesisOptions="$genesisOptions $1 $2"
|
||||||
shift 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
|
elif [[ $1 = --no-snapshot-fetch ]]; then
|
||||||
maybeNoSnapshot="$1"
|
maybeNoSnapshot="$1"
|
||||||
shift 1
|
shift 1
|
||||||
|
@ -845,7 +860,6 @@ deploy() {
|
||||||
echo "Network start logs in $netLogDir"
|
echo "Network start logs in $netLogDir"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stopNode() {
|
stopNode() {
|
||||||
local ipAddress=$1
|
local ipAddress=$1
|
||||||
local block=$2
|
local block=$2
|
||||||
|
@ -917,7 +931,6 @@ stop() {
|
||||||
echo "Stopping nodes took $SECONDS seconds"
|
echo "Stopping nodes took $SECONDS seconds"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
checkPremptibleInstances() {
|
checkPremptibleInstances() {
|
||||||
# The validatorIpList nodes may be preemptible instances that can disappear at
|
# 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
|
# any time. Try to detect when a validator has been preempted to help the user
|
||||||
|
|
Loading…
Reference in New Issue