We need a zebra configuration file. First, we create a file with the default settings:
```console
zebrad generate -o ~/.config/zebrad.toml
```
The above command places the generated `zebrad.toml` config file in the default preferences directory of Linux. For other OSes default locations [see here](https://docs.rs/dirs/latest/dirs/fn.preference_dir.html).
Tweak the following option in order to prepare for lightwalletd setup.
### RPC section
[#rpc-section]: #rpc-section
This change is required for zebra to behave as an RPC endpoint. The standard port for RPC endpoint is `8232`.
```
[rpc]
listen_addr = "127.0.0.1:8232"
```
## Sync Zebra
[#sync-zebra]: #sync-zebra
With the configuration in place you can start synchronizing Zebra with the Zcash blockchain. This may take a while depending on your hardware.
```console
zebrad start
```
Zebra will display information about sync process:
```console
...
zebrad::commands::start: estimated progress to chain tip sync_percent=10.783 %
...
```
Until eventually it will get there:
```console
...
zebrad::commands::start: finished initial sync to chain tip, using gossiped blocks sync_percent=100.000 %
...
```
You can interrupt the process at any time with `ctrl-c` and Zebra will resume the next time at around the block you were downloading when stopping the process.
When deploying for production infrastructure, the above command can/should be implemented as a server service or similar configuration.
For implementing zebra as a service please see [here](https://github.com/ZcashFoundation/zebra/blob/main/zebrad/systemd/zebrad.service).
Before installing, you need to have `go` in place. Please visit the [go install page](https://go.dev/doc/install) with download and installation instructions.
-`lightwalletd` requires a `zcash.conf` file, however this file can be empty if you are using the default Zebra rpc endpoint (`127.0.0.1:8232`) and the `adityapk00/lightwalletd` fork
- Some `lightwalletd` forks also require a `rpcuser` and `rpcpassword`, but Zebra ignores them if it receives them from `lightwalletd`
- When using a non-default port, use `rpcport=28232` and `rpcbind=127.0.0.1`
- For production setups `lightwalletd` requires a `cert.pem`. For more information on how to do this please [see here](https://github.com/zcash/lightwalletd#production-usage).
By default lightwalletd service will listen on `127.0.0.1:9067`
Lightwalletd will do its own synchronization, while it is doing you will see messages as:
```console
...
{"app":"lightwalletd","level":"info","msg":"Ingestor adding block to cache: 748000","time":"2022-05-28T19:25:49-03:00"}
{"app":"lightwalletd","level":"info","msg":"Ingestor adding block to cache: 749540","time":"2022-05-28T19:25:53-03:00"}
{"app":"lightwalletd","level":"info","msg":"Ingestor adding block to cache: 751074","time":"2022-05-28T19:25:57-03:00"}
...
```
Wait until lightwalletd is in sync before connecting any wallet into it. You will know when it is in sync as those messages will not be displayed anymore.
Please refer to [acceptance](https://github.com/ZcashFoundation/zebra/blob/main/zebrad/tests/acceptance.rs) tests documentation in the `Lightwalletd tests` section.