The '-blocksdir' startup option allows one to store blk*.dat on an
external disk, while keeping the index (blocks/index/) on the same disk.
This makes electrs aware of such an option, while still keeping the same
default behaviour (blk*.dat in '<config_dir>/blocks/').
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
After a recent switch to configure_me in ec049b9a, the 'mainnet'
arg value became 'bitcoin'. 2c50791d then updated db dir location
but the doc for the --network arg remained stale.
An alternative is to accept both 'mainnet' and 'bitcoin' but
it would be confusing IMHO.
This change allows the user to specify a custom cookie file, which is then
used instead of `~/.bitcoin/.cookie`. This resolves situations when the
user wants to have the cookie file in non-standard path.
Aside from that, the code now pre-computes the default path, improving
the performance by avoiding allocation (and copying). Unfortunately, due
to limitations of Rust, the code doesn't print out cookie configuration
anymore. This however might be safer, since the cookie isn't printed,
and thus doesn't end up in some readable logs by accident.
Closes#176Closes#189
Also, move TransactionCache into `cache` module.
Following https://github.com/romanz/electrs/pull/161 by @dagurval.
Co-authored-by: Dagur Valberg Johannsson <dagurval@pvv.ntnu.no>
The addresses weren't resolved in case of deserializing from config
file. Besides, resolving addresses in parsing/deserialization code would
make messy code (harder to read). This commit fixes both issues by
moving address resolution to post-processing stage.
Since use of configuration files is both mmore secure and more
convenient and clap doesn't support config files, this switches to
configure_me, which supports config files, env vars and also generating
man pages.
Closes#151