Electrs accessible by other containers?

Hi all,

I’ve been working on porting a Docker container to Umbrel to allow Urbit to use it as a backend for its btc wallet. The package I’m porting consists of bitcoind, electrs, and a custom Express server to translate RPCs to/from HTTP. Since Umbrel already has the first two configured very similarly, the app is basically just a modified version of the Express server, which talks to bitcoind/electrs.

I’ve reached a point where I believe it should be working, but I get 502 errors, indicating the server is not talking to anything.

In the app dev documentation, there are a list of env vars that are passed via docker-compose to the app, which include the bitcoind IP and port. However, I came across a reddit thread which said that bitcoind is only accessible via Tor.

Is it possible to make RPCs container-to-container, or am I going to have to tunnel my Express server through Tor? And if I do, how do I pass the onion for it as a variable to my app?

Thank you for your help!

You can see the project here if you’re curious about what it’s doing, the two main bits are rpc/mainnet-start.sh and rpc/server.js.

Okay, I have a small update – I can curl bitcoind from the Umbrel host successfully, which leads me to believe that other containers will be able to communicate with it. However, I can’t get a route to electrs’ IP – I’m kind of confused about why the IPv4 is passed as a var if it’s not even an interface.

So, is it possible to communicate directly with electrs? If not, how do I get the onion URL?

Another update – it turns out electrs doesn’t work in the dev env, at least for me. It just reboots over and over. It is in fact reachable on a production Umbrel though, which means I should have something to PR shortly. Thanks everyone.