Page MenuHomePhabricator

Added a script to test seeds
Needs ReviewPublic

Authored by jasonbcox on Tue, Aug 6, 19:01.


Group Reviewers
Restricted Project

We need an automateable way to test seeds. This script takes in nodes_<main|test>.txt and outputs peers that
it successfully connected to.

This script is useful for verifying that newly added seeds are viable.

This script may also be used to determine general "health" of the seeds list by calculating the fraction of nodes
that can be successfully connected to at any point in time:

TOTAL=$(cat nodes_main.txt | wc -l)
NUM=$(./ < nodes_main.txt | wc -l)
echo "scale=3; $NUM / $TOTAL" | bc

With additional automation, the seeds could be updated automatically whenever the above fraction drops below
a certain threshold. More testing will be necessary to pick a sane number.

Test Plan

Assuming build is available at <project>/build:

cd contrib/seeds
./ -h
./ < nodes_main.txt
./ --testnet < nodes_test.txt

Diff Detail

rABC Bitcoin ABC
Lint OK
No Unit Test Coverage
Build Status
Buildable 7071
Build 12188: Bitcoin ABC Teamcity Staging
Build 12187: arc lint + arc unit

Event Timeline

jasonbcox created this revision.Tue, Aug 6, 19:01
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Aug 6, 19:01
Fabien requested changes to this revision.Wed, Aug 7, 08:54
Fabien added a subscriber: Fabien.
Fabien added inline comments.
47 ↗(On Diff #10638)

You can check that the binaries exist before using them, that will allow for a better error message.

92 ↗(On Diff #10638)

You should consider some kind of wait_until() function to avoid all the sleeps and have a more reliable test.

This revision now requires changes to proceed.Wed, Aug 7, 08:54
jasonbcox updated this revision to Diff 10657.Wed, Aug 7, 20:14

Fixed binaries checks and wait-for behavior