Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
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
13 changes: 5 additions & 8 deletions genesis-programs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn get_programs(operating_mode: OperatingMode) -> Vec<(Program, Epoch)> {
// The epoch of Epoch::max_value() is a placeholder and is expected
// to be reduced in a future network update.
programs.extend(
vec![Program::Native(solana_vest_program!())]
vec![]
.into_iter()
.map(|program| (program, Epoch::MAX))
.collect::<Vec<_>>(),
Expand All @@ -117,13 +117,10 @@ fn get_programs(operating_mode: OperatingMode) -> Vec<(Program, Epoch)> {
// The epoch of std::u64::MAX is a placeholder and is expected
// to be reduced in a future network update.
programs.extend(
vec![
Program::BuiltinLoader(solana_bpf_loader_program!()),
Program::Native(solana_vest_program!()),
]
.into_iter()
.map(|program| (program, Epoch::MAX))
.collect::<Vec<_>>(),
vec![Program::BuiltinLoader(solana_bpf_loader_program!())]
.into_iter()
.map(|program| (program, Epoch::MAX))
.collect::<Vec<_>>(),
);
}
};
Expand Down
22 changes: 19 additions & 3 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use solana_ledger::entry::Entry;
use solana_ledger::{
ancestor_iterator::AncestorIterator,
bank_forks_utils,
blockstore::{Blockstore, PurgeType},
blockstore::{create_new_ledger, Blockstore, PurgeType},
blockstore_db::{self, AccessType, BlockstoreRecoveryMode, Column, Database},
blockstore_processor::ProcessOptions,
rooted_slot_iterator::RootedSlotIterator,
Expand Down Expand Up @@ -957,6 +957,13 @@ fn main() {
"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::with_name("shred-version")
Expand Down Expand Up @@ -1319,6 +1326,7 @@ fn main() {
}
("modify-genesis", Some(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") {
genesis_config.operating_mode = match operating_mode {
Expand All @@ -1336,11 +1344,19 @@ fn main() {
_ => 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);
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)) => {
let process_options = ProcessOptions {
Expand Down
17 changes: 7 additions & 10 deletions multinode-demo/setup-from-mainnet-beta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ here=$(dirname "$0")
# shellcheck source=multinode-demo/common.sh
source "$here"/common.sh

set -e

rm -rf "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
mkdir -p "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot
Expand Down Expand Up @@ -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/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 \
--hashes-per-tick sleep \
--ledger "$SOLANA_CONFIG_DIR"/latest-mainnet-beta-snapshot \
--faucet-pubkey "$SOLANA_CONFIG_DIR"/faucet.json \
--faucet-lamports 500000000000000000 \
--bootstrap-validator "$SOLANA_CONFIG_DIR"/bootstrap-validator/identity.json \
"$SOLANA_CONFIG_DIR"/bootstrap-validator/vote-account.json \
"$SOLANA_CONFIG_DIR"/bootstrap-validator/stake-account.json \
--hashes-per-tick sleep \
"$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