Page MenuHomePhabricator

Added a script to automate collecting and updating seeds
Needs RevisionPublic

Authored by jasonbcox on Tue, Jun 11, 22:59.


Group Reviewers
Restricted Project

Updating seeds has been a pain point for releases for some time now.
In order to contribute to updating seeds reliably, a contributor must have
access to both mainnet and testnet seeders. This poses the following challenges:

  1. Contributors must be either:

    a) A sysadmin with the skills to setup their own seeder(s), or

    b) Given SSH access to a server by a sysadmin with the skills to setup their own seeder(s) and provide the appropriate security for a multi-user environment.
  2. The seeder(s) must be running for 2-4 weeks BEFORE updating seeds, making it difficult to pull in new contributors.

Adding this new script decouples the above problems from the process of updating the
seeds by providing a way for any contributor to update seeds without themselves needing
to setup seeders. This leaves 1.b for which I have setup and
will provide (in the future) a script and setup instructions to easily replicate for
other server hosts for additional redundancy.

Test Plan
cd contrib/seeds

# Fails with help message

# Works as expected

# Running a second time overwrites seeds_*.txt as expected

# Running from top-level (or some other directory) works as expected
cd ../..

# Simulate too-few nodes failure:
# 1. Comment out the `curl` line in
# 2. Open seeds_main.txt and remove all lines after line 99
# Skips mainnet seeds due to too few good nodes, but still completes

# 1. Comment out the `curl` line in
# 2. Open seeds_test.txt and remove all lines after line 9
# Skips testnet seeds due to too few good nodes, but still completes

# Simulate patch-mismatch failure:
# 1. Comment out the `makeseeds` line in
# 2. Open seeds_main.txt and/or seeds_test.txt and add a newline anywhere in the file
# Patch sanity check fails due to diff line mismatch

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 6357
Build 10761: Bitcoin ABC Teamcity Staging
Build 10760: arc lint + arc unit

Event Timeline

jasonbcox created this revision.Tue, Jun 11, 22:59
jasonbcox planned changes to this revision.Tue, Jun 11, 23:00

Still need to update docs, but looking for a concept ACK before continuing.

jasonbcox edited the summary of this revision. (Show Details)Tue, Jun 11, 23:08
jasonbcox updated this revision to Diff 9461.Fri, Jun 14, 22:00
  • Added sanity checks at various steps in the seed updating process
  • Added basic error checking
  • Added ability to skip one set of seeds if it fails

And a note about later improvements: Fabien and I talked about improving the
robustness of this script by pulling seeds from multiple seeders and merging
them. While this is still a good idea, I don't think it's necessary for MVP.

jasonbcox edited the test plan for this revision. (Show Details)Fri, Jun 14, 22:04
Fabien requested changes to this revision.Mon, Jun 24, 07:54
Fabien added a subscriber: Fabien.
Fabien added inline comments.

After the call to you can remove the $SEEDS_INPUT files.


git checkout HEAD -- ":/contrib/seeds/nodes_${1}.txt"


The script expects both file to be here, or fails. If you can't get both you should bail, or eventually create an empty nodes_xxx.txt.


Dito, use -- before the path for all the git checkout calls.

This revision now requires changes to proceed.Mon, Jun 24, 07:54