From 58aa566e82d62dada87f506f6d6c56ebd17a861c Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Sat, 22 Dec 2018 18:16:41 +0000 Subject: [PATCH] Move prev_root setting to after set_txhashset_roots so it doesn't get overwritten. Remove git interactions, easier done manually. --- etc/gen_gen/src/bin/gen_gen.rs | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/etc/gen_gen/src/bin/gen_gen.rs b/etc/gen_gen/src/bin/gen_gen.rs index 874480b5f..811a77ace 100644 --- a/etc/gen_gen/src/bin/gen_gen.rs +++ b/etc/gen_gen/src/bin/gen_gen.rs @@ -16,7 +16,7 @@ use std::io::{BufRead, Write}; use std::sync::Arc; -use std::{fs, io, path, process}; +use std::{fs, io, path}; use chrono::prelude::Utc; use chrono::{Datelike, Duration, Timelike}; @@ -78,8 +78,6 @@ fn main() { // build the basic parts of the genesis block header let mut gen = core::genesis::genesis_main(); - gen.header.timestamp = Utc::now() + Duration::minutes(30); - gen.header.prev_root = core::core::hash::Hash::from_hex(&h1).unwrap(); // build the wallet seed and derive a coinbase from local wallet.seed let seed = wallet::WalletSeed::from_file( @@ -98,6 +96,11 @@ fn main() { tmp_chain.set_txhashset_roots(&mut gen).unwrap(); } + // sets the timestamp and prev_root from the bitcoin block (needs to be + // after set_txhashset roots to not get overwritten) + gen.header.timestamp = Utc::now() + Duration::minutes(30); + gen.header.prev_root = core::core::hash::Hash::from_hex(&h1).unwrap(); + // mine a Cuckaroo29 block core::global::set_mining_mode(core::global::ChainTypes::Mainnet); let plugin_lib = cuckoo::PluginLibrary::new(PLUGIN_PATH).unwrap(); @@ -150,26 +153,6 @@ fn main() { update_genesis_rs(&gen); println!("genesis.rs has been updated, check it and run mainnet_genesis_hash test"); println!("also check bitcoin block {} hasn't been orphaned.", h1); - println!("press c+enter to proceed."); - let mut input = String::new(); - io::stdin().read_line(&mut input).unwrap(); - if input != "c\n" { - return; - } - - // Commit genesis block info in git and tag - process::Command::new("git") - .args(&["commit", "-am", "Minor: finalized genesis block"]) - .status() - .expect("git commit failed"); - process::Command::new("git") - .args(&["tag", "-a", "v1.0", "-m", "Mainnet release"]) - .status() - .expect("git tag failed"); - process::Command::new("git") - .args(&["push", "origin", "v1.0"]) - .status() - .expect("git tag push failed"); println!("All done!"); }