Blockstream / esplora

Explorer for Bitcoin and Liquid
MIT License
1.01k stars 401 forks source link

Feature Request: Let electrs and esplora be self-hosted by users (not currently possible) #489

Open nakoshi-satamoto opened 8 months ago

nakoshi-satamoto commented 8 months ago

I did not see a way to open an issue on the Blockstream electrs fork. So I am opening it here as it is a dependency of Esplora.

My computer has 16 GB of RAM. Even if I'm only using a few GB of RAM before trying to sync electrs for the liquid network, it quickly consumes all of my RAM casuing both liquid and electrs to crash. Right now it is impossible to actually get electrs to work due to the memory leak or resource depletion. I happen to be on a computer with intel ME stripped out (impossible to do after sandy and ivy bridge) so I am able to handle 16 GB of RAM. However, most freedom computers which do not include backdoors in the CPU (like intel or AMD) actually are limited to 4GB of RAM. Does electrs (and blockstream green of which electrs is a dependency of to use it privately) actually require use of backdoored computers to use? I'd think that even 16 GB of RAM would have been enough. But we should also keep in mind the computers that are capped at 4 GB of RAM.

Is it possible to limit the amount of RAM used by electrs to prevent it from consuming all system resources and crashing? 16 GB of RAM is ALOT and should in itself be enough.

nakoshi-satamoto commented 8 months ago

I used this command to create an environment that has a cap on RAM utilization from which I run electrs. This in theory makes it throttled at 4 GB of RAM usage and terminates if it reaches 5 GB of RAM usage with throttling unsuccessful.

systemd-run --scope --user -p MemoryHigh=4096M -p MemoryMax=5000M -- /bin/bash

Electrs no longer temrinates from resource depletion, but now electrs is encountering a new problem


TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers
TRACE downloading 100000 block headers

TRACE downloading 100000 block headers
WARN reconnecting to bitcoind: disconnected from daemon while sending
TRACE downloading 100000 block headers

TRACE downloading 100000 block headers
WARN reconnecting to bitcoind: disconnected from daemon while sending
WARN reconnecting to bitcoind: expected 293690505 bytes, got 218120077
WARN reconnecting to bitcoind: expected 293690505 bytes, got 213925773

WARN reconnecting to bitcoind: expected 293690505 bytes, got 211206029
WARN reconnecting to bitcoind: expected 293690505 bytes, got 209256333
WARN reconnecting to bitcoind: expected 293690505 bytes, got 210648973
WARN reconnecting to bitcoind: expected 293690505 bytes, got 207863693
WARN reconnecting to bitcoind: expected 293690505 bytes, got 213614477

If anyone can advise me on how I can run electrs please let me know. Thank you

nakoshi-satamoto commented 8 months ago

actually my mentioned potential solution for resource throttling does not actually work because I think that electrs just simply stops doing anything when it reaches the memory limit.

Currently it seems as if elects does not work. Has anyone been successful in running electrs?

There is a big benefit in people being able to run their own esplora and electrs server so that they can maintain privacy of their wallets.. Although Blockstream is not evil; the problem is that I am suspect that Blockstream uses "the cloud" for hosting. Google Cloud? This means that US intelligence agencies could in theory be able to see all addresses that are correlated with each other. US intelligence agencies and google (which is a spying partner with the US federal gov) is able to see all data stored and within memory (virtual RAM) of any server hosted on "the cloud".

Esplora and Electrs should be able to have the option for users to run their own instance. Maybe this can be changed to a feature request to support self-hosted as an option.