Installation_id and node_id are stored in the data dir.
For this reason they should be read/created only after the
config has been parsed.
This way they can be retrieved or stored at the right location.
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
When starting a daemon with a different configuration,
the same should also be used by the cli tool.
Add the --conf flag to the cli command to allow using a
custom config file.
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Periodically check if the routing table is empty and, if so,
re-attempt joining the DHT network.
This check is performed in the main DHTPeerFinder loop every 60 secs.
Closes: #1093
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
This method can be used by other components to check
if in the Node routing table there is at least one peer.
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
In order to attempt to join the DHT several times
(i.e. when the first attempt has failed) we need to
split the components initialization from the real
joining operation.
Create node.startNetwork() to initialize the node
and keep the rest in node.joinNetwork()
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
The config file might be stores in an alternate location for several
reasons (i.e. testing different configs or running multiple nodes on the
same host). Make the config file a CLI parameter so that it can be
specified when launching the lbrynet-daemon.
Related to #1039
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
Sometimes it might be helpful to check if a given config
setting is still the default or if it was touched by the user
in any way (e.g. env, config file, ...).
Add is_default() method to Config object to perform such check.
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>