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
We use axum route wildcards to merge duplicate page routes and handlers
into a single route and handler.
This makes the routes simpler/cleaner as well as the handlers, as there
is now just one of each for each html page.
Previous:
.route("/block/:selector", get(block_page))
.route("/block/:selector/value", get(block_page_with_value))
New:
.route("/block/*selector", get(block_page))
This is achieved by replacing PathBlockSelector with
BlockSelectorExtended which wraps BlockSelector to provide parsing for
height_or_digest/value. (which is needed for javascript-free input
form)
Changes:
* merge dup handlers for each of block, block_digest, block_info
* merge routes for same
* add BlockSelectorExtended and HeightOrDigest
* remove PathBlockSelector