Unfortunately, since the Batch wrapper was changed to have a generic error type, when wrapping it in another Service, nothing constrains the error type, so we have to specify it explicitly to avoid an inference hole. This is pretty unergonomic -- from the compiler error message it's very unintuitive that the right fix is to change `Batch::new` to `Batch::<_, _, SomeError>::new`. The options are: 1. roll back the changes that make the error type generic, so that the error type is a concrete type; 2. keep the error type generic but hardcode the error in the default constructor and add an additional code path that allows overriding the error. However, there's a further issue with generic errors: the error type must be Clone. This problem comes from the fact that there can be multiple Batch handles that have to share access to errors generated by the inner Batch worker, so there's not a way to work around this. However, almost all error types aren't Clone, so there are fairly few error types that we would be swapping in. This suggests that in case (2) we would be maintaining extra code to allow generic errors, but with restrictive enough generic bounds to make it impractical to use generic error types. For this reason I think that (1) is a better option. |
||
|---|---|---|
| .github | ||
| book | ||
| tower-batch | ||
| tower-fallback | ||
| zebra-chain | ||
| zebra-client | ||
| zebra-consensus | ||
| zebra-network | ||
| zebra-rpc | ||
| zebra-script | ||
| zebra-state | ||
| zebra-test | ||
| zebra-utils | ||
| zebrad | ||
| .firebaserc | ||
| .gitignore | ||
| .rustfmt.toml | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Dockerfile | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
| clippy.toml | ||
| cloudbuild.yaml | ||
| codecov.yml | ||
| firebase.json | ||
| prometheus.yaml | ||
README.md
Hello! I am Zebra, an ongoing Rust implementation of a Zcash node.
Zebra is a work in progress. It is developed as a collection of zebra-*
libraries implementing the different components of a Zcash node (networking,
chain structures, consensus rules, etc), and a zebrad binary which uses them.
Most of our work so far has gone into zebra-network, building a new
networking stack for Zcash, and zebra-chain, building foundational data
structures.
Rendered docs from the main branch.
License
Zebra is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE and LICENSE-MIT.
Metrics
Notes on local metrics collection:
# create a storage volume for grafana (once)
sudo docker volume create grafana-storage
# create a storage volume for prometheus (once)
sudo docker volume create prometheus-storage
# run prometheus with the included config
sudo docker run --network host -v prometheus-storage:/prometheus -v /path/to/zebra/prometheus.yaml:/etc/prometheus/prometheus.yml prom/prometheus
# run grafana
sudo docker run -d --network host -e GF_SERVER_HTTP_PORT=3030 -v grafana-storage:/var/lib/grafana grafana/grafana
Now the grafana dashboard is available at http://localhost:3030 ; the default password is admin/admin.
