Zebra Utilities
Tools for maintaining and testing Zebra:
Binaries are easier to use if they are located in your system execution path.
zakura-checkpoints
This command generates a list of zebra checkpoints, and writes them to standard output. Each checkpoint consists of a block height and hash.
Checkpoint generation is currently a manual process: the upstream CI pipeline that generated
checkpoints automatically was removed with the GCP integration-test infrastructure. When a
checkpoint update advances the Mainnet checkpoint max height, regenerate the embedded Mainnet
frontier in the same run using --mainnet-frontier-output
(see docs/design/verified-commitment-trees.md, "Frontier regeneration tool").
Manual Checkpoint Generation
To create checkpoints, you need a synchronized instance of zakurad or zcashd.
zakurad 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 zakurad or zcashd is listening for RPC requests,
and synced to the network tip.
If you are on a Debian system, zcash-cli can be installed as a package.
zakura-checkpoints is a standalone rust binary, you can compile it using:
Checkpoint Generation Commands
You can update the checkpoints using these commands:
| &
| &
When updating the lists there is no need to start from the genesis block. The program option
--last-checkpoint will let you specify at what block height you want to start. Usually, the
maintainers will copy the last height from each list, and start from there.
Other useful options are:
--transport direct: connect directly to azakuradinstance--addr: supply a custom RPC address and port for the node-- -testnet: connect thezcash-clibinary to a testnet node instance
You can see all the zakura-checkpoints options using:
For more details about checkpoint lists, see the zakura-checkpoints README.
Checkpoint Generation for Testnet
To update the testnet checkpoints, zakura-checkpoints needs to connect to a testnet node.
To launch a testnet node, you can either:
- start
zakuradwith azakurad.tomlwithnetwork.networkset toTestnet, or - run
zcashd -testnet.
Then use the commands above to regenerate 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: https://github.com/zakura-core/zakura/pulls
zakurad-hash-lookup
Given a block hash the script will get additional information using zcash-cli.
|
This program is commonly used as part of zakurad-log-filter where hashes will be captured from zakurad output.
zakurad-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 zakurad-hash-lookup.
Assuming zakurad, zcash-cli, zakurad-hash-lookup and zakurad-log-filter are in your path the program can used as:
|
))) max_checkpoint_height=Height()
zcash-rpc-diff
This program compares zakurad and zcashd RPC responses.
Make sure you have zcashd and zakurad installed and synced.
The script:
- gets the
zakuradandzcashdtip height and network - sends the RPC request to both of them using
zcash-cli - compares the responses using
diff - leaves the full responses in files in a temporary directory, so you can check them in detail
- if possible, compares different RPC methods for consistency
Assuming zakurad's RPC port is 28232, you should be able to run:
)
{
}
Sometimes zcashd will have extra fields (+) or different data (- and +).
And sometimes it will have the same data, but in a different order.
The script will warn you if the heights or networks are different, then display the results of querying the mismatched node states.
The script accepts any RPC, with any number of arguments. If a node doesn't implement an RPC, the script will exit with an error.
Configuration
The script uses the configured zcash-cli RPC port,
and the zakurad port supplied on the command-line.
It doesn't actually check what kind of node it is talking to,
so you can compare two zcashd or zakurad nodes if you want.
(Just edit the zcash.conf file used by zcash-cli, or edit the script.)
You can override the binaries the script calls using these environmental variables:
$ZCASH_CLI$DIFF$JQ