2017-09-07 01:38:55 +03:00
|
|
|
|
# Grin - Build, Configuration, and Running
|
2017-05-03 23:56:03 +03:00
|
|
|
|
|
2017-09-07 01:38:55 +03:00
|
|
|
|
## Supported Platforms
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
Longer term, most platforms will likely be supported to some extent.
|
|
|
|
|
Grin's programming language `rust` has build targets for most platforms.
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
What's working so far?
|
|
|
|
|
* Linux x86_64 and MacOS [grin + mining + development]
|
|
|
|
|
* Not Windows 10 yet [grin kind-of builds. No mining yet. Help wanted!]
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
## Requirements
|
2017-05-03 23:56:03 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
But basically:
|
2018-03-27 21:10:37 +03:00
|
|
|
|
- rust 1.24+ (use [rustup]((https://www.rustup.rs/))- i.e. `curl https://sh.rustup.rs -sSf | sh; source $HOME/.cargo/env`)
|
2018-03-17 21:08:40 +03:00
|
|
|
|
- cmake 3.2+ (for [Cuckoo mining plugins]((https://github.com/mimblewimble/cuckoo-miner)))
|
|
|
|
|
- rocksdb + libs for compiling rocksdb:
|
|
|
|
|
- clang (clanglib or clang-devel or libclang-dev)
|
|
|
|
|
- llvm (Fedora llvm-devel, Debian llvm-dev)
|
2018-03-26 15:48:50 +03:00
|
|
|
|
- ncurses and libs (ncurses, ncursesw5)
|
|
|
|
|
- zlib libs (zlib1g-dev or zlib-devel)
|
2018-03-17 21:08:40 +03:00
|
|
|
|
- linux-headers (reported needed on Alpine linux)
|
2017-08-25 00:43:11 +03:00
|
|
|
|
|
2017-05-03 23:56:03 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
## Build steps
|
2017-05-03 23:56:03 +03:00
|
|
|
|
|
2017-11-20 17:33:35 +03:00
|
|
|
|
```sh
|
2018-03-26 12:48:46 +03:00
|
|
|
|
git clone https://github.com/mimblewimble/grin.git
|
|
|
|
|
cd grin
|
|
|
|
|
cargo build
|
2017-11-16 22:58:41 +03:00
|
|
|
|
```
|
2017-05-03 23:56:03 +03:00
|
|
|
|
|
2017-12-10 21:42:39 +03:00
|
|
|
|
|
2018-03-26 12:48:46 +03:00
|
|
|
|
### Cross-platform builds
|
2017-12-10 21:42:39 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
Rust (cargo) can build grin for many platforms, so in theory running `grin`
|
|
|
|
|
as a validating node on your low powered device might be possible.
|
|
|
|
|
To cross-compile `grin` on a x86 Linux platform and produce ARM binaries,
|
2018-03-26 12:48:46 +03:00
|
|
|
|
say, for a Raspberry Pi.
|
2017-12-10 21:42:39 +03:00
|
|
|
|
|
2017-10-06 19:46:18 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
### Building the Cuckoo-Miner plugins
|
2017-10-06 19:46:18 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
Building `grin_pow` might fail if you're not on a x86_64 system,
|
|
|
|
|
because that crate also builds external Cuckoo mining plugins.
|
2017-10-06 19:46:18 +03:00
|
|
|
|
|
2018-04-16 11:58:50 +03:00
|
|
|
|
To avoid building mining plugins, ensure your `pow/Cargo.toml` has a line in section `[dependencies.cuckoo_miner]`
|
2017-10-06 19:46:18 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
```
|
|
|
|
|
features=["no-plugin-build"]
|
2017-10-06 19:46:18 +03:00
|
|
|
|
```
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
and that it's not commented out.
|
2017-10-06 19:46:18 +03:00
|
|
|
|
|
2018-03-26 12:48:46 +03:00
|
|
|
|
### Build errors
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
See [Troubleshooting](https://github.com/mimblewimble/docs/wiki/Troubleshooting)
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
## What was built?
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
A successful build gets you:
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
- `target/debug/grin` - the main grin binary
|
|
|
|
|
- `target/debug/plugins/*` - mining plugins (optional)
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-26 12:48:46 +03:00
|
|
|
|
Grin is still sensitive to the directory from which it's run. Make sure you
|
|
|
|
|
always run it within a directory that contains a `grin.toml` configuration and
|
|
|
|
|
stay consistent as to where it's run from.
|
|
|
|
|
|
|
|
|
|
With the included `grin.toml` unchanged, if you execute `cargo run` you get a
|
|
|
|
|
`.grin` subfolder that grin starts filling up with blockchain data.
|
2018-03-17 21:08:40 +03:00
|
|
|
|
|
|
|
|
|
While testing, put the grin binary on your path like this:
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
|
|
|
|
```
|
2017-10-12 19:56:44 +03:00
|
|
|
|
export PATH=/path/to/grin/dir/target/debug:$PATH
|
2017-09-07 01:38:55 +03:00
|
|
|
|
```
|
|
|
|
|
|
2018-03-26 12:48:46 +03:00
|
|
|
|
You can then run `grin` directly (try `grin help` for more options).
|
|
|
|
|
|
|
|
|
|
*Important Note*: if you used Grin in testnet1, running the wallet listener
|
|
|
|
|
manually isn't requred anymore. Grin will create a seed file and run the
|
|
|
|
|
listener automatically on start.
|
|
|
|
|
|
2017-09-07 01:38:55 +03:00
|
|
|
|
# Configuration
|
|
|
|
|
|
2018-03-26 14:07:04 +03:00
|
|
|
|
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.
|
2018-03-17 21:08:40 +03:00
|
|
|
|
|
|
|
|
|
The `grin.toml` file can placed in one of several locations, using the first one it finds:
|
|
|
|
|
|
|
|
|
|
1. The current working directory
|
|
|
|
|
2. In the directory that holds the grin executable
|
|
|
|
|
3. {USER_HOME}/.grin
|
|
|
|
|
|
2018-03-26 14:07:04 +03:00
|
|
|
|
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.
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
For help on grin commands and their switches, try:
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
grin help
|
2018-03-17 21:08:40 +03:00
|
|
|
|
grin wallet help
|
|
|
|
|
grin client help
|
2017-09-07 01:38:55 +03:00
|
|
|
|
```
|
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
# Using grin
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|
2018-03-17 21:08:40 +03:00
|
|
|
|
The wiki page [How to use grin](https://github.com/mimblewimble/docs/wiki/How-to-use-grin)
|
|
|
|
|
and linked pages have more information on what features we have,
|
|
|
|
|
troubleshooting, etc.
|
2017-09-07 01:38:55 +03:00
|
|
|
|
|