# How to enable RPC for Zebra 1.0.0 stable release?

**URL:** <https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897>\
**Category:** Zebra\
**Created:** [June 19, 2023, 1:52pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897 "2023-06-19T13:52:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aarnott](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@aarnott](https://forum.zcashcommunity.com/u/aarnott)\
**Post date:** [June 19, 2023, 1:52pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/1 "2023-06-19T13:52:55Z")

</div>

Since upgrading zebra from the RC releases to the 1.0.0 stable release, I can’t get RPC on port 8232 to work anymore. I’ve been following the steps at [Hosting Zcash litewalletd via Zebra – JMPInline (nerdbank.net)](https://blog.nerdbank.net/2022/12/hosting-zcash-litewalletd-via-zebra) (in fact, I wrote that blog) for some time, but now with 1.0.0, port 8232 appears to be closed.

I’m running zebra via its docker image. When I run bash within the docker container (while zebra is running) and run curl, I get this:

```auto
# curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: application/json' http://127.0.0.1:8232/
curl: (7) Failed to connect to 127.0.0.1 port 8232: Connection refused

```

The zebrad.toml file I created includes this:

```auto
[rpc]
listen_addr = '0.0.0.0:8232'

```

But when I start the container, it rewrites the file and removes that section. This is the whole content of the rewritten file:

```auto
[network]
network = "Mainnet"
listen_addr = "0.0.0.0"

[state]
cache_dir = "/var/cache/zebrad-cache"

[metrics]
#endpoint_addr = "0.0.0.0:9999"

```

Why is zebra rewriting my config file? How do I enable JSON-RPC calls into it?

---

<div class="post-metadata">

**Author:** ![gustavovalverde](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/gustavovalverde/32/41070_2.png) [@gustavovalverde](https://forum.zcashcommunity.com/u/gustavovalverde)\
**Post date:** [June 19, 2023, 2:34pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/2 "2023-06-19T14:34:49Z")

</div>

Thank you for reporting this. I’ll have a look at it as we recently made changes to Docker, including an `entrypoint` for the runtime build: [zebra/docker/runtime-entrypoint.sh at main · ZcashFoundation/zebra · GitHub](https://github.com/ZcashFoundation/zebra/blob/main/docker/runtime-entrypoint.sh)

This is a great post by the way [Hosting Zcash litewalletd via Zebra – JMPInline](https://blog.nerdbank.net/2022/12/hosting-zcash-litewalletd-via-zebra), we might consider including the Healthcheck in our image 😬

---

<div class="post-metadata">

**Author:** ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://forum.zcashcommunity.com/u/Marek)\
**Post date:** [June 19, 2023, 3:33pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/3 "2023-06-19T15:33:53Z")

</div>

We rewrote our Dockerfile for the stable release, so specifying the RPC port manually in your config in the Docker volume won’t work anymore. You can now pass the RPC port when building the image (`--build-arg RPC_PORT=8232`) or when starting the container (`--env "RPC_PORT=8232"`), and Zebra will pick it up. Here’s the relevant Dockerfile part when building the image: [zebra/docker/Dockerfile at 40d697a66c3a732502a99994d0d2692c3ebf3e08 · ZcashFoundation/zebra · GitHub](https://github.com/ZcashFoundation/zebra/blob/40d697a66c3a732502a99994d0d2692c3ebf3e08/docker/Dockerfile#L161), and here’s the relevant part of the script that starts Zebra in the container: [zebra/docker/runtime-entrypoint.sh at 40d697a66c3a732502a99994d0d2692c3ebf3e08 · ZcashFoundation/zebra · GitHub](https://github.com/ZcashFoundation/zebra/blob/40d697a66c3a732502a99994d0d2692c3ebf3e08/docker/runtime-entrypoint.sh#LL49C3-L54C3). Please note that the Docker API might change soon. You can track the status of those updates here [Inconsistent management of ports in the Dockerfile · Issue #6759 · ZcashFoundation/zebra · GitHub](https://github.com/ZcashFoundation/zebra/issues/6759).

---

<div class="post-metadata">

**Author:** ![aarnott](https://avatars.discourse-cdn.com/v4/letter/a/ecd19e/32.png) [@aarnott](https://forum.zcashcommunity.com/u/aarnott)\
**Post date:** [June 19, 2023, 4:18pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/4 "2023-06-19T16:18:23Z")

</div>

Thanks. I like the changes. I added this to my docker-compose.yml file:

```auto
    environment:
    - RPC_PORT=8232

```

And removed the external volume I had previously had to setup in order to set up the config file.  
It seems to be working now. 🙂

---

<div class="post-metadata">

**Author:** ![Marek](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Marek](https://forum.zcashcommunity.com/u/Marek)\
**Post date:** [June 19, 2023, 4:27pm UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/5 "2023-06-19T16:27:52Z")

</div>

Great, these are very recent changes. We’ll have them documented in the Zebra book together with other Docker config options at some point.

Happy shielding.

---

<div class="post-metadata">

**Author:** ![teor](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/teor/32/17846_2.png) [@teor](https://forum.zcashcommunity.com/u/teor)\
**Post date:** [June 20, 2023, 12:14am UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/6 "2023-06-20T00:14:33Z")

</div>

Thanks for the great blog post!

Here’s some things you might be interested in tweaking:

> With zcashd, we could use the included `zcash-cli` tool, but that tool is not included in the zebra image. I suspect it would be incompatible anyway

`zcash-cli` is compatible with `zebrad`, we’ve used it in some of our manual RPC testing. Feel free to copy it across from the `zcashd` Docker image, and use it with `zebrad`.

> HEALTHCHECK --interval=15s --start-period=3m CMD curl --data-binary ‘{“jsonrpc”: “1.0”, “id”:“curltest”, “method”: “getblockchaininfo”, “params”: }’ -H ‘content-type: application/json’ [http://127.0.0.1:8232/](http://127.0.0.1:8232/)

If you use the getinfo method, it could be slightly faster, because it has a smaller RPC response, and it doesn’t query the chain tip. It’s unlikely to make any practical difference though!

---

<div class="post-metadata">

**Author:** ![dismad](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/dismad/32/18432_2.png) [@dismad](https://forum.zcashcommunity.com/u/dismad)\
**Post date:** [June 20, 2023, 3:07am UTC](https://forum.zcashcommunity.com/t/how-to-enable-rpc-for-zebra-1-0-0-stable-release/44897/7 "2023-06-20T03:07:06Z")

</div>

> [@teor](#):
>
> `zcash-cli` is compatible with `zebrad`, we’ve used it in some of our manual RPC testing. Feel free to copy it across from the `zcashd` Docker image, and use it with `zebrad`.

Did not know this, very neat!

![Screenshot_2023-06-19_20-06-30](https://global.discourse-cdn.com/zcash/original/3X/b/1/b1de7c74f7d5be8790729c2a215776748a756491.png)
