Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose API during Docker deployment #488

Open
scolear opened this issue Mar 19, 2024 · 0 comments
Open

Expose API during Docker deployment #488

scolear opened this issue Mar 19, 2024 · 0 comments

Comments

@scolear
Copy link

scolear commented Mar 19, 2024

I am running the esplora Docker image as per the README with the API port exposed:

$ docker run -p 50001:50001 -p 8094:80 -p 3000:3000 \ 
--volume $PWD/data_bitcoin_regtest:/data \
--rm -i -t -e  blockstream/esplora bash -c "/srv/explorer/run.sh bitcoin-regtest explorer"

But in this configuration, there is no access to the API from the outside, which I would want. I have tried all kinds of hacks, but it seems there is no way to do this without creating a custom electrs Docker image? As per this and this issue.

Accessing the API fails (it is set to 127.0.0.1:3000 instead of 0.0.0.0:3000, so understandable, but why not changeable?):

$ curl localhost:3000
curl: (56) Recv failure: Connection reset by peer

Trying access through the web interface just returns HTML:

$ curl http://localhost:8094/api/blocks/tip/
<!DOCTYPE html><head><meta charset="utf-8"><title>Bitcoin Regtest Explorer</title>......

Any help would be appreciated. Is there an easy way to expose the API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant