Having trouble getting mempool.space up and running

19 replies 453 views
Posts: 39 · Reputation: 10
#1Jul 5, 2019, 07:07 AM
Hey everyone! I've been trying to set up mempool.space on my Linux Mint laptop for a while now, but no luck so far. I've got Bitcoin Core synced up with Sparrow and the Electrum server (electrs). Docker seems to be working fine on my laptop, and I've double-checked my docker-compose.yml and Bitcoin config files. Any suggestions on how to get mempool running? Right now, all I see is the mempool page trying to load but nothing is coming through. Thanks for your help!
2 Reply Quote Share
Posts: 56 · Reputation: 32
#2Jul 5, 2019, 01:06 PM
The mempool.space github page has a link to a video that helped me out my first time running with docker.  Here's the link: https://bitcointv.com/w/8fpAx6rf5CQ16mMhospwjg I've installed plenty of services on Linux, plenty of times, but for some reason or another mempool gave the most trouble.  I was finally able to get installed on a server without docker a couple of years ago, but keeping it maintained with node.js, and npm, and nginx (or was it lighttp, I think I tried both,) was quite a chore.  A docker build is way less headache in the long run. Anyway, one common stumbling block for docker newbies is making sure the IP addresses for your docker container are being given the correct privileges.  For example, your bitcoin core is is probably set (as it should be) to only accept RPC commands from the local host.  That's a problem for docker, since it's running on it's own IP stack, making it look like another machine all together. Get your container running, then use this command to list the container's id: Look for the mempool/backend container and make note of it's container id.  To get that container's IP address, use this command: Look for the IP address for eth0 (not the loopback, obviously)  That's your container's IP address, and you want to make sure bitcoin core will accept RPC commands from that IP.  I set my core to accept RPC commands from 0.0.0.0, which makes things easer if you're running various containers that need access to it. Also check your firewall settings, if you have one running.  Treat the docker container as a separate machine, giving it access to bitcoin core and electrs. Well, that was the most common mistake I made when I was learning this shit a few years ago.  If this isn't helpful post your yml file (redact your RPC passwords) and I'll try to make heads or tails of it.  Also, maybe mocacinno will pop his head in here, he's way more versed with docker than I am.
1 Reply Quote Share
titanx539Member
Posts: 804 · Reputation: 117
#3Jul 5, 2019, 04:15 PM
Is that "romanz/electrs" or "Blockstream/electrs"? Because if the latter, the "MEMPOOL_BACKEND:" in your docker-compose.yml file should be set to "esplora". But there's not enough info in the OP to even guess the cause of issue. Please include your settings and logs if available, just remove the info like IP addresses that could be bad for your privacy.
0 Reply Quote Share
Posts: 100 · Reputation: 209
#4Jul 5, 2019, 07:56 PM
i agree that the info posted is not sufficient to really give good advice. We would need both the docker-compose.yml and the bitcoin.conf file (censored offcourse). What i would do if i was making this setup, is using a single docker-compose.yml file to load a bitcoin core image and an electrs image and the mempool image... This would simplify your setup greatly. Here's some background info: https://docs.docker.com/compose/how-tos/networking/ Such a setup would basically make it very easy for the containers to reach eachother. Each container joins the same virtual network, it registers itself in docker's internal DNS with the container name as it's hostname so you can reach container_a from container_b just by using it's hostname. You should make sure you map directory's containing persistent data to your actual filesystem (for example by mapping ~/.bitcoin to /opt/bitcoin or something, so the wallet file, bitcoin.conf and your blocks are persistent between container restarts). An other plus would be that upgrading components would be fairly easy, ... there are many scenario's you could use, including using a tool like watchtower.
3 Reply Quote Share
Posts: 39 · Reputation: 10
#5Jul 6, 2019, 02:37 PM
Hi again ! I've read everyone's comments and advice and tried within my capabilities to fix this issue but no luck. Here are the bitcoin.conf & docker-compose.yml files. I'm basically following ministry of nodes 2024 YouTube series. https://www.talkimg.com/images/2025/01/22/WknzN.png https://www.talkimg.com/images/2025/01/22/WkQ0o.png In addition to this bitcoin.conf file there is one line I've added on the last line: rpcauth:user/password Hope that's enough info & THANKS again!
2 Reply Quote Share
Posts: 790 · Reputation: 114
#6Jul 6, 2019, 05:22 PM
Quoting to show images:
3 Reply Quote Share
Posts: 100 · Reputation: 209
#7Jul 6, 2019, 10:25 PM
I have no experience with the mempool.space container, but am i correct in assuming the setup is bitcoin core is the "master", it syncs the blockchain. Electrs connects to core to and acts as an SPV host mempool.space's api container connects to electrs, and apparently also to bitcoin core to fetch it's data. mempool.space's api container connects to mempool.space's db container to create a relational database of the parsed blocks mempool.space's web container connects to mempool.space's api container, it has an exposed port forewarded to an internal port, allowing you to surf to the web interface which will connect to the api container to get the actual data from the db container. I see in your bitcoin.conf that you're allowing connections from 127.0.0.1 (localhost),  10.0.0.0/8 and 192.0.0.0/8 (typical lan ranges) and 172.0.0.0/8 (typical docker ranges). I guess this is all that's needed In your earlyer post you said you can connect your local electrum to electrs, this is still correct? You also said you can see the mempool.space web interface, but it stays empty? This would mean the web container port forewarding is working. Traffic between the web, api and db containers should go over docker's internal network, since they're all defined in the same compose file and the compose file does not specify a modified network. This means api, web and db should be able to communicate over docker's internal network without problems (the default docker internal network is pretty straight foreward without much bells and whistles). So, the network between web frontend, api and db of mempool.space should be ok. The same can be said for the connection between core and electrs (since you can connect electrum to electrs and it works, so core should be up and running, and the rpc should be working, and electrs should also be ok). This would mean the problem lays between the api container and either electrs or bitcoin core OR it's a problem with one of the components inside the mempool.space container (most likely suspect is the api container, since it looks like this is the one doing the actual "work", the other two containers are the frontend and the underlying relational database). I have no current machine where i can actually emulate your situation, but could you try if you can log in to the shell of the api container? for example: It depends on which container image was used to build mempool.space's api container wether or not this will work. Not all containers have a shell binary included... IF you are able to log in, you could try if you have debug tools available (for example, telnet or curl). If you do, you could try connecting to electrs port 50001 and core's port 8332 from inside the container... See if that works. You could also have a look around and see if you find log files. A different way to look at the log files inside the container is: We basically need to pinpoint what is going wrong... Is it the api container not being able to connect to electrs or core, or is it connecting but is the api process failing for some reason? Those would be the first two things i would try to figure out, my gut tells me odds are big that it's one of these two things that's failing. Personally, would still pull core and electrs inside the same docker environment (define them in the same compose file), that way all five containers (core, electrs, api, web and db) would be on the same virtual internal docker network, which would make it easyer to configure (only one range, no need for ip addresses since there's an internal DNS, no firewalling or port forewarding between the containers,... etc, etc). That way, the only problem would be exposing a port for the web container, so you could actually use a browser to view the data. You wouldn't even have to resync core or anything if you just mapped ~/.bitcoin on your host to /root/.bitcoin inside your container and picked a core container containing the same core version you're running right now.
0 Reply Quote Share
Posts: 39 · Reputation: 10
#8Jul 7, 2019, 02:00 AM
Hi mocacinno & everyone I appreciate the help! I ran: and it says my installation appears to be working. One think I did notice is when I run: all the containers start but when I run: I get: api-1 ERR Electrum error {"errno":3008, "code": "ENOTFOUND" "syscall":"getaddrinfo"."hostname":"XXX.XX.XX.X" I also tried running: Error response from daemon: No such container: api With this command: I get: api-1 ERR Electrum error {"errno":3008, "code": "ENOTFOUND" "syscall":"getaddrinfo"."hostname":"XXX.XX.XX.X" Im not sure if this means anything that can help as Im really new to all of this. Im going to try and figure out how to take your advice on running docker without totally messing things up. I apologize if Im not pulling my weight here. I felt like it was going to be something easy and this is going beyond that. Thanks again!!!
2 Reply Quote Share
Posts: 100 · Reputation: 209
#9Jul 7, 2019, 03:41 AM
it's logical that if "docker compose up" gives an error message, the next command will fail aswell. ENOTFOUND would indicate there's a problem with dns resolving, my guess would be there's a problem with the electrum_host environment variable you set in your compose file, or with a variable close to the electrum_host variable (tls, port, mempool_backend). When i read this: https://github.com/mempool/mempool/blob/master/docker/README.md#configure-with-bitcoin-core--electrum-server i see they're using an ip address for ELECTRUM_HOST, they're disabling TLS and using ELECTRUM_PORT 50002. How's your electrs setup? Are you using nginx as a reverse proxy so you can add an TLS layer, or are you also not using TLS? Also, i see there's a difference between blockstreams's version of electrs and romanz's version.
2 Reply Quote Share
Posts: 39 · Reputation: 10
#10Jul 7, 2019, 05:20 AM
my electrs is set up like: https://www.youtube.com/watch?v=fRLsyD4t4w8&list=PLCRbH-IWlcW0g0HCrtI06_ZdVVolUWr39&index=8 and docker / mempool: https://www.youtube.com/watch?v=PWhGMbutidI&list=PLCRbH-IWlcW0g0HCrtI06_ZdVVolUWr39&index=10 Apparently Ive gone way over my head trying to do this by following someone on YouTube   Thanks and lmk if I should throw in the towel on mempool.
3 Reply Quote Share
Posts: 705 · Reputation: 103
#11Jul 8, 2019, 08:18 AM
Correct me if I am wrong, but given that there is a docker-compose file in the mempool.space repository, shouldn't it easily be able to be spawned with just docker-compose up -d? Because if not, then that means the devs did not configure the Docker services completely to be ran automatically. You should not need to run docker commands if there is a docker-compose file.
0 Reply Quote Share
Posts: 56 · Reputation: 32
#12Jul 8, 2019, 02:33 PM
Not yet. I see you redacted your IP addresses in your yml file, but make sure you have those set correctly.  Those should both be set to the local IP for your computer (issued by your router, i.e. your LAN address.) CORE_RPC_HOST <your local lan ip> ELECTRUM_HOST <your local lan ip> The other alternative that will work is the Docker container's "gateway" address.  Either IP will point to the same place.
4 Reply Quote Share
Posts: 100 · Reputation: 209
#13Jul 8, 2019, 04:34 PM
Very true, the problem here is that the dev's have prereq's (a running core and, if necessary, a running electrs). IMHO, they should have created a compose file with all 5 services instead of creating a compose file with 3 services and a prereq of two other ones.
3 Reply Quote Share
Posts: 39 · Reputation: 10
#14Jul 8, 2019, 09:19 PM
Hi DW I've tried both. I got my local ip by typing and looking next to inet Also next to docker0 Hope this is correct & thanks again! Would all of this be written in the docker-compose.yml? TY
2 Reply Quote Share
Posts: 56 · Reputation: 32
#15Jul 10, 2019, 08:21 AM
Let's forget about Docker for a second.   I use Debian 12 as my go to Linux distro which doesn't have ifconfig installed by default, but IIRC it gives the same feedback.  Regardless, both should work in Mint. From your terminal use this command: Assuming your laptop is connected to wired lan and wifi (like mine when at home) the first two lines of output should look like this: Set CORE_RPC_HOST <your computer's wired IP address> ELECTRUM_HOST <your computer's wired IP address> You can choose which of your computer's IP addresses you use for your yml settings, but I suggest using a wired lan for more reliability.  Make sure both parameters are set to the same IP. If for some reason your local router likes to shuffle IP addresses (uncommon, but not unheard of) you may want to use the docker container's "gateway" address instead.  It'll still point to the host machine just like above, but since it's running in a virtual environment it the thinks the host machine is the router. The output should look something like this: The host machine acts like a DHCP server for the Docker containers, so in this case we want to use 172.0.16.1 (i.e. the "router's" IP address) for our yml settings.  It's still looking for Bitcoin Core and Electrs from the same source, it's just using a different way to identify the same computer.
2 Reply Quote Share
Posts: 39 · Reputation: 10
#16Jul 10, 2019, 11:24 AM
Hey DW I just tried setting both: CORE_RPC_HOST <your computer's wired IP address> ELECTRUM_HOST <your computer's wired IP address> to my computer's wired IP and still getting a mempool page trying to load data. Thanks for the good idea!
1 Reply Quote Share
Posts: 56 · Reputation: 32
#17Jul 10, 2019, 01:55 PM
That's a good sign. It might take a few minutes before mempool spins up, and then the page won't have a lot of data until the maria DB gets populated.  Unless you get errors, be patient.
1 Reply Quote Share
Posts: 39 · Reputation: 10
#18Jul 12, 2019, 03:58 AM
Hey DW this was it! I should of just disabled my firewall to do a easy check. Now for another stupid question: How do I give the docker container access to bitcoin & electrs Hey thanks everyone. I appreciate the help!
1 Reply Quote Share
Posts: 56 · Reputation: 32
#19Jul 12, 2019, 05:31 AM
I thought that might have something to do with it...  Don't ask me how I know      If you're referring to your firewall, you'll need to grant the Docker container's IP address privileges to ports 8332 and 50001.  I assume you're using ufw, but if not you'll have to refer to your firewall's manual.  You'll need the mempool/backend docker container's IP address, but to use my example IP from above as a demonstration: Depending on whether you want your Electrum SPV server available while your out and about, you may just want to open it up the whole world instead.  In that case: But don't do that for Bitcoin Core's RPC port, especially if you use it for managing wallets.  I mean, it's unlikely to get hacked if you have a strong RPC password, but there's no reason to take the risk.  You can open up Bitcoin Core's p2p port to the world.  There's no risk in that, and it'll help the ecosystem:
1 Reply Quote Share
Posts: 39 · Reputation: 10
#20Jul 13, 2019, 12:24 AM
I just guessed it was Docker's api ip address I needed & thankfully it was. It's kinda disturbing that my firewall got me hung up for days  Thanks again! Hopefully this helps other newbies trying to run a node like this.
0 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics