The reason the test failed is that the future returned by `call` on the state service was immediately dropped, rather than being driven to completion. Instead, we link the state update future with the verification future by .awaiting it in an async block. Note that the state update future is constructed outside of the async block returned by the verification service. Why? Because calling `self.state_service.call` requires mutable access to `state_service`, which we only have in the body of the verification service's `call` method, and not during execution of the async block it returns (which could happen at some later point, or never). In Tower's model, the `call` method itself only does the work necessary to construct a future that represents completion of the service call, and the rest of the work is done in the future itself. In particular, the fact that `Service::call` takes `&mut self` means two things: 1. the service's state can be mutated while setting up the future, but not during the future's subsequent execution, 2. any nested service calls made *by* the service *to* sub-services (e.g., the verification service calling the state service) must either be made upfront, while constructing the response future, or must be made to a clone of the sub-service owned by the the response future. |
||
|---|---|---|
| .github | ||
| design | ||
| zebra-chain | ||
| zebra-client | ||
| zebra-consensus | ||
| zebra-network | ||
| zebra-rpc | ||
| zebra-script | ||
| zebra-state | ||
| zebra-test-vectors | ||
| 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.
