Add scheduler config to genesis

Anything that affects how the ledger is interpreted needs to be
in the genesis block or someplace on the ledger before later
parts of the ledger are interpreted. We currently don't have an
on-chain program for cluster parameters, so that leaves only
the genesis block option.
This commit is contained in:
Greg Fitzgerald
2019-02-21 17:01:10 -07:00
committed by Grimes
parent 3e8d96a95b
commit f0f55af35b
4 changed files with 30 additions and 39 deletions

View File

@ -67,18 +67,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
let mint_keypair = read_keypair(mint_keypair_file)?;
let bootstrap_leader_vote_account_keypair = Keypair::new();
let genesis_block = GenesisBlock {
mint_id: mint_keypair.pubkey(),
tokens: num_tokens,
bootstrap_leader_id: bootstrap_leader_keypair.pubkey(),
bootstrap_leader_tokens: BOOTSTRAP_LEADER_TOKENS,
bootstrap_leader_vote_account_id: bootstrap_leader_vote_account_keypair.pubkey(),
};
let (mut genesis_block, _mint_keypair) = GenesisBlock::new_with_leader(
num_tokens,
bootstrap_leader_keypair.pubkey(),
BOOTSTRAP_LEADER_TOKENS,
);
genesis_block.mint_id = mint_keypair.pubkey();
genesis_block.bootstrap_leader_vote_account_id = bootstrap_leader_vote_account_keypair.pubkey();
create_new_ledger(
ledger_path,
&genesis_block,
&solana::blocktree::BlocktreeConfig::default(),
)?;
create_new_ledger(ledger_path, &genesis_block)?;
Ok(())
}