### Install RocksDB on Ubuntu Source: https://zebra.zfnd.org/user/install Installs the RocksDB development library on Ubuntu version 24.04 or later using apt. This enables dynamic linking for faster builds. ```bash apt install -y librocksdb-dev ``` -------------------------------- ### Install RocksDB on Arch Linux Source: https://zebra.zfnd.org/user/install Installs the RocksDB system library on Arch Linux using pacman. This is a prerequisite for enabling dynamic linking of RocksDB to potentially speed up Zebra builds. ```bash pacman -S rocksdb ``` -------------------------------- ### Download and Build lightwalletd Source: https://zebra.zfnd.org/user/lightwalletd Installs the lightwalletd service. This process requires Go to be installed and in the system's PATH. It clones the repository, builds the binary, and installs it. ```bash git clone https://github.com/zcash/lightwalletd cd lightwalletd make make install ``` -------------------------------- ### Install Redis on Debian/Ubuntu Source: https://zebra.zfnd.org/user/mining-testnet-s-nomp Installs Redis server and starts the Redis service on Debian-based systems. This is a prerequisite for running s-nomp. ```shell sudo apt-get install lsb-release curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list sudo apt-get update sudo apt-get install redis redis-server ``` -------------------------------- ### Install Lightwalletd (Shell) Source: https://zebra.zfnd.org/print These shell commands clone the lightwalletd repository, navigate into the directory, and then build and install the lightwalletd binary. This process requires Go to be installed and available in the system's PATH. The binary is typically installed in `~/go/bin/`. ```shell git clone https://github.com/zcash/lightwalletd cd lightwalletd make make install ``` -------------------------------- ### Build and Run Zebrad Binary Source: https://zebra.zfnd.org/user/install Builds the `zebrad` binary in release mode and then starts it. This command compiles the core daemon for the Zebra network. ```bash cargo build --release --bin zebrad target/release/zebrad start ``` -------------------------------- ### Start Zebra Node Source: https://zebra.zfnd.org/index Command to start the Zebra Zcash full node after installation. Refer to the documentation for advanced configuration and optional features. ```bash zebrad start ``` -------------------------------- ### Install Zecwallet-CLI (Shell) Source: https://zebra.zfnd.org/print This command installs the zecwallet-cli using Cargo, the Rust package manager. It clones the repository from the specified Git URL and builds the binary. The zecwallet-cli binary will be located in `~/.cargo/bin/` after successful installation. ```shell cargo install --locked --git https://github.com/adityapk00/zecwallet-light-cli ``` -------------------------------- ### Install zecwallet-cli Source: https://zebra.zfnd.org/user/lightwalletd Installs the zecwallet-cli tool from a Git repository. This command requires Cargo, the Rust package manager, to be installed. The binary will be available in the Cargo bin directory. ```bash cargo install --locked --git https://github.com/adityapk00/zecwallet-light-cli ``` -------------------------------- ### Zebra Private Testnet Configuration Example Source: https://zebra.zfnd.org/dev/private-testnet This is a sample configuration file for setting up a private Testnet in Zebra. Key parameters include enabling checkpoint sync, setting mempool limits, enabling mining, and configuring network settings for isolation. ```toml [consensus] checkpoint_sync = true [mempool] eviction_memory_time = "1h" tx_cost_limit = 80000000 max_datacarrier_bytes = 83 [metrics] [mining] miner_address = "t27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v" # if you want to enable mining, which also requires selecting the `internal-miner` compilation feature internal_miner = true [network] # This will save peers to a file. Take care that it also reads peers from it; # if you want to be truly isolated and only connect to the other participants, ``` -------------------------------- ### Start Zebra with Configuration Source: https://zebra.zfnd.org/user/metrics Starts the Zebra daemon, specifying the path to the custom configuration file 'zebrad.toml'. ```bash zebrad -c zebrad.toml start ``` -------------------------------- ### Start Redis on Arch Linux Source: https://zebra.zfnd.org/print Starts the Redis service on Arch Linux using systemctl. This is a prerequisite for running s-nomp. ```bash sudo systemctl start redis ``` -------------------------------- ### Initialize Networking Service and Address Book Source: https://zebra.zfnd.org/dev/overview The `init` function serves as the main entry point for setting up the networking layer. It constructs a peer pool, returns a service for network requests, and provides an address book for peer liveness information. Dependencies include `Config`, a generic `Service` `S`, and `AddressBook`. ```rust fn init(Config, S) -> (impl Service, Arc>) ``` -------------------------------- ### Build Zebra with Optional Features Source: https://zebra.zfnd.org/user/install Builds the Zebra project, potentially enabling all features or specifically the `zebrad` binary with all features. This is useful when encountering dependency issues, such as with `libsqlite3`. ```bash cargo build cargo build -p zebrad --all-features ``` -------------------------------- ### Initialize Networking Service and Address Book Source: https://zebra.zfnd.org/print The `init` function serves as the main entry point for setting up the networking service. It constructs a peer pool, returns a service for network requests, and manages an AddressBook for peer liveness information. Dependencies include `Config` for parameters and a generic `Service` `S`. ```rust init(Config, S) -> (impl Service, Arc>) ``` -------------------------------- ### Run Zebra Docker Container on Mainnet Source: https://zebra.zfnd.org/user/mining-docker Starts a Zebra Docker container on Mainnet. Requires a miner address for rewards and binds the RPC port. Ensure Docker is installed. ```docker docker run --name -zebra_local -e MINER_ADDRESS="t3dvVE3SQEi7kqNzwrfNePxZ1d4hUyztBA1" -e ZEBRA_RPC_PORT=8232 -p 8232:8232 zfnd/zebra:latest ``` -------------------------------- ### Run Zebra Docker Container on Testnet Source: https://zebra.zfnd.org/user/mining-docker Starts a Zebra Docker container on Testnet. Requires a Testnet miner address and binds the Testnet RPC port. Ensure Docker is installed. ```docker docker run --name zebra_local -e ZEBRA_NETWORK__NETWORK="Testnet" -e MINER_ADDRESS="t27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v" -e ZEBRA_RPC_PORT=18232 -p 18232:18232 zfnd/zebra:latest ``` -------------------------------- ### Run Kibana Frontend Source: https://zebra.zfnd.org/user/elasticsearch Starts the Kibana frontend application, which is used to visualize data stored in Elasticsearch. The first run provides a configuration URL that requires credentials from the Elasticsearch setup. Kibana listens on https://localhost:5601 by default. ```bash ./bin/kibana ``` -------------------------------- ### Zebra Configuration File Example Source: https://zebra.zfnd.org/user/fork-zebra-testnet This is an example configuration file for running an isolated Zebra network. It includes settings for the mempool, mining, network peers, and RPC listen address. Adjust these parameters based on your specific testing requirements. ```toml [mempool] debug_enable_at_height = 0 max_datacarrier_bytes = 83 [mining] miner_address = 't27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v' [network] cache_dir = false initial_testnet_peers = [ "dnsseed.testnet.z.cash:18233", "testnet.seeder.zfnd.org:18233", "testnet.is.yolo.money:18233", ] listen_addr = "0.0.0.0:18233" network = "Testnet" [rpc] listen_addr = "0.0.0.0:18232" [state] cache_dir = "/home/oxarbitrage/.cache/zebra" ``` -------------------------------- ### Check Zebra Node Peer Information (RPC) Source: https://zebra.zfnd.org/dev/private-testnet This snippet demonstrates how to use the `curl` command to query a Zebra node's connected peers via its RPC interface. It's useful for verifying network connectivity during private Testnet setups. ```bash curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'Content-Type: application/json' http://127.0.0.1:8232 ``` -------------------------------- ### Configure Zebra Custom Testnet with Specific Parameters Source: https://zebra.zfnd.org/user/custom-testnets This configuration sets up a custom Testnet for Zebra with specific network parameters. It includes custom network name, magic, slow start interval, target difficulty, and disables Proof-of-Work. It also defines activation heights for network upgrades. This setup is useful for testing consensus rule changes independently. ```toml [mining] miner_address = 't27eWDgjFYJGVXmzrXeVjnb5J3uXDM9xH9v' [network] network = "Testnet" # No peers initial_testnet_peers = [] [network.testnet_parameters] network_name = "ConfiguredTestnet_1" # The Testnet network magic is not reserved, but it's not recommended # for use with incompatible Testnet parameters like those in this config. network_magic = [0, 1, 0, 255] slow_start_interval = 0 target_difficulty_limit = "0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f" disable_pow = true # Configured activation heights must be greater than 0, and less than # 2^31. Block height 0 is reserved for the Genesis network upgrade in Zebra. # # Network upgrades must be activated in the order that they were added to Zcash, # configuring the activation heights of recent network upgrades will activate # any omitted prior network upgrades at the same height. # # For example, configuring the activation height of NU5 to block height 1 without # configuring any other network upgrade activation heights will set the # activation heights of BeforeOverwinter, Overwinter, Sapling, Blossom, # Heartwood, and Canopy at block height 1 as well. [network.testnet_parameters.activation_heights] NU5 = 1 # This section may be omitted if it's not necessary to # add transactions to Zebra's mempool [rpc] listen_addr = "0.0.0.0:18232" ``` -------------------------------- ### Install s-nomp on Debian/Ubuntu Source: https://zebra.zfnd.org/print Clones the s-nomp repository, checks out the Zebra mining branch, and installs Node.js version 10. It then updates npm dependencies and installs s-nomp. ```bash git clone https://github.com/ZcashFoundation/s-nomp cd s-nomp git checkout zebra-mining nodenv install 10 nodenv local 10 # or # nvm install 10 # nvm use 10 export CXXFLAGS="-std=gnu++17" npm update npm install ``` -------------------------------- ### Run Zebra Node from Configuration File Source: https://zebra.zfnd.org/user/mining-testnet-s-nomp This command demonstrates how to launch the Zebra node daemon (`zebrad`) using a specified configuration file. Ensure the `zebrad.toml` file is correctly configured before running this command. The node will then start with the settings defined in the configuration. ```bash zebrad -c zebrad.toml ``` -------------------------------- ### Install Zebra with Cargo Source: https://zebra.zfnd.org/index Installs the Zebra node using Cargo, the Rust package manager. It can be installed from crates.io with the --locked flag for reproducible builds or directly from GitHub. ```rust cargo install --locked zebrad ``` ```rust cargo install --git https://github.com/ZcashFoundation/zebra --tag v2.5.0 zebrad ``` -------------------------------- ### Clone Zebra Repository Source: https://zebra.zfnd.org/user/install Clones the official Zebra repository from GitHub. This is the first step to obtaining the source code for building the project. ```bash git clone https://github.com/ZcashFoundation/zebra.git cd zebra ``` -------------------------------- ### Install s-nomp on Arch Linux Source: https://zebra.zfnd.org/print Clones the s-nomp repository, sets up Node.js version 10 using nvm, and installs Python 3.10 virtual environment. It then updates npm dependencies and installs s-nomp. ```bash git clone https://github.com/ZcashFoundation/s-nomp && cd s-nomp unset npm_config_prefix source /usr/share/nvm/init-nvm.sh nvm install 10 nvm use 10 virtualenv -p 3.10 s-nomp source s-nomp/bin/activate npm update npm install ``` -------------------------------- ### Start Zebra with Custom Configuration Source: https://zebra.zfnd.org/user/fork-zebra-testnet This command starts the Zebra daemon using a specified configuration file ('myconf.toml'). This allows users to run Zebra with custom settings, such as a specific network or debug parameters. ```bash zebrad -c myconf.toml start ``` -------------------------------- ### Install Redis, Boost, and Libsodium on Arch Linux Source: https://zebra.zfnd.org/print Installs Redis, Boost, and libsodium packages on Arch Linux using pacman. These are necessary dependencies for s-nomp. ```bash sudo pacman -S redis boost libsodium ```