Building using Docker
Docker is great for making sure differences between operating systems, distributions, installations and build environments don’t get in the way of coding fun. For this quick start, we’ll use docker to set up a minimal Ubuntu installation and take it from there. However, you don’t need Docker – similar instructions can be used to get things working on pretty much any Linux installation or a Mac Homebrew system, just don’t come complaining if it doesn’t work for you on some niche distribution (Arch, I’m looking at you!) or *nix with 6 months of cruft caking it up. Instead, get the docker image working and then figure out what the differences are.
NOTE: Ensure you have docker to begin with.
$ docker run -it ubuntu bash
This will give you a temporary docker environment.
NOTE: If you already have Rust in your environment, you don’t need to bother with this.
This will download and install Rust on Linux and OS X:
$ curl https://sh.rustup.rs -sSf | sh
If you are using Windows make sure Visual Studio 2015 with C++ support is installed. Ensure you run all of the next stuff in the
VS2015 x64 Native Tools Command Prompt.
NOTE: We do not support the GNU toolset on Windows. Do not install it, and do not install any Rust version that uses it. If you see
x86_64-pc-windows-gnu anywhere, you’ve done it wrong!
Download and run rustup and use the following command to setup the MSVC toolchain:
$ rustup default stable-x86_64-pc-windows-msvc
Install and Build Parity
Next, grab the Parity Ethereum repository:
$ git clone https://github.com/paritytech/parity $ cd parity
For tests, also update submodules:
$ git submodule init $ git submodule update
You can build with:
$ cargo build
You can run the unit tests with:
You can run just the consensus tests with:
$ cargo test --release --features ethcore/json-tests -p ethcore
To install Parity Ethereum on Linux and Mac OS, just build it and copy it to
$ cargo build --release && cp target/release/parity /usr/local/bin
For Windows, use
copy it into
$ cargo build --release $ copy target/release/parity C:/Windows
You can start a client and sync with the network with:
$ cargo run --release
To get help on the command line options for the
parity client, use
$ cargo run --release --help
A note on backing up your datadir with Docker
In case you need to persist the blockchain files, keys etc., you should run the image with the
--base-path option and then mount it, e.g.:
$ docker run --name parity -v /srv/parity:/mnt ethcore/parity:beta --base-path /mnt