modify-genesis now writes elsewhere and produces a full genesis.tar.bz2
This commit is contained in:
parent
42620e7f39
commit
8df263340f
|
@ -13,7 +13,7 @@ use solana_ledger::entry::Entry;
|
||||||
use solana_ledger::{
|
use solana_ledger::{
|
||||||
ancestor_iterator::AncestorIterator,
|
ancestor_iterator::AncestorIterator,
|
||||||
bank_forks_utils,
|
bank_forks_utils,
|
||||||
blockstore::{Blockstore, PurgeType},
|
blockstore::{create_new_ledger, Blockstore, PurgeType},
|
||||||
blockstore_db::{self, AccessType, BlockstoreRecoveryMode, Column, Database},
|
blockstore_db::{self, AccessType, BlockstoreRecoveryMode, Column, Database},
|
||||||
blockstore_processor::ProcessOptions,
|
blockstore_processor::ProcessOptions,
|
||||||
rooted_slot_iterator::RootedSlotIterator,
|
rooted_slot_iterator::RootedSlotIterator,
|
||||||
|
@ -957,6 +957,13 @@ fn main() {
|
||||||
"Selects the features that will be enabled for the cluster"
|
"Selects the features that will be enabled for the cluster"
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("output_directory")
|
||||||
|
.index(1)
|
||||||
|
.value_name("DIR")
|
||||||
|
.takes_value(true)
|
||||||
|
.help("Output directory for the modified genesis config"),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("shred-version")
|
SubCommand::with_name("shred-version")
|
||||||
|
@ -1319,6 +1326,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
("modify-genesis", Some(arg_matches)) => {
|
("modify-genesis", Some(arg_matches)) => {
|
||||||
let mut genesis_config = open_genesis_config_by(&ledger_path, arg_matches);
|
let mut genesis_config = open_genesis_config_by(&ledger_path, arg_matches);
|
||||||
|
let output_directory = PathBuf::from(arg_matches.value_of("output_directory").unwrap());
|
||||||
|
|
||||||
if let Some(operating_mode) = arg_matches.value_of("operating_mode") {
|
if let Some(operating_mode) = arg_matches.value_of("operating_mode") {
|
||||||
genesis_config.operating_mode = match operating_mode {
|
genesis_config.operating_mode = match operating_mode {
|
||||||
|
@ -1336,11 +1344,19 @@ fn main() {
|
||||||
_ => Some(value_t_or_exit!(arg_matches, "hashes_per_tick", u64)),
|
_ => Some(value_t_or_exit!(arg_matches, "hashes_per_tick", u64)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
genesis_config.write(&ledger_path).unwrap_or_else(|err| {
|
|
||||||
|
create_new_ledger(
|
||||||
|
&output_directory,
|
||||||
|
&genesis_config,
|
||||||
|
solana_runtime::hardened_unpack::MAX_GENESIS_ARCHIVE_UNPACKED_SIZE,
|
||||||
|
AccessType::PrimaryOnly,
|
||||||
|
)
|
||||||
|
.unwrap_or_else(|err| {
|
||||||
eprintln!("Failed to write genesis config: {:?}", err);
|
eprintln!("Failed to write genesis config: {:?}", err);
|
||||||
exit(1);
|
exit(1);
|
||||||
});
|
});
|
||||||
println!("{}", open_genesis_config_by(&ledger_path, arg_matches));
|
|
||||||
|
println!("{}", open_genesis_config_by(&output_directory, arg_matches));
|
||||||
}
|
}
|
||||||
("shred-version", Some(arg_matches)) => {
|
("shred-version", Some(arg_matches)) => {
|
||||||
let process_options = ProcessOptions {
|
let process_options = ProcessOptions {
|
||||||
|
|
|
@ -4,6 +4,7 @@ here=$(dirname "$0")
|
||||||
# shellcheck source=multinode-demo/common.sh
|
# shellcheck source=multinode-demo/common.sh
|
||||||
source "$here"/common.sh
|
source "$here"/common.sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
rm -rf "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
|
rm -rf "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
|
||||||
mkdir -p "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
|
mkdir -p "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
|
||||||
|
@ -47,21 +48,17 @@ fi
|
||||||
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
|
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json
|
||||||
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
|
$solana_keygen new --no-passphrase -so "$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json
|
||||||
|
|
||||||
|
|
||||||
cp "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot/genesis.tar.bz2 \
|
|
||||||
"$SOLANA_CONFIG_DIR"/bootstrap-validator
|
|
||||||
|
|
||||||
$solana_ledger_tool modify-genesis \
|
|
||||||
--ledger "$SOLANA_CONFIG_DIR"/bootstrap-validator \
|
|
||||||
--hashes-per-tick sleep \
|
|
||||||
#--operating-mode preview \
|
|
||||||
|
|
||||||
$solana_ledger_tool create-snapshot \
|
$solana_ledger_tool create-snapshot \
|
||||||
--hashes-per-tick sleep \
|
|
||||||
--ledger "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot \
|
--ledger "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot \
|
||||||
--faucet-pubkey "$SOLANA_CONFIG_DIR"/faucet.json \
|
--faucet-pubkey "$SOLANA_CONFIG_DIR"/faucet.json \
|
||||||
--faucet-lamports 500000000000000000 \
|
--faucet-lamports 500000000000000000 \
|
||||||
--bootstrap-validator "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json \
|
--bootstrap-validator "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json \
|
||||||
"$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json \
|
"$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json \
|
||||||
"$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json \
|
"$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json \
|
||||||
|
--hashes-per-tick sleep \
|
||||||
"$snapshot_slot" "$SOLANA_CONFIG_DIR"/bootstrap-validator
|
"$snapshot_slot" "$SOLANA_CONFIG_DIR"/bootstrap-validator
|
||||||
|
|
||||||
|
$solana_ledger_tool modify-genesis \
|
||||||
|
--ledger "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot \
|
||||||
|
--hashes-per-tick sleep \
|
||||||
|
"$SOLANA_CONFIG_DIR"/bootstrap-validator
|
||||||
|
|
Loading…
Reference in New Issue