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) (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:
# 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:
[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:
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.
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!