HomePhabricator

Introduce constant default variables to initialize seeder options

Description

Introduce constant default variables to initialize seeder options

Summary:
Introduces constant default variables for the seeder's parameters.
This will minimize the number of changes necessary if the default
parameters are ever in need of being changed and also paves the way
to replace CDnsSeedOpts with gArgs in a future diff.

Test Plan:

make
./src/bitcoin-seeder

This should output something like below:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
No nameserver set. Not starting DNS server.
Loading dnsseed.dat...done
Starting seeder...done
Starting 96 crawler threads...2019-10-14T22:11:22Z connect() to [2600:8806:8600:1d0:a5f0:9863:3144:6f16]:28333 failed: Cannot assign requested address (99)
...

This checks -w defaults to filtering 0x1,0x5,0x11,0x15, -t defaults to 96, --wipeban, --wipeignore, and --testnet default to false, and that -o, -i, -k, and -ns default to nullptr.

./src/bitcoin-seeder -n dev.bitframe.org

This should error out and print the following:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
No hostname set. Please use -h.

This checks that -h is defaulted to nullptr

./src/bitcoin-seeder -n dev.bitframe.org -h seeder.bitframe.org

This should error out and print the following:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
No e-mail address set. Please use -m.

This checks that -m is defaulted to nullptr.

./src/bitcoin-seeder -n dev.bitframe.org -h seeder.bitframe.org -m info@bitframe.org

This should output something like below:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
Loading dnsseed.dat...done
Starting 4 DNS threads for seeder.bitframe.org on dev.bitframe.org (port 53).......done
Starting seeder...done
Starting 96 crawler threads...2019-10-14T23:51:43Z connect() to [2600:8806:8600:1d0:a5f0:9863:3144:6f16]:28333 failed: Cannot assign requested address (99)
...

This checks -p is defaulted to 53 and -d is defaulted to 4.

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4250

Details

Provenance
nakihitoAuthored on Oct 14 2019, 19:53
nakihitoPushed on Oct 16 2019, 17:53
Reviewer
Restricted Owners Package
Differential Revision
D4250: Introduce constant default variables to initialize seeder options
Parents
rABC995338aa7108: Remove strlcpy.h
Branches
Unknown
Tags
Unknown