Repository navigation
The UTXO snapshot over BitTorrent first (pinned info hash), bounded seeding, https as the fallback - #2
Conversation
22b49ee to
ceddb4b
Compare
|
Full run of this branch on a fresh DigitalOcean droplet (s-2vcpu-4gb: 2 vCPU, 4 GB, 80 GB, Ubuntu 24.04), with a
For comparison on the same plan: the published 2026-10-05.2 (chain tarball) took 32 min 50 s to READY; The seeder on the installing node worked as designed (transient unit, metadata copy in Still open from my side: the info hash for your 910,000 file (its URL is a 404 for me today). Once it is published, |
…ns in the heartbeat Nothing on an installed node updates by itself, and AlphaPool cannot push an update; that stays. What was missing is a way for the owner to learn that a newer installer is published, and a way to see who still has to move to a release that every node must run from a given block: - `alphapool-node upgrade check` downloads the published installer (INSTALLER_URL), prints its version and sha256 next to the installed copy's, and runs nothing. - `alphapool-node upgrade <sha256> [--yes]` downloads it again, refuses it unless the sha256 is the one given (from the dashboard's "My node" or the CHANGELOG), then runs that installer's --upgrade, which shows what changes and asks first. The download lands in the installer's own work area (/var/lib/alphapool/dl). - `KNOTS_REQUIRED_VER` / `KNOTS_REQUIRED_BY_HEIGHT` (empty for now) next to the start modes: the installer release that pins the soft-fork client fills them. write_versions warns when the installed bitcoind is not that release, `alphapool-node status` shows an UPDATE line until the node runs it (the pins come from --pins, or from /etc/alphapool/versions when the installer on the server is older), and the heartbeat (agent v6) adds software.knots (bitcoind's version line) and software.installer.
The repository has no license, so nobody may legally copy, adapt or redistribute the installer, which the README invites people to read and run. MIT is what the DATUM gateway ecosystem uses. Only the owner can grant it: merge this commit only if that is the intent; drop it otherwise, the rest of the branch does not depend on it.
…eeding, https as the fallback Every new node downloads 9.6 GB from one server with a few download slots. With the swarm, other installing nodes and the seeders carry that, the server is the fallback, and a busy server costs nothing: the torrent needs no slot. The pinned info hash is as strong a pin as the sha256: aria2 takes no piece whose hash is not in the metadata the info hash names, and the sha256 and header checks follow as before. - utxo_table gains two optional columns: the file's BitTorrent info hash and the URL of its .torrent file. tools/make-torrent.py FILE --webseed URL (pure Python) prints the sha256, the info hash and a magnet link. No info hash is pinned for the 910,000 file yet (its URL is not live): until then nothing changes for a default install. - Step 5: with an info hash, BitTorrent first (the pinned .torrent if its info hash is the pinned one, else the magnet link from the info hash and four pinned trackers). The pieces land in FILE.bt, never in the https file (a torrent's partial file is sparse and must not be "resumed" sequentially); a re-run resumes with aria2 re-checking the pieces. No download speed for 15 minutes ends the attempt and the https download takes over, with the slot waits as before. An https partial from an earlier run is left to https. --no-torrent: https only. - After the sha256 and header checks the node seeds the file to other installing nodes for at most 2 hours or share ratio 2 (transient service alphapool-snapshot-seed, metadata in /var/lib/alphapool/seed, root only). The seeder keeps the file open, so the node's load, which moves and deletes the file, does not stop it; the space is freed when it ends. If ufw is on, TCP 6881 is allowed meanwhile and removed after (and at uninstall). --no-seed turns it off; systemctl stop alphapool-snapshot-seed stops it early. - The validated-start journal records the info hash and the .torrent URL; --print-cloud-init passes --no-torrent / --no-seed on.
…arted The seeder starts in step 5; step 7 turns ufw on. On a server where ufw was off at install time the seeding port was never allowed, so other installing nodes could not reach this one (it still uploaded to the peers it connected to itself). step_firewall now allows 6881-6889 while alphapool-snapshot-seed is active, and the seeder removes the rule when it ends whoever added it. Seen on a DigitalOcean droplet during a full run.
a9def90 to
72beac7
Compare
|
Rebased onto 632a912 on top of the rebased #1 (still stacked: its three commits come first). Two merges in install.sh: the column 7/8 comment goes under your new line above |
Made from the published utxo-910000.dat (sha256 6ac0208110d6…, 9,637,809,744 bytes) with tools/make-torrent.py, 4 MiB pieces, the https URL as web seed: info hash e1fb935bdbc0429c8c2521cb81d6c8f42ff26f8b. A seeder is up. The https URL stays the fallback, as for 976000.
|
Added the 910000 row's torrent info hash too (4c8f819): |
Rebased on
next; this branch includes #1's commits (stacked), the last commit is this one. Not a draft any more:nothing here depends on a Knots release. The earlier version of this PR replaced the chain tarball with assumeutxo;
nextdid that already, with the 910,000 snapshot that 29.4.2 knows, so only the download part remains.Why
Every new node downloads 9.6 GB from one server with a few download slots. With the swarm, other installing nodes and
a couple of seeders carry that, the server is the fallback, and a busy server costs nothing: the torrent needs no
slot. The pinned info hash is as strong a pin as the sha256: aria2 takes no piece whose hash is not in the metadata
the info hash names, and the sha256 and header checks follow as before.
What
utxo_tablegains two optional columns: the file's BitTorrent info hash and the URL of its.torrentfile.tools/make-torrent.py FILE --webseed URL(pure Python, no dependencies) prints the sha256, the info hash and amagnet link; README "Publishing a snapshot" describes the two steps. No info hash is pinned for the 910,000 file in
this PR: its URL is not live yet (404 today), so I could not compute it. Once the file is published, one run of the
script gives the value for column 7; a
.torrentnext to the file (column 8) is optional but better, because itsweb seed lets a node without peers finish over https within the same download.
.torrentif its info hashis the pinned one, else the magnet link from the info hash and four pinned public trackers). The pieces land in
FILE.bt, never in the https file (a torrent's partial file is sparse and must not be "resumed" sequentially); are-run resumes with aria2 re-checking the pieces. No download speed for 15 minutes ends the attempt and the https
download takes over, with the slot waits as before. An https partial from an earlier run is left to https.
--no-torrent: https only.ratio 2 (transient service
alphapool-snapshot-seed, the saved metadata in/var/lib/alphapool/seed, root only).The seeder keeps the file open, so the node's load, which moves and deletes the file, does not stop it; the space is
freed when it ends. If ufw is on, TCP 6881 is allowed meanwhile and removed after (and at uninstall).
--no-seedturns it off;
systemctl stop alphapool-snapshot-seedstops it early..torrentURL, so a resume after a reboot uses them.--print-cloud-initpasses--no-torrent/--no-seedon.Testing done
bash -neverywhere.utxo_file_ready,utxo_torrent_downloadandutxo_seed_startwere run with aria2c, curl,systemctl, systemd-run and ufw shimmed and a small fake snapshot with a real header: magnet success (file verified,
metadata saved, seeder started), torrent failure then https,
--no-torrent, no info hash pinned (today's line:https only, nothing changes), a
.torrentwith the wrong info hash (refused, magnet used), a.torrentwith thepinned one (used), an https partial from before (torrent steps aside),
--no-seed, aria2 writing past--index-out(no sparse file reaches https), a corrupted file (AP-401), and the seed helper's cleanup. Not done: a real swarm
download on a server; I will run one against a seeder of mine as soon as the 910,000 file is published, and post
the timings here.