btcpayserver-docker
btcpayserver-docker copied to clipboard
Add Mempool Explorer
Why did this never leave draft state? Shall we give it another stab?
@dennisreimann @softsimon mentioned in Riga that he can try to do it in ~4 months.
I think we can pull it off on our own, most of the things @kukks did look good and I've once also set it up manually. We just need to get to it – docs here. https://github.com/mempool/mempool/tree/master/docker
The basics are updated and in place now, need to wait for my txindex to be build so that I can continue here.
@softsimon Is there an easy way to run the app under a directory-prefix like /mempool/
instead of directly in the root?
The HTML contains <base href="/">
, which is aso updated via JS depending on the language (e.g. it might get turned into <base href="/de/">
), which makes the browser load the assets from the root — we'd need a prefix like /mempool/
to run it in our context, so that we don't have to generate new SSL certs for a subdomain like mempool.mybtcpay.org
.
Normally we would use nginx sub_filter
to rewrite paths for our needs, but the JS overrides it anyways.
@kukks @dennisreimann @softsimon I think this is an important feature - I'd like to donate a 0.05 BTC bounty to make it a priority.
I have it almost working, fiddling with the details right now.
Done now, ready for review :)
you could have rebased it against master once more I guess? Just downgraded my 1.6.12 BTCPayServer to 1.6.10 - including older nbxplorer ... hopefully nothing breaks.
So far the GUI came back. 🤞
one btcpay-restart.sh later:
NGinx isn't starting anymore. Container log from nginx fills with:
2022/10/12 09:41:07 [emerg] 1#1: "proxy_pass" directive is duplicate in /etc/nginx/conf.d/default.conf:116
nginx: [emerg] "proxy_pass" directive is duplicate in /etc/nginx/conf.d/default.conf:116
Any help with this is appreciated.
Viewing Blocks leads to error 404 in the devtools and doesn't show the list of transactions: https://btcpay.4sats.net/mempool/block/000000000000000000051e3857f4f76691f7897ede16d0e21eee7c2bb60ceb84
@petzsch Thanks for the pointer, f8eae35 contains the fix.
How to test
Prerequisite: You need a non-pruned node, the fragment opt-add-mempool is incompatible with pruning.
Go to your BTCPay Server directory and run the following commands:
# Checkout this pull request
git checkout -b mempool
git pull origin mempool
# Prepare
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="$BTCPAYGEN_ADDITIONAL_FRAGMENTS;opt-add-mempool"
# Install
. ./btcpay-setup.sh -i
# Check
docker logs generated_mempool_api_1
Awesome! Unfortunately I couldn't test for now as all my nodes are pruned 😬
Generating /app/Generated/docker-compose.generated.yml
The fragment opt-add-mempool is incompatible with 'pruning'
@ndeet Yes, the requirement for ElectrumX leads to the incompatibility there. Updated the How To Test comment, thanks for the pointer!
I've noticed a strange redirection bug:
When I want to view a transaction with my browser configured to use the german language by default (i.e. Chrome) and visiting https://btcpay.4sats.net/mempool/tx/9a840e18a6104ebeeee5958027e7377752e51126a1f2f7138bfc1d750dffdd44 - it redirects me to: https://btcpay.4sats.net/mempool/de/
While when the browser is configured to english, it stays on the first link and displays the transaction correctly.
I think the desired behaviour would have been a redirect to https://btcpay.4sats.net/mempool/de/tx/9a840e18a6104ebeeee5958027e7377752e51126a1f2f7138bfc1d750dffdd44
Could be an upstream problem - not sure.
@petzsch I think this needs to be fixed on the application level. We are rewriting some of the content with nginx sub_filter
already, but I'd refrain from rewriting parts of the JavaScript.
@softsimon Do you see an easy solution for this, like specifying/infering an app variable similar to the API_URL_PREFIX
, so that we can make the app know about the URL prefix /mempool/
, which we are using?
@kukks I think we can merge and ship this — the leftover URL issue is minor I think and we can later on fix it.
@danielalexiuc https://d11n.net/donate.html for bounty <3
That's brilliant guys - awesome work, gladly paid. I think a lot of people will benefit from this.