Zebra's GitHub workflows automatically generate checkpoints after every `main` branch update.
These checkpoints can be copied into the `main-checkpoints.txt` and `test-checkpoints.txt` files.
To find the latest checkpoints on the `main` branch:
1. Find the [latest completed `CI Docker` workflow run on `main`](https://github.com/ZcashFoundation/zebra/actions/workflows/continous-integration-docker.yml?query=branch%3Amain).
Due to GitHub UI issues, some runs will show as waiting, cancelled, or failed,
but the checkpoints have still been generated.
2. Go to the `Result of generate-checkpoints-mainnet` step in the
`Run generate-checkpoints-mainnet` job, in the `Generate checkpoints mainnet` job
3. Scroll down until you see the list of checkpoints, it should start around line 200
4. Add those checkpoints to the end of `zebra-consensus/src/checkpoint/main-checkpoints.txt`
5. Repeat steps 2 to 4 for `testnet`
6. Open a pull request at https://github.com/ZcashFoundation/zebra/pulls
#### Manual Checkpoint Generation
To create checkpoints, you need a synchronized instance of `zebrad` or `zcashd`.
`zebrad` can be queried directly or via an installed `zcash-cli` RPC client.
`zcashd` must be queried via `zcash-cli`, which performs the correct RPC authentication.
#### Checkpoint Generation Setup
Make sure your `zebrad` or `zcashd` is [listening for RPC requests](https://doc.zebra.zfnd.org/zebra_rpc/config/struct.Config.html#structfield.listen_addr),
and synced to the network tip.
If you are on a Debian system, `zcash-cli` [can be installed as a package](https://zcash.readthedocs.io/en/latest/rtd_pages/install_debian_bin_packages.html).
For more details about checkpoint lists, see the [`zebra-checkpoints` README.](https://github.com/ZcashFoundation/zebra/tree/main/zebra-consensus/src/checkpoint/README.md)
#### Checkpoint Generation for Testnet
To update the testnet checkpoints, `zebra-checkpoints` needs to connect to a testnet node.
To launch a testnet node, you can either:
- start `zebrad` [with a `zebrad.toml` with `network.network` set to `Testnet`](https://doc.zebra.zfnd.org/zebra_network/struct.Config.html#structfield.network), or
- run `zcashd -testnet`.
Then use the commands above to renegerate the checkpoints.
#### Submit new checkpoints as pull request
- If you started from the last checkpoint in the current list, add the checkpoint list to the end
of the existing checkpoint file. If you started from genesis, replace the entire file.
- Open a pull request with the updated Mainnet and Testnet lists at:
This program is commonly used as part of `zebrad-log-filter` where hashes will be captured from `zebrad` output.
### zebrad-log-filter
The program is designed to filter the output from the zebra terminal or log file. Each time a hash is seen the script will capture it and get the additional information using `zebrad-hash-lookup`.
Assuming `zebrad`, `zclash-cli`, `zebrad-hash-lookup` and `zebrad-log-filter` are in your path the program can used as: