2022-03-27 16:42:47 -07:00
![Zebra logotype ](https://zfnd.org/wp-content/uploads/2022/03/zebra-logotype.png )
2019-10-25 09:48:46 -07:00
2020-04-21 23:48:18 -07:00
---
2022-10-20 19:57:04 -07:00
2023-12-18 13:07:40 -08:00
[![CI Docker ](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-integration-tests-gcp.yml/badge.svg )](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-integration-tests-gcp.yml) [![CI OSes ](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-unit-tests-os.yml/badge.svg )](https://github.com/ZcashFoundation/zebra/actions/workflows/ci-unit-tests-os.yml) [![Continuous Delivery ](https://github.com/ZcashFoundation/zebra/actions/workflows/cd-deploy-nodes-gcp.yml/badge.svg )](https://github.com/ZcashFoundation/zebra/actions/workflows/cd-deploy-nodes-gcp.yml) [![codecov ](https://codecov.io/gh/ZcashFoundation/zebra/branch/main/graph/badge.svg )](https://codecov.io/gh/ZcashFoundation/zebra) [![Build docs ](https://github.com/ZcashFoundation/zebra/actions/workflows/docs-deploy-firebase.yml/badge.svg )](https://github.com/ZcashFoundation/zebra/actions/workflows/docs-deploy-firebase.yml)
2020-04-22 00:02:19 -07:00
![License ](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg )
2020-10-07 08:33:34 -07:00
2021-10-29 12:25:30 -07:00
## Contents
- [About ](#about )
- [Getting Started ](#getting-started )
2023-05-18 14:25:05 -07:00
- [Docker ](#docker )
2023-03-08 03:49:06 -08:00
- [Building Zebra ](#building-zebra )
2023-10-16 16:04:33 -07:00
- [Optional Configs & Features ](#optional-configs--features )
2021-10-29 12:25:30 -07:00
- [Known Issues ](#known-issues )
- [Future Work ](#future-work )
- [Documentation ](#documentation )
2023-06-08 16:42:32 -07:00
- [User support ](#user-support )
2021-10-29 12:25:30 -07:00
- [Security ](#security )
- [License ](#license )
2020-12-07 21:41:49 -08:00
## About
2020-10-07 08:33:34 -07:00
2020-10-06 23:53:22 -07:00
[Zebra ](https://zebra.zfnd.org/ ) is the Zcash Foundation's independent,
2023-05-26 02:59:34 -07:00
consensus-compatible implementation of a Zcash node.
2022-06-28 15:15:01 -07:00
2023-05-26 02:59:34 -07:00
Zebra's network stack is interoperable with `zcashd` , and Zebra implements all
the features required to reach Zcash network consensus, including the validation
of all the consensus rules for the NU5 network upgrade.
2023-11-01 15:09:40 -07:00
[Here ](https://docs.rs/zebrad/latest/zebrad/index.html#zebra-advantages ) are some
2023-05-26 02:59:34 -07:00
benefits of Zebra.
2021-10-29 12:25:30 -07:00
2023-05-26 02:59:34 -07:00
Zebra validates blocks and transactions, but needs extra software to generate
them:
2023-02-24 15:08:16 -08:00
2023-10-31 15:58:37 -07:00
- To generate transactions, [run Zebra with `lightwalletd` ](https://zebra.zfnd.org/user/lightwalletd.html ).
2023-10-20 10:31:04 -07:00
- To generate blocks, use a mining pool or miner with Zebra's mining JSON-RPCs.
Currently Zebra can only send mining rewards to a single fixed address.
To distribute rewards, use mining software that creates its own distribution transactions,
a light wallet or the `zcashd` wallet.
2023-05-23 06:18:57 -07:00
2023-05-26 02:59:34 -07:00
Please [join us on Discord ](https://discord.gg/na6QZNd ) if you'd like to find
out more or get involved!
2022-11-22 22:01:34 -08:00
2021-10-29 12:25:30 -07:00
## Getting Started
2020-12-07 21:41:49 -08:00
2023-05-18 14:25:05 -07:00
You can run Zebra using our Docker image or you can build it manually. Please
2023-05-23 06:18:57 -07:00
see the [System Requirements ](https://zebra.zfnd.org/user/requirements.html )
section in the Zebra book for system requirements.
2023-05-18 14:25:05 -07:00
### Docker
2022-10-05 05:46:10 -07:00
This command will run our latest release, and sync it to the tip:
2022-11-01 15:35:21 -07:00
```sh
2023-06-13 21:35:45 -07:00
docker run zfnd/zebra:latest
2022-10-05 05:46:10 -07:00
```
2023-06-13 16:16:56 -07:00
For more information, read our [Docker documentation ](https://zebra.zfnd.org/user/docker.html ).
2022-10-31 22:47:37 -07:00
2023-03-08 03:49:06 -08:00
### Building Zebra
2023-02-24 15:08:16 -08:00
2023-03-08 03:49:06 -08:00
Building Zebra requires [Rust ](https://www.rust-lang.org/tools/install ),
2024-02-23 08:49:53 -08:00
[libclang ](https://clang.llvm.org/doxygen/group__CINDEX.html ), and a C++
compiler.
2022-10-05 05:46:10 -07:00
2023-03-08 03:49:06 -08:00
Zebra is tested with the latest `stable` Rust version. Earlier versions are not
2023-06-09 03:04:21 -07:00
supported or tested. Any Zebra release can start depending on new features in the
latest stable Rust.
2020-12-08 16:22:42 -08:00
2024-05-07 07:25:50 -07:00
Around every 6 weeks, we release a [new Zebra version ](https://github.com/ZcashFoundation/zebra/releases ).
2023-05-23 06:18:57 -07:00
2023-03-08 03:49:06 -08:00
Below are quick summaries for installing the dependencies on your machine.
2021-10-29 12:25:30 -07:00
2024-01-12 14:36:04 -08:00
[//]: # "The empty line in the `summary` tag below is required for correct Markdown rendering."
< details > < summary >
2023-06-20 00:10:40 -07:00
2024-01-12 14:36:04 -08:00
#### General instructions for installing dependencies
< / summary >
2020-12-08 16:22:42 -08:00
2021-03-22 19:05:01 -07:00
1. Install [`cargo` and `rustc` ](https://www.rust-lang.org/tools/install ).
2023-03-08 03:49:06 -08:00
2020-12-08 16:22:42 -08:00
2. Install Zebra's build dependencies:
2020-12-07 21:41:49 -08:00
2023-03-08 03:49:06 -08:00
- **libclang** is a library that might have different names depending on your
package manager. Typical names are `libclang` , `libclang-dev` , `llvm` , or
`llvm-dev` .
- **clang** or another C++ compiler: `g++` (all platforms) or `Xcode` (macOS).
2024-02-23 08:49:53 -08:00
- **[`protoc`](https://grpc.io/docs/protoc-installation/)**
> [!NOTE]
> Zebra uses the `--experimental_allow_proto3_optional` flag with `protoc`
> during compilation. This flag was introduced in [Protocol Buffers
> v3.12.0](https://github.com/protocolbuffers/protobuf/releases/tag/v3.12.0)
> released in May 16, 2020, so make sure you're not using a version of `protoc`
> older than 3.12.
2023-03-08 03:49:06 -08:00
< / details >
2024-01-12 14:36:04 -08:00
[//]: # "The empty line in the `summary` tag below is required for correct Markdown rendering."
< details > < summary >
2023-06-20 00:10:40 -07:00
2024-01-12 14:36:04 -08:00
#### Dependencies on Arch
< / summary >
2023-03-08 03:49:06 -08:00
```sh
2024-02-23 08:49:53 -08:00
sudo pacman -S rust clang protobuf
2023-03-08 03:49:06 -08:00
```
Note that the package `clang` includes `libclang` as well as the C++ compiler.
< / details >
2023-06-20 00:10:40 -07:00
Once the dependencies are in place, you can build and install Zebra:
2023-03-08 03:49:06 -08:00
```sh
2023-06-20 00:10:40 -07:00
cargo install --locked zebrad
2023-03-08 03:49:06 -08:00
```
You can start Zebra by
```sh
zebrad start
```
2023-06-20 00:10:40 -07:00
See the [Installing Zebra ](https://zebra.zfnd.org/user/install.html ) and [Running Zebra ](https://zebra.zfnd.org/user/run.html )
sections in the book for more details.
2023-03-08 03:49:06 -08:00
2023-10-11 17:25:37 -07:00
#### Optional Configs & Features
2024-01-09 22:53:32 -08:00
##### Initializing Configuration File
```console
zebrad generate -o ~/.config/zebrad.toml
```
The above command places the generated `zebrad.toml` config file in the default preferences directory of Linux. For other OSes default locations [see here ](https://docs.rs/dirs/latest/dirs/fn.preference_dir.html ).
2023-10-11 17:25:37 -07:00
##### Configuring Progress Bars
Configure `tracing.progress_bar` in your `zebrad.toml` to
[show key metrics in the terminal using progress bars ](https://zfnd.org/experimental-zebra-progress-bars/ ).
When progress bars are active, Zebra automatically sends logs to a file.
2023-10-18 08:20:54 -07:00
There is a known issue where [progress bar estimates become extremely large ](https://github.com/console-rs/indicatif/issues/556 ).
2023-10-11 17:25:37 -07:00
In future releases, the `progress_bar = "summary"` config will show a few key metrics,
and the "detailed" config will show all available metrics. Please let us know which metrics are
important to you!
2023-10-17 21:15:17 -07:00
##### Configuring Mining
Zebra can be configured for mining by passing a `MINER_ADDRESS` and port mapping to Docker.
See the [mining support docs ](https://zebra.zfnd.org/user/mining-docker.html ) for more details.
2023-10-11 17:25:37 -07:00
##### Custom Build Features
2023-03-08 03:49:06 -08:00
2023-05-21 12:29:09 -07:00
You can also build Zebra with additional [Cargo features ](https://doc.rust-lang.org/cargo/reference/features.html#command-line-feature-options ):
2023-05-26 02:59:34 -07:00
2023-09-19 01:02:50 -07:00
- `prometheus` for [Prometheus metrics ](https://zebra.zfnd.org/user/metrics.html )
- `sentry` for [Sentry monitoring ](https://zebra.zfnd.org/user/tracing.html#sentry-production-monitoring )
- `elasticsearch` for [experimental Elasticsearch support ](https://zebra.zfnd.org/user/elasticsearch.html )
2023-12-21 09:05:56 -08:00
- `shielded-scan` for [experimental shielded scan support ](https://zebra.zfnd.org/user/shielded-scan.html )
2023-03-08 03:49:06 -08:00
2023-05-21 12:29:09 -07:00
You can combine multiple features by listing them as parameters of the `--features` flag:
2023-03-08 03:49:06 -08:00
```sh
cargo install --features="< feature1 > < feature2 > ..." ...
```
2023-11-01 15:09:40 -07:00
Our full list of experimental and developer features is in [the API documentation ](https://docs.rs/zebrad/latest/zebrad/index.html#zebra-feature-flags ).
2023-05-21 12:29:09 -07:00
Some debugging and monitoring features are disabled in release builds to increase
2023-03-08 03:49:06 -08:00
performance.
2020-12-08 16:22:42 -08:00
2021-10-29 12:25:30 -07:00
## Known Issues
2020-12-08 16:22:42 -08:00
2021-01-27 17:31:39 -08:00
There are a few bugs in Zebra that we're still working on fixing:
2022-08-31 15:00:46 -07:00
2023-11-06 04:51:41 -08:00
- [The `getpeerinfo` RPC shows current and recent outbound connections ](https://github.com/ZcashFoundation/zebra/issues/7893 ), rather than current inbound and outbound connections.
2023-10-18 08:20:54 -07:00
- [Progress bar estimates can become extremely large ](https://github.com/console-rs/indicatif/issues/556 ). We're waiting on a fix in the progress bar library.
2023-05-29 16:59:12 -07:00
- Zebra currently gossips and connects to [private IP addresses ](https://en.wikipedia.org/wiki/IP_address#Private_addresses ), we want to [disable private IPs but provide a config (#3117) ](https://github.com/ZcashFoundation/zebra/issues/3117 ) in an upcoming release
2023-01-09 19:48:03 -08:00
- Block download and verification sometimes times out during Zebra's initial sync [#5709 ](https://github.com/ZcashFoundation/zebra/issues/5709 ). The full sync still finishes reasonably quickly.
2022-12-06 13:35:44 -08:00
2024-04-15 16:24:40 -07:00
- Experimental Tor support is disabled until Zebra upgrades to the latest `arti-client` . This happened due to a Rust dependency conflict ([#5492](https://github.com/ZcashFoundation/zebra/issues/5492)) and is still an issue due to [another dependency conflict ](https://github.com/ZcashFoundation/zebra/issues/8328#issuecomment-1969989648 ).
2023-03-01 03:20:19 -08:00
2024-01-12 14:36:04 -08:00
## Documentation
2020-12-07 21:41:49 -08:00
2024-01-12 14:36:04 -08:00
The Zcash Foundation maintains the following resources documenting Zebra:
2021-11-02 02:59:13 -07:00
2024-01-12 14:36:04 -08:00
- The Zebra Book:
- [General Introduction ](https://zebra.zfnd.org/index.html ),
- [User Documentation ](https://zebra.zfnd.org/user.html ),
- [Developer Documentation ](https://zebra.zfnd.org/dev.html ).
2020-12-07 21:41:49 -08:00
2024-01-17 03:43:43 -08:00
- The [documentation of the public
APIs](https://docs.rs/zebrad/latest/zebrad/#zebra-crates) for the latest
releases of the individual Zebra crates.
2023-11-01 15:09:40 -07:00
2024-01-17 03:43:43 -08:00
- The [documentation of the internal APIs ](https://doc-internal.zebra.zfnd.org )
for the `main` branch of the whole Zebra monorepo.
2020-12-07 21:41:49 -08:00
2023-06-08 16:42:32 -07:00
## User support
For bug reports please [open a bug report ticket in the Zebra repository ](https://github.com/ZcashFoundation/zebra/issues/new?assignees=&labels=C-bug%2C+S-needs-triage&projects=&template=bug_report.yml&title=%5BUser+reported+bug%5D%3A+ ).
Alternatively by chat, [Join the Zcash Foundation Discord Server ](https://discord.com/invite/aRgNRVwsM8 ) and find the #zebra -support channel.
2021-01-31 16:59:30 -08:00
## Security
2021-02-15 17:34:49 -08:00
Zebra has a [responsible disclosure policy ](https://github.com/ZcashFoundation/zebra/blob/main/SECURITY.md ), which we encourage security researchers to follow.
2021-01-31 16:59:30 -08:00
2019-11-14 11:17:58 -08:00
## License
2019-11-14 11:22:23 -08:00
Zebra is distributed under the terms of both the MIT license
2019-11-14 11:17:58 -08:00
and the Apache License (Version 2.0).
See [LICENSE-APACHE ](LICENSE-APACHE ) and [LICENSE-MIT ](LICENSE-MIT ).
2023-07-02 16:08:40 -07:00
Some Zebra crates are distributed under the [MIT license only ](LICENSE-MIT ),
because some of their code was originally from MIT-licensed projects.
See each crate's directory for details.