parity-zcash/README.md

176 lines
4.5 KiB
Markdown
Raw Normal View History

2018-12-17 06:34:07 -08:00
# The Parity Zcash client.
2016-09-19 07:36:53 -07:00
2017-07-15 21:58:55 -07:00
[![Build Status][travis-image]][travis-url] [![Snap Status](https://build.snapcraft.io/badge/paritytech/parity-bitcoin.svg)](https://build.snapcraft.io/user/paritytech/parity-bitcoin)
2017-04-28 05:14:32 -07:00
2018-12-17 06:34:07 -08:00
Gitter [![Gitter https://gitter.im/paritytech/parity-zcash](https://badges.gitter.im/paritytech/parity-zcash.svg)](https://gitter.im/paritytech/parity-zcash)
2016-10-17 04:52:06 -07:00
## Blog: [Parity teams up with Zcash Foundation for Parity Zcash client](https://www.parity.io/parity-teams-up-with-zcash-foundation-for-parity-zcash-client/)
- [Installing from source](#installing-from-source)
- [Installing the snap](#installing-the-snap)
2016-10-17 04:48:22 -07:00
2016-12-14 05:36:31 -08:00
- [Running tests](#running-tests)
2016-09-19 07:36:53 -07:00
2016-12-14 05:36:31 -08:00
- [Going online](#going-online)
2018-12-17 06:34:07 -08:00
- [Importing bitcoind database](#importing-zcashd-database)
2016-12-14 05:36:31 -08:00
- [Command line interface](#command-line-interface)
- [JSON-RPC](JSON-RPC.md)
2016-12-14 05:36:31 -08:00
- [Logging](#logging)
2016-12-14 05:43:55 -08:00
- [Internal Documentation](#internal-documentation)
2016-12-14 05:36:31 -08:00
2018-12-17 06:34:07 -08:00
[travis-image]: https://api.travis-ci.org/paritytech/parity-zcash.svg?branch=master
2018-12-24 03:01:15 -08:00
[travis-url]: https://travis-ci.org/paritytech/parity-zcash
2018-12-17 06:34:07 -08:00
[doc-url]: https://paritytech.github.io/parity-zcash/pzec/index.html
2016-12-14 05:36:31 -08:00
## Installing from source
2016-12-14 05:36:31 -08:00
2018-12-17 06:34:07 -08:00
Installing `pzec` from source requires `rustc` and `cargo`.
2016-12-14 05:36:31 -08:00
Minimal supported version is `rustc 1.23.0 (766bd11c8 2018-01-01)`
2016-12-14 05:36:31 -08:00
#### Install rustc and cargo
2017-08-29 06:52:21 -07:00
Both `rustc` and `cargo` are a part of rust tool-chain.
2016-12-14 05:36:31 -08:00
An easy way to install the stable binaries for Linux and Mac is to run this in your shell:
```
curl https://sh.rustup.rs -sSf | sh
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
Windows binaries can be downloaded from [rust-lang website](https://forge.rust-lang.org/other-installation-methods.html#standalone).
2016-12-14 05:36:31 -08:00
#### Install C and C++ compilers
You will need the cc and gcc compilers to build some of the dependencies.
2019-02-02 14:35:00 -08:00
On macOS <br />
2019-02-02 14:35:00 -08:00
`build-essential` is a Debian package. On macOS you will need to make sure you have Xcode installed. If you already have Homebrew installed, you probably also already have the Xcode tools installed as well. If not, you can run the command below:
```
xcode-select --install
```
On Linux
```
sudo apt-get update
sudo apt-get install build-essential
```
2018-12-20 03:25:55 -08:00
#### Clone and build pzec
2016-12-14 05:36:31 -08:00
2018-12-17 06:34:07 -08:00
Now let's clone `pzec` and enter it's directory:
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
git clone https://github.com/paritytech/parity-zcash
cd parity-zcash
2016-12-14 05:36:31 -08:00
2018-12-20 03:25:55 -08:00
# builds pzec in release mode
2018-12-17 06:34:07 -08:00
cargo build -p pzec --release
2016-12-14 05:36:31 -08:00
```
2018-12-20 03:25:55 -08:00
`pzec` is now available at `./target/release/pzec`.
2016-12-14 05:36:31 -08:00
## Installing the snap
In any of the [supported Linux distros](https://snapcraft.io/docs/core/install):
```
2018-12-17 06:34:07 -08:00
sudo snap install parity-zcash --edge
```
2016-12-14 05:36:31 -08:00
## Running tests
2018-12-17 06:34:07 -08:00
`pzec` has internal unit tests and it conforms to external integration tests.
2016-12-14 05:36:31 -08:00
#### Running unit tests
2017-08-29 06:52:21 -07:00
Assuming that repository is already cloned, we can run unit tests with this command:
2016-12-14 05:36:31 -08:00
```
cargo test --all
2016-12-14 05:36:31 -08:00
```
## Going online
2018-12-17 06:34:07 -08:00
By default parity connects to Zcash seednodes. Full list is [here](./pzec/seednodes.rs).
2017-09-03 22:36:31 -07:00
2019-03-12 03:37:30 -07:00
To start syncing the main network, just start the client without any arguments:
2016-12-14 05:36:31 -08:00
```
2018-12-20 03:25:55 -08:00
./target/release/pzec
2016-12-14 05:36:31 -08:00
```
To start syncing the testnet:
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
./target/release/pzec --testnet
2016-12-14 05:36:31 -08:00
```
To not print any syncing progress add `--quiet` flag:
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
./target/release/pzec --quiet
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
## Importing zcashd database
2016-12-14 05:36:31 -08:00
2019-03-12 03:37:30 -07:00
It it is possible to import existing `zcashd` database:
2016-12-14 05:36:31 -08:00
2019-03-12 03:37:30 -07:00
```
2019-03-12 03:10:06 -07:00
# where $ZCASH_DB is path to your zcashd database. By default:
# on macOS: "/Users/user/Library/Application Support/Zcash"
# on Linux: "~/.zcash"
./target/release/pzec import "$ZCASH_DB/blocks"
2016-12-14 05:36:31 -08:00
```
2019-04-06 02:28:46 -07:00
By default, import verifies the imported blocks. You can disable this, by adding the `--verification-level=none` option.
2016-12-14 05:36:31 -08:00
```
2019-04-06 02:28:46 -07:00
./target/release/pzec --verification-level=none import "$ZCASH_DB/blocks"
2016-12-14 05:36:31 -08:00
```
## Command line interface
Full list of CLI options, which is available under `pzec --help`: see [here](CLI.md)
2016-12-14 05:36:31 -08:00
## Logging
2017-08-29 06:52:21 -07:00
This is a section only for developers and power users.
2016-12-14 05:36:31 -08:00
2017-08-29 06:52:21 -07:00
You can enable detailed client logging by setting the environment variable `RUST_LOG`, e.g.,
2016-12-14 05:36:31 -08:00
```
2018-12-20 03:25:55 -08:00
RUST_LOG=verification=info ./target/release/pzec
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
`pzec` started with this environment variable will print all logs coming from `verification` module with verbosity `info` or higher. Available log levels are:
2016-12-14 05:36:31 -08:00
- `error`
- `warn`
- `info`
- `debug`
- `trace`
It's also possible to start logging from multiple modules in the same time:
2016-12-14 05:36:31 -08:00
```
2018-12-17 06:34:07 -08:00
RUST_LOG=sync=trace,p2p=trace,verification=trace,db=trace ./target/release/pzec
2016-12-14 05:36:31 -08:00
```
2016-12-14 05:43:55 -08:00
## Internal documentation
2018-12-17 06:34:07 -08:00
Once released, `pzec` documentation will be available [here][doc-url]. Meanwhile it's only possible to build it locally:
2016-12-14 05:43:55 -08:00
```
2018-12-17 06:34:07 -08:00
cd parity-zcash
2016-12-15 07:04:54 -08:00
./tools/doc.sh
2018-12-17 06:34:07 -08:00
open target/doc/pzec/index.html
2018-12-24 03:01:15 -08:00
```