Skip to content

Seeder: Seed the database with fixed seed IPs

Axel Gembe requested to merge ago/bitcoin-cash-node:seeder_fixed_seeds into master

Summary

When the database has no addresses the seeder will not work if there are no other DNS seeds online. To fix this, we seed the database with the seeds from CChainParams::FixedSeeds if no addresses are found.

This also adds a new command line argument -reseed to the seeder which causes the seeder to add the static seeds to the database on each startup.

This depends on Refactor: Make SeedSpec6 inherit from CService (and ultimately CNetAddr), which is included in this MR.

fixes #240 (closed)

Test plan

  • ninja check
  • Remove all the mainnet seeds from chainparams.cpp:183
  • ninja
  • Run the seeder for mainnet:
  • mkdir seeder_test && cd seeder_test
  • path/to/bitcoin-seeder -host=seed.bch.loping.net -ns=iris.loping.net -mbox=derago.gmail.com -port=5353
  • The seeder should show x/y available after a while, where x should be > 0

Note added by Calin: DO NOT SQUASH

Edited by Axel Gembe

Merge request reports