The Onion Monero Blockchain Explorer on monerod-box, published at
exmrplore.contrapeso.xyz. Ten Gatus endpoints green across the node and the
explorer.
── It needs a compiled monero source tree, not a running monerod ───────────
xmrblocks is not an RPC client. cmake/FindMonero.cmake imports 21 STATIC
libraries out of a monero build tree and includes its headers, because it opens
the LMDB directly. The release tarball we install for the daemon ships only
executables - no .a files, no headers - so there is nothing on the box to link
against, and building it means compiling monero first.
Measured on Debian 13, building only the libraries it links:
peak RSS, one cc1plus ~3.2 GB
peak RSS at -j4 ~5.5 GB
wall time at -j4 167 s
source + build tree 195 MB
toolchain 1.6 GB
That rules the box out at ANY parallelism: 768 MiB and 1800 MiB were both
OOM-killed at -j1 and -j2, because a single translation unit over 3 GB is not
something lower -j works around. My first estimate of "~10 GB of disk" was
wrong by two orders of magnitude - that figure describes upstream's full `make`,
which also builds monerod, both wallets and the test suite, none of it linked
here. Disk was never the constraint.
So scripts/build-xmrblocks.sh does the build in a debian:13 container. An
artefact only one machine can produce is one nobody can audit; this way any host
with Docker and ~6 GB reproduces it. It verifies the monero source against
binaryFate's signature exactly as roles/monero does for the daemon, and the role
asserts the resulting sha256 ON THE CONTROL NODE before copying a single byte.
── Three upstream problems, none documented anywhere ───────────────────────
Found by building, not by reading:
1. libasio-dev is absent from upstream's dependency list. That list is
Ubuntu-based; Crow wants standalone asio.hpp, not boost/asio.hpp, and on
Debian 13 the build dies outright.
2. The explorer does not compile against monero v0.18.5.1. v0.18.5.0 changed
get_pruned_transaction_hash from returning the hash to returning bool with
an out-param, and src/page.h still calls the old form. Upstream's
Dockerfile pins v0.18.4.0, which is why nobody has hit it. Patched from an
exact-line anchor, so if upstream fixes it the build STOPS rather than
quietly doing something else. We patch instead of building against 0.18.4.0
because the signed hashes.txt only covers the current release - using the
older source would mean dropping the provenance chain. LMDB is VERSION 5 in
both, so either reads the other's database.
3. FindMonero.cmake hunts for miniupnpc inside the monero build tree with
NO_DEFAULT_PATH, but monero stopped vendoring miniupnp as a submodule.
Fixed with a cache override rather than patching their cmake.
USE_DEVICE_TREZOR=OFF as well - an explorer has no use for hardware wallets and
it drops the generated protobuf units. Verified that xmrblocks still links.
── Two things in the unit that look wrong and are not ──────────────────────
WorkingDirectory is load-bearing: page.h hardcodes TMPL_DIR as "./templates",
resolved relative to cwd at REQUEST time. Get it wrong and the service starts,
binds 8081, and 500s every page. That is also why the health check fetches a
real page and greps it instead of probing the port.
ReadWritePaths must include the blockchain directory even though the database is
opened read-only: monero sets mdb_flags = MDB_RDONLY WITHOUT MDB_NOLOCK, so
LMDB still registers this reader in lock.mdb. With ProtectSystem=strict and
nothing writable the open fails. "It only reads, so grant it nothing" is wrong.
── Timeouts are measured, not guessed ──────────────────────────────────────
proxmox-tank-1 is a spinning-disk mirror and xmrblocks says so on startup.
First start took 98s to open the LMDB before binding (wait_for now allows 300s),
and a COLD index page took 68 SECONDS where the next two took 0.87s and 0.012s
(the check now allows 90s, its unit 180s). The first pass used 90s and 25s and
produced exactly the false failures you would expect.
A stat() bug was caught the same way: `stat` computes a sha1 by default, so
checking that data.mdb exists was hashing the entire 40 GB blockchain. --check
found it before a real run did.
── Exposure ────────────────────────────────────────────────────────────────
Caddy on vipy terminates TLS; the upstream is reached over the tailnet, which
needed a headscale ACL entry for tag:monerod-box:8081 - without it the node is
invisible, not merely unreachable, and the symptom is a 502 "no such host".
No authentication, deliberately: it is a block explorer over public chain data.
That includes --enable-pusher, so a visitor can relay a raw transaction through
our node. A choice, not an oversight; flip xmrblocks_enable_pusher to close it.
── Also ────────────────────────────────────────────────────────────────────
monerod-box raised 2048 -> 6144 MiB. Not for the explorer: monerod alone had
outgrown 2 GB past ~39% of the chain and was OOM-killed twice in a morning at
1.74 GB anon-rss. Recorded in vms.auto.tfvars because ignore_changes = all means
tofu will not reconcile it. The box now idles at ~1.2 GB of 5.9 GB with both
services up.
No backups, deliberately - binary, templates and chain are all reproducible.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
92 lines
5.6 KiB
YAML
92 lines
5.6 KiB
YAML
---
|
|
# Everything, in the order it has to happen.
|
|
#
|
|
# This file is a TABLE OF CONTENTS, not a second source of truth. It says what
|
|
# runs and in what order. It does NOT say which hosts get what — that stays on
|
|
# the `hosts:` line inside each playbook, exactly where it is today. Nothing
|
|
# moves; this file only makes the set readable in one place.
|
|
#
|
|
# What runs on a host? ansible-playbook site.yml --limit <host> --list-hosts
|
|
# Who gets thing Y? the `hosts:` line in Y's own playbook
|
|
# What is a host? ansible-inventory --graph
|
|
#
|
|
# Run a slice with --limit, or run one playbook directly as before. Nothing here
|
|
# changes how any individual playbook behaves.
|
|
|
|
# ── Baseline: every managed machine ─────────────────────────────────────────
|
|
- import_playbook: infra/01_user_and_access_setup_playbook.yml
|
|
- import_playbook: infra/02_firewall_and_fail2ban_playbook.yml
|
|
- import_playbook: infra/900_install_rsync.yml
|
|
- import_playbook: infra/920_join_headscale_mesh.yml
|
|
# Idempotent and kept permanently: guarantees a rebuilt or restored host cannot
|
|
# quietly bring the Uptime-Kuma-era monitoring back.
|
|
- import_playbook: infra/409_remove_legacy_monitoring.yml
|
|
|
|
# ── Monitoring ──────────────────────────────────────────────────────────────
|
|
# Gatus first: the three plays below register endpoints with it, and registering
|
|
# against a host that is not serving yet would simply fail.
|
|
- import_playbook: services/gatus/deploy_gatus_playbook.yml
|
|
# The Signal transport for Gatus alerts. Shares a docker network with Gatus and
|
|
# publishes no ports - the API has no authentication. Needs a one-time manual
|
|
# device link; see roles/signal_api/README.md.
|
|
- import_playbook: services/signal-api/deploy_signal_api_playbook.yml
|
|
- import_playbook: infra/400_host_monitoring.yml
|
|
- import_playbook: infra/401_service_monitoring.yml
|
|
- import_playbook: infra/402_public_monitoring.yml
|
|
# Registers where the per-service probes report. The probes themselves are
|
|
# deployed by each service's own playbook further down; the endpoints must exist
|
|
# before the first push arrives.
|
|
- import_playbook: infra/403_service_probe_registration.yml
|
|
# 910_docker says `hosts: managed`, but only 5 of 11 managed hosts have or need
|
|
# Docker. Left out until it has a [docker] group — see the note in PLAN_7.
|
|
|
|
# ── The hypervisor ──────────────────────────────────────────────────────────
|
|
- import_playbook: infra/nodito/31_proxmox_community_repos_playbook.yml
|
|
- import_playbook: infra/nodito/32_zfs_pool_setup_playbook.yml
|
|
- import_playbook: infra/nodito/34_nut_ups_setup_playbook.yml
|
|
|
|
# ── Reverse proxy, before anything that registers a vhost ───────────────────
|
|
- import_playbook: services/caddy_playbook.yml
|
|
|
|
# ── Services ────────────────────────────────────────────────────────────────
|
|
- import_playbook: services/bitcoin-knots/deploy_bitcoin_knots_playbook.yml
|
|
- import_playbook: services/fulcrum/deploy_fulcrum_playbook.yml
|
|
- import_playbook: services/datum-gateway/deploy_datum_gateway_playbook.yml
|
|
- import_playbook: services/mempool/deploy_mempool_playbook.yml
|
|
- import_playbook: services/monero/deploy_monero_playbook.yml
|
|
- import_playbook: services/xmrblocks/deploy_xmrblocks_playbook.yml
|
|
- import_playbook: services/memos/deploy_memos_playbook.yml
|
|
- import_playbook: services/forgejo-runner/deploy_forgejo_runner_playbook.yml
|
|
- import_playbook: services/phoenixd/deploy_phoenixd_playbook.yml
|
|
- import_playbook: services/headscale/deploy_headscale_playbook.yml
|
|
- import_playbook: services/vaultwarden/deploy_vaultwarden_playbook.yml
|
|
- import_playbook: services/forgejo/deploy_forgejo_playbook.yml
|
|
- import_playbook: services/lnbits/deploy_lnbits_playbook.yml
|
|
- import_playbook: services/ntfy-emergency-app/deploy_ntfy_emergency_app_playbook.yml
|
|
- import_playbook: services/personal-blog/deploy_personal_blog_playbook.yml
|
|
|
|
# ── Backups: each source dumps itself, the box pulls ────────────────────────
|
|
- import_playbook: services/headscale/setup_backup_headscale.yml
|
|
- import_playbook: services/vaultwarden/setup_backup_vaultwarden.yml
|
|
- import_playbook: services/forgejo/setup_backup_forgejo.yml
|
|
- import_playbook: services/lnbits/setup_backup_lnbits.yml
|
|
- import_playbook: services/memos/setup_backup_memos.yml
|
|
- import_playbook: playbooks/backups.yml
|
|
|
|
# Deliberately not here. Every playbook in the repo is either imported above or
|
|
# listed below, so this file accounts for all of them:
|
|
#
|
|
# infra/910_docker_playbook.yml says `hosts: managed`, but Docker is on 5
|
|
# of 11 managed hosts and those 5 are exactly
|
|
# the ones that need it. Running it would
|
|
# install Docker on the Bitcoin node and the
|
|
# hypervisor. Needs a [docker] group first.
|
|
#
|
|
# infra/nodito/30_proxmox_bootstrap one-shot: bare-metal bootstrap, run once
|
|
# infra/nodito/33_..._cloud_template one-shot: builds the VM template
|
|
#
|
|
#
|
|
# services/vaultwarden/disable_ deliberate manual actions, not convergence
|
|
# vaultwarden_sign_ups_playbook.yml
|
|
# services/personal-blog/setup_
|
|
# deploy_alias_lapy.yml
|