Whenever an `Announcement` is parsed as transparent transaction info, we obtain
information about the UTXOs involved in that transaction. It would be nice to
display this information when we look up the UTXO, but there is no way to query
it from neptune-core.
This commit caches that information in order to display it.
Specifically, it extends `AppState` with a (smart pointer to) vector of
`TransparentUtxoInfo` (a new type). The vector, or its existing entries, are
extended with new information when it becomes available.
At this point the vector is rather silly because it is not persisted, and the
app reboots more often than not, resulting in a clear cache. A future commit
will persist this data.
Adds a 'Canonical' field to the /block page.
note: this requires updating neptune-core in order to obtain the field
from neptune-core's /block_info rpc endpoint.
it was also necessary to change 'use neptune_core::<x>" statements to
'use neptune_cash::<x>'
ArcSwap is lock-free and optimized for our use-case of lots of
concurrent reads and infrequent updates.
So it is pretty close to a shared-nothing architecture.
Some small changes were necessary, but its mostly a drop-in
replacement for RwLock.
closes#1
Implements a background watchdog task that:
1. calls neptune-core /network rpc every N seconds (default: 10)
2. emits log message on any state change
3. sends detailed email alert to admin on any state change
Changes:
* AppState now has internal Arc<RwLock<AppStateInner>> to permit
watchdog task to mutate the rpc_client field.
* adjust application to AppState changes (use locks)
* not_found functions no longer accept state arg
* move state initialization into AppState::init()
* add optional alert parameters: admin-email, smtp-*
* add neptune_rpc module with watchdog task
* add alert_email module
* simplify main()
* log warnings if alert parameters not set
* add chrono dep
* add lettre dep