grin/etc/gen_gen
Antioch Peverell 6faa0e8d75
thread local chain type vs global chain type (#3327)
* Introduce GLOBAL_CHAIN_TYPE and make CHAIN_TYPE thread_local.
This makes testing more explicit and significantly more robust.

* set_local_chain_type() in tests

* cleanup - weird

* get pool tests working with explicit local chain_type config

* core tests working with explicit local chain_type

* p2p tests working with explicit local chain_type

* store tests working

* cleanup, feedback
2020-05-22 12:51:58 +01:00
..
src/bin thread local chain type vs global chain type (#3327) 2020-05-22 12:51:58 +01:00
_Cargo.toml disable gen_gen crate (#2636) 2019-02-27 12:09:08 +00:00
README.md disable gen_gen crate (#2636) 2019-02-27 12:09:08 +00:00

Genesis Genesis

N.B: This crate's Cargo.toml file has been disabled by renaming it to _Cargo.toml. It no longer builds due to changes in the project structure.

This crate isn't strictly part of grin but allows the generation and release of a new Grin Genesis in an automated fashion. The process is the following:

  • Prepare a multisig output and kernel to use as coinbase. In the case of Grin mainnet, this is done and owned by the council treasurers. This can be down a few days prior.
  • Grab the latest bitcoin block hash from publicly available APIs.
  • Build a genesis block with the prepared coinbase and the bitcoin block hash as prev_root. The timestamp of the block is set to 30 min ahead to leave enough time to run a build and start a node.
  • Mine the block so we have at least a valid Cuckatoo Cycle. We don't require a given difficulty for that solution.
  • Finalize the block with the proof-of-work, setting a high-enough difficulty (to be agreed upon separately).
  • Commit the block information to github.
  • Tag version 1.0.0 (scary).

N.B. This was written while listening to Genesis. Unfortunately, I'm not rich enough to do it while driving a Genesis. And that'd be dangerous.

Usage

  1. Build this crate.
  2. From its root run ./target/release/gen-gen --coinbase <file> --difficulty <u64> --tag <version>