nix-bitcoin
nix-bitcoin copied to clipboard
Add mempool
This PR tracks my modifications to #456 (nixbitcoin:mempool-nb).
It is based on https://github.com/fort-nix/nix-bitcoin/pull/504 (Add fulcrum
).
Deployed at https://mempool.nixbitcoin.org
I think this pretty much works now and could be spun out into a new PR to merge.
This PR is ready for review. Here's the unsquashed version.
Upstream requirements for merging:
- https://github.com/mempool/mempool/pull/2096
- https://github.com/mempool/mempool/pull/2078
- https://github.com/mempool/mempool/pull/2058
Thanks for working on this. Will get back to on those PRs soon.
To explicitly check the change to nodeinfo (which is covered by the tests), run:
run-tests.sh -s '{
imports = [ scenarios.regtestBase ];
services.mempool.enable = true;
nix-bitcoin.onionServices.mempool-frontend.enable = true;
nix-bitcoin.nodeinfo.enable = true;
}' container --run c nodeinfo
# Result:
# {
# ...
# "mempool-frontend": {
# "local_address": "127.0.0.1:60845",
# "onion_address": "udiacmki6rjrtcxkttwpv3iilczaz52gybodi7ceqwmubulhndhrapad.onion:80"
# }
# }
After reviewing the code and testing the module, I think this PR is ready to get merged. Let's wait for the upstream PRs and then merge this. :tada:
Sorry for the delay on merging the upstream PRs but they are in the queue
Hello @erikarvstedt , do you think we can proceed with merging this one (as mentioned in https://github.com/mempool/mempool/issues/2246#issuecomment-1302763702)?
if you still consider this PR unstable, I was thinking about adding support for an alternative explorer - btc-rpc-explorer. What do you think?
Thanks.
I think we are still waiting to merge a big nginx PR ?
I think we are still waiting to merge a big nginx PR ?
I think this was discussed here, @erikarvstedt wanted to merge regardless
I think we are still waiting to merge a big nginx PR ?
No, this PR is only blocked by https://github.com/mempool/mempool/issues/2246.
You recently downgraded the axios
dependency (a possible cause of the bug), so let's give this another try.
any updates?
On 2023-01-17 the nixbitcoin.org mempool instance will have run for 30 days.
If the axios
bug hasn't appeared by then, we can merge this.
Things are fine when address queries are served without an error, like https://mempool.nixbitcoin.org/address/16KYNEvXdjVei9CJoHMsYye7zKmjVbnybi.
@knorrium have you observed the axios state bug since we downgraded the dependency version?
Closes https://github.com/fort-nix/nix-bitcoin/issues/394
The bug has reappared, after running for 26 days. I've restarted the backend.
What we'll do now:
- Release mempool as an extension flake in a separate repo, with a weekly timer that restarts the backend.
- Add an extra instance to nixbitcoin.org that can be used for debugging.
hmm that suggests the old bug we had where axios would get into a broken state is still around, easier to reproduce using tor - @knorrium after the umbrel release we should prioritize investigating this
The mempool flake will be released when https://github.com/fort-nix/nix-bitcoin/pull/586 is merged.
I've added two extra mempool instances to nixbitcoin.org.
- https://mempool-debug-tor.nixbitcoin.org
This sets a Tor
SOCKS5PROXY
, like in our main config. - https://mempool-debug.nixbitcoin.org This runs without a Tor proxy. We've never run this in production over an extended period of time. Maybe the bug doesn't happen here.
These instances share the same bitcoind and fulcrum backend, and are implemented here.
@wiz, when the bug reappears, we'll keep these instances running and give you SSH access to the nodejs debug socket.
The mempool extension module has been released for some time, and is now listed in the nix-bitcoin README.
Thanks for the hard work on this. We've also made progress tracking down the remaining issues, it seems we weren't using axios in all places and the built-in NodeJS http client is buggy 😓
The bug has now appeared on both debug instances: https://mempool-debug.nixbitcoin.org/address/1CGG9qVq2P6F7fo6sZExvNq99Jv2GDpaLE https://mempool-debug-tor.nixbitcoin.org/address/1CGG9qVq2P6F7fo6sZExvNq99Jv2GDpaLE
Both instances were started on 2023-02-24 and failed ~20 days (debug-tor) and ~25 days (debug) later. @wiz, @knorrium, if you're interested in SSH nodejs debug socket access, let me know via Matrix.
Can you upgrade to v2.5.0 tag? We added a potential fix for this issue
What's the status of this? I was looking into running one of these today.
I've updated the extension module to the latest release 2.5.0
.
Also, I've updated both debug instances. If they run stably for 30 days, I'll add mempool as a core nix-bitcoin module.
@jb55, the extension module is ready for production use.
@erikarvstedt not gonna lie I have no idea how to extend my nixos system modules, I've always just patched my nixpkgs.
ah cool there are instructions. thank you!
The Electrum backend failure bug has been fixed. Ready to merge. This branch is running live on nixbitcoin.org.
Use this for comparing the content of this PR with the extension flake:
git clone https://github.com/fort-nix/nix-bitcoin-mempool /tmp/nix-bitcoin-mempool
extension=/tmp/nix-bitcoin-mempool
nb=<nix-bitcoin-src>
git diff --no-index {$extension,$nb}/modules/mempool.nix
git diff --no-index {$extension,$nb}/pkgs/mempool
Rebased.
Hmm is this active on mempool.nixos.org rn? Address queries appear to be failing.
Rebased and deployed.
The shellcheck job fails.