From da21388131a5f7fbc34c51bc04476731eb67927e Mon Sep 17 00:00:00 2001 From: Yeastplume Date: Fri, 6 Oct 2017 17:46:18 +0100 Subject: [PATCH] wee warning cleanup + build doc updates (#156) * warning cleanup * test compilation * clarification on architecture in build doc, path export statement fix --- api/src/types.rs | 2 +- doc/build.md | 21 +++++++++++++++++++-- pool/src/graph.rs | 2 +- pool/src/pool.rs | 5 ++--- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/api/src/types.rs b/api/src/types.rs index f3002e2f0..dbf2a93fb 100644 --- a/api/src/types.rs +++ b/api/src/types.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use core::{core, consensus, global}; +use core::{core, global}; use chain; use secp::pedersen; diff --git a/doc/build.md b/doc/build.md index 1fbee44d9..2d8a5f30b 100644 --- a/doc/build.md +++ b/doc/build.md @@ -6,7 +6,7 @@ Note that it's still too early in development to declare 'officially supported' plaforms, but at the moment, the situation is: -* Linux - Primary platform, as most development and testing is happening here +* Linux - Primary platform (x86 only, at present), as most development and testing is happening here * Mac OS - Known to work, but may be slight hiccups * Windows - Known to compile, but working status unknown, and not a focus for the development team at present. Note that no mining plugins will be present on a Windows system after building Grin. @@ -36,6 +36,23 @@ In order to compile and run Grin on your machine, you should have installed: cd grin cargo build +### Cuckoo-Miner considerations + +If you're having issues with building cuckoo-miner plugins (which will usually manifest as a lot of C errors when building the `grin_pow` crate, you can turn mining plugin builds off by editing the file `pow/Cargo.toml' as follows: + +``` +#uncomment this feature to turn off plugin builds +features=["no-plugin-build"] +``` + +This may help when building on 32 bit systems or non x86 architectures. You can still use the internal miner to mine by setting: + +``` +use_cuckoo_miner = true +``` + +In `grin.toml` + ## What have I just built? Provided all of the prerequisites were installed and there were no issues, there should be 3 things in your project directory that you need to pay attention to in order to configure and run grin. These are: @@ -56,7 +73,7 @@ from the build directory will run grin using the defaults in the grin.toml file, For the time being, it's recommended just to put the built version of grin on your path, e.g. via: ``` -export $PATH=/path/to/grin/dir/target/grin:$PATH +export PATH=/path/to/grin/dir/target/debug/grin:$PATH ``` # Configuration diff --git a/pool/src/graph.rs b/pool/src/graph.rs index ee0223f86..c8e5ea7fa 100644 --- a/pool/src/graph.rs +++ b/pool/src/graph.rs @@ -20,7 +20,6 @@ use std::collections::HashMap; use secp::pedersen::Commitment; use time; -use rand; use std::fmt; @@ -250,6 +249,7 @@ mod tests { use super::*; use secp; use keychain::Keychain; + use rand; #[test] fn test_add_entry() { diff --git a/pool/src/pool.rs b/pool/src/pool.rs index 41071ae85..7798e1d36 100644 --- a/pool/src/pool.rs +++ b/pool/src/pool.rs @@ -21,8 +21,6 @@ use core::core::transaction; use core::core::block; use core::core::hash; use core::global; -use core::global::{MiningParameterMode, MINING_PARAMETER_MODE}; -use core::consensus; use secp; use secp::pedersen::Commitment; @@ -131,7 +129,7 @@ where ) -> Result<(), PoolError> { // Making sure the transaction is valid before anything else. let secp = secp::Secp256k1::with_caps(secp::ContextFlag::Commit); - tx.validate(&secp).map_err(|e| PoolError::Invalid)?; + tx.validate(&secp).map_err(|_e| PoolError::Invalid)?; // The first check involves ensuring that an identical transaction is // not already in the pool's transaction set. @@ -565,6 +563,7 @@ mod tests { use keychain::Keychain; use std::sync::{Arc, RwLock}; use blake2; + use core::global::MiningParameterMode; macro_rules! expect_output_parent { ($pool:expr, $expected:pat, $( $output:expr ),+ ) => {