diff --git a/chain/src/pipe.rs b/chain/src/pipe.rs index fa8e73cb0..4a08986d6 100644 --- a/chain/src/pipe.rs +++ b/chain/src/pipe.rs @@ -237,8 +237,10 @@ fn validate_header(header: &BlockHeader, ctx: &mut BlockContext) -> Result<(), E return Err(Error::InvalidBlockVersion(header.version)); } + // TODO: remove CI check from here somehow if header.timestamp > time::now_utc() + time::Duration::seconds(12 * (consensus::BLOCK_TIME_SEC as i64)) + && !global::is_automated_testing_mode() { // refuse blocks more than 12 blocks intervals in future (as in bitcoin) // TODO add warning in p2p code if local time is too different from peers diff --git a/doc/build.md b/doc/build.md index a31fa16d1..be5edf6df 100644 --- a/doc/build.md +++ b/doc/build.md @@ -84,9 +84,10 @@ listener automatically on start. # Configuration -Grin has a good defaults, a configuration file `grin.toml` that's documented -inline that can override the defaults, and command line switches that has top -priority and overrides all others. +Grin attempts to run with sensible defaults, and can be further configured via +the `grin.toml` file. You should always ensure that this file is available to grin. +The supplied `grin.toml` contains inline documentation on all configuration +options, and should be the first point of reference for all options. The `grin.toml` file can placed in one of several locations, using the first one it finds: @@ -94,6 +95,10 @@ The `grin.toml` file can placed in one of several locations, using the first one 2. In the directory that holds the grin executable 3. {USER_HOME}/.grin +While it's recommended that you perform all grin server configuration via +`grin.toml`, it's also possible to supply command line switches to grin that +override any settings in the `grin.toml` file. + For help on grin commands and their switches, try: ``` diff --git a/grin/src/server.rs b/grin/src/server.rs index ce743e877..1fd819611 100644 --- a/grin/src/server.rs +++ b/grin/src/server.rs @@ -100,6 +100,7 @@ impl Server { let genesis = match config.chain_type { global::ChainTypes::Testnet1 => genesis::genesis_testnet1(), global::ChainTypes::Testnet2 => genesis::genesis_testnet2(), + global::ChainTypes::AutomatedTesting => genesis::genesis_dev(), _ => pow::mine_genesis_block(config.mining_config.clone())?, }; info!(LOGGER, "Starting server, genesis block: {}", genesis.hash(),); diff --git a/pow/src/lib.rs b/pow/src/lib.rs index 4cfae3ab5..d430d8109 100644 --- a/pow/src/lib.rs +++ b/pow/src/lib.rs @@ -86,7 +86,7 @@ pub fn mine_genesis_block( miner_config: Option, ) -> Result { let mut gen = genesis::genesis_testnet2(); - if global::is_user_testing_mode() { + if global::is_user_testing_mode() || global::is_automated_testing_mode() { gen = genesis::genesis_dev(); gen.header.timestamp = time::now(); }