as the number of applications grows it makes more sense to separate
the 'server' library from the actually reusable libraries.
To recap, the 'server' library is what we started with when importing
all the code from the hub. Slowly we are moving good code out that
is stand-alone and reusable.
We inherited the design from Core that you can put in your config
file which chain you will follow (testnet, regtest).
This has the effect that you can't have different config files for
different chains and that we always read the fallback location for
all chains. Especially the last one is just harmful.
So, regtest/testnet can only be selected from commandline.
If you choose one of those, it will look for a flowee.conf in the
related subdir (flowee/regtest/flowee.conf for instance) and NOT
for the global one. The global one is only ever read for mainnet.
Actually delete the asio io_service when we are done with it since that
will delete any left over tasks in the queue.
This makes deletion order more predictable.
So, now we install the example config file
Then we follow XDG for retrieving it.
We first check XDG_CONFIG (~/.config/flowee) and if we can't find a confg
file there fall back to the data dir (~/.local/share/flowee).
So the service only noticed new stuff happening, like a transaction
coming in or block being mined.
With this change we get a little smarter and look in the current mempool
as well to try and match a transaction.
This should be very useful for clients that lose network connection
briefly.
This service allows one to connect it and register any number of
bitcoin-addresses which will then cause any transaction or block
coming in the future lead the subscriber to get notified about
such events.
The change signifies that the server is not just for admin purposes it
will become the preferred way for all subnet-local interactions.
Notice that we still have the JSON based RPC protocol as fallback.