Edit `CTestNetParams` in `chainparams.cpp` to have `vSeeds.emplace_back("localhost");` as the only seed.
After each case remove the `dnsseed.dat`, `dnsseed.dump`, and `dnsstats.log` files from the directory you run `bitcoin-seeder` from if there are any. If you don't the seeder will not connect with the local host node right away.Build + unit tests:
ninja bitcoin-seeder check-seeder
Manual tests:
cd build/src
Between each test, cleanup seeder files with:
rm dns*
(1) IBD:
mkdir ibddir
./bitcoind --testnet -debug=testnet -datadir=ibddir
Let the node run for a while to begin IBD.
./bitcoin-seeder -host=localhost -ns=blah.bitframe.org -port=8888 -mbox=info@bitframe.org --testnet --wipeban --wipeignore
The seeder should attempt to connect to the localhost node.
0/726 available (2 tried in 0s, 676 new, 48 active), 0 banned; 0 DNS requests, 0 db queries
The output should be something similar to the above after receiving addrs.
(2) Up-to-date chain:
./bitcoind --testnet -whitelist=127.0.0.1 -listen=1 -connect=0 -debug=net
./bitcoin-seeder -host=localhost -ns=blah.bitframe.orglocalhost -port=8888 -mbox=infonoemail@bitframecoinabc.org --testnet --wipeban --wipeignore
Output from the seeder should be similar to:
0/684 available (2 tried in 1s, 639 new, 43 active), 0 banned; 0 DNS requests, 0 db queries
If you leave the seeder running for long enough, the node's information should appear in `dnsseed.dump`
(3) Incomplete chain:
./bitcoind --testnet -whitelist=127.0.0.1 -listen=1 -connect=0 -debug=net
./bitcoin-cli invalidateblock <hash of the block before the most recent checkpoint>
./bitcoin-seeder -host=localhost -ns=blah.bitframe.orglocalhost -port=8888 -mbox=infonoemail@bitframecoinabc.org --testnet --wipeban --wipeignore
0/722 available (2 tried in 1s, 672 new, 48 active), 0 banned; 0 DNS requests, 0 db queries
The output should be something similar as above, specifically there should still be `0 banned`, the number of `tried` should have increased, and the number of available should have increased.
(4) Wrong chain:
./bitcoind --testnet -whitelist=127.0.0.1 -listen=1 -connect=0 -debug=net
./bitcoin-cli invalidateblock <hash of the most recent checkpoint>
./bitcoin-seeder -host=localhost -ns=blah.bitframe.orglocalhost -port=8888 -mbox=infonoemail@bitframecoinabc.org --testnet --wipeban --wipeignore
0/722 available (2 tried in 1s, 672 new, 48 active), 0 banned; 0 DNS requests, 0 db queries