parity-zcash/README.md

174 lines
4.3 KiB
Markdown
Raw Normal View History

# Zebra: the Zcash Foundation client.
2016-09-19 07:36:53 -07:00
[![Build Status][travis-image]][travis-url]
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)
- [Importing zcashd 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
[travis-image]: https://api.travis-ci.org/ZcashFoundation/zebra.svg?branch=master
[travis-url]: https://travis-ci.org/ZcashFoundation/zebra
[doc-url]: https://zcashfoundation.github.io/zcashfoundation/zebra/index.html
2016-12-14 05:36:31 -08:00
## Installing from source
2016-12-14 05:36:31 -08:00
Installing `zebra` from source requires `rustc` and `cargo`.
2016-12-14 05:36:31 -08:00
Minimal supported version is `rustc 1.35.0 (fd19989 2019-05-23)`, and we generally target the stable channel.
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 clang and gcc compilers plus cmake 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 cmake clang
```
#### Clone and build zebra
2016-12-14 05:36:31 -08:00
Now let's clone `zebra` and enter it's directory:
2016-12-14 05:36:31 -08:00
```
git clone https://github.com/ZcashFoundation/zebra
cd zebra
2016-12-14 05:36:31 -08:00
# builds zebra in release mode
cargo build -p zebra --release
2016-12-14 05:36:31 -08:00
```
`zebra` is now available at `./target/release/zebra`.
2016-12-14 05:36:31 -08:00
## Installing the snap
In any of the [supported Linux distros](https://snapcraft.io/docs/core/install):
```
sudo snap install zebra --edge
```
2016-12-14 05:36:31 -08:00
## Running tests
`zebra` 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
By default parity connects to Zcash seednodes. Full list is [here](./zebra/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
```
./target/release/zebra
2016-12-14 05:36:31 -08:00
```
To start syncing the testnet:
2016-12-14 05:36:31 -08:00
```
./target/release/zebra --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
```
./target/release/zebra --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/zebra 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
```
./target/release/zebra --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 `zebra --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
```
RUST_LOG=verification=info ./target/release/zebra
2016-12-14 05:36:31 -08:00
```
`zebra` 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
```
RUST_LOG=sync=trace,p2p=trace,verification=trace,db=trace ./target/release/zebra
2016-12-14 05:36:31 -08:00
```
2016-12-14 05:43:55 -08:00
## Internal documentation
Once released, `zebra` documentation will be available [here][doc-url]. Meanwhile it's only possible to build it locally:
2016-12-14 05:43:55 -08:00
```
cd zebra
2016-12-15 07:04:54 -08:00
./tools/doc.sh
open target/doc/zebra/index.html
2018-12-24 03:01:15 -08:00
```