Go to file
Henry de Valence 0dc2d92ad8 network: ensure dropping a Client closes the connection.
This fixes a bug introduced when we added heartbeat support.  Recall that we
handle the Bitcoin connection state machine on a per-peer basis.  Each
connection has a task created from the `Connection` struct, and a `Client:
tower::Service` "frontend" that passes requests to it via a channel.  In the
`Connection` event loop, the connection checks whether the request channel has
been closed, indicating no further requests from the `Client`, in which case it
shuts itself down and cleans up resources.  This occurs when all of the senders
have been dropped.

However, this behavior broke when we introduced heartbeat support, because we
spawned an additional task to send heartbeat messages along the request
channel.  This meant that instead of having a single sender, dropped by the
`Client`, we have two senders, the `Client` and the "shadow client" task that
generates heartbeat messages.  This means that when the `Client` is dropped, we
still have a live sender and the connection is not closed.  To fix this, the
`Client` now uses a `oneshot` to shut down its corresponding heartbeat task.
This closes all senders.
2020-07-21 15:43:31 -07:00
.github build(deps): bump codecov/codecov-action from v1.0.10 to v1.0.11 2020-07-21 12:19:26 -04:00
book Add skeleton of eventual zebra book (#653) 2020-07-17 20:15:50 -07:00
tower-batch Bump tracing from 0.1.15 to 0.1.16 2020-07-09 10:22:27 -07:00
tower-fallback tower-fallback: add docs 2020-07-15 10:09:37 -07:00
zebra-chain Add Hard-Coded Checkpoint Lists (#674) 2020-07-21 23:11:51 +10:00
zebra-client add favicon to generated docs (#681) 2020-07-17 16:45:29 -07:00
zebra-consensus feature: Use the Heartwood protocol version in zebra-network 2020-07-21 10:46:07 -07:00
zebra-network network: ensure dropping a Client closes the connection. 2020-07-21 15:43:31 -07:00
zebra-rpc add favicon to generated docs (#681) 2020-07-17 16:45:29 -07:00
zebra-script add favicon to generated docs (#681) 2020-07-17 16:45:29 -07:00
zebra-state add favicon to generated docs (#681) 2020-07-17 16:45:29 -07:00
zebra-test build(deps): bump tracing-subscriber from 0.2.7 to 0.2.8 2020-07-21 12:01:40 -04:00
zebra-utils Add Hard-Coded Checkpoint Lists (#674) 2020-07-21 23:11:51 +10:00
zebrad fix: Reduce sync error logs to info or warn 2020-07-21 10:13:03 -07:00
.firebaserc
.gitignore Implement sync component for start subcommand (#506) 2020-06-22 19:24:53 -07:00
.rustfmt.toml
Cargo.lock feature: Use the Heartwood protocol version in zebra-network 2020-07-21 10:46:07 -07:00
Cargo.toml tower-fallback: add implementation. 2020-07-15 10:09:37 -07:00
Dockerfile Put all ports EXPOSE'd on the same line 2020-06-19 03:46:09 -04:00
LICENSE-APACHE
LICENSE-MIT
README.md Add link to CI workflows on main 2020-04-22 03:19:33 -04:00
clippy.toml
cloudbuild.yaml Fix CD workflow using cloudbuild.yaml (#637) 2020-07-10 07:37:54 -04:00
codecov.yml Try to make CodeCov bot comment on PRs quieter (#576) 2020-07-01 20:37:51 -04:00
firebase.json
prometheus.yaml Tell Prometheus to scrape more aggressively 2020-02-14 20:14:05 -05:00

README.md

Zebra logotype


codecov License

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.

Join us on Discord.

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.