25 Commits

Author SHA1 Message Date
danda
0bc81d2382 chore: update for neptune-core betanet
updates some deps and one minor code change since uncle
blocks no longer occur.
2024-11-23 00:47:36 +00:00
danda
508f6ecc28 feat: add --smtp-port
Enables changing the smtp-port for alert emails.

Also enables two additional smtp modes: opportunistic and plaintext.
2024-05-28 15:39:46 -07:00
danda
938f12a943 docs: add note about pkg-config and libssl-dev 2024-05-28 13:06:59 -07:00
danda
ea2a21596d style: change logo image
Now uses neptune-logo-circle-small.png, which appears much cleaner
especially on dark theme.
2024-05-28 08:58:46 -07:00
danda
c2fe657e04 perf: replace RwLock with ArcSwap
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.
2024-05-27 17:24:01 -07:00
danda
71cf752b41 feat: add neptune-core rpc connection watchdog
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
2024-05-25 19:16:36 -07:00
danda
d99fe3ff84 feat: add --listen-port and rename --port
Changes:
 * adds --listen-port for specifying http port to listen on.
 * renames --port to --neptune-rpc-port which is clearer
 * updates README accordingly
2024-05-22 19:41:21 -07:00
danda
e4fda1a806 refactor: add anyhow, remove unwrap/expect
converts unwrap and expect calls in main.rs into anyhow .with_context()
calls to provide better error messages
2024-05-22 19:39:46 -07:00
danda
7dfe9366be doc: add README.md 2024-05-22 17:46:42 -07:00
danda
01906060ab doc: update and move design notes 2024-05-22 17:18:51 -07:00
danda
0c54b50b83 refactor: use wildcard paths, remove dup handlers
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
2024-05-22 17:18:51 -07:00
danda
6fedadab47 style: blue logo edges, better for dark theme
Previously the logo looked very jagged against a dark background.

This makes it look smooth for dark theme. However it is a bit blurry
against white background.

Hopefully can replace with a higher quality graphic soon.
2024-05-22 17:18:51 -07:00
danda
29834dbe50 feat: get rid of all javascript
implements a generic solution to redirect query strings generated by
forms to path based URIs that can be handled by existing routes.

This eliminates the need for javascript that was doing the equivalent
client-side.
2024-05-22 17:18:51 -07:00
danda
22f06180ae style: make text fit aqua color scheme
Uses a dark aqua for light theme and aqua for dark theme.
2024-05-22 17:18:51 -07:00
danda
df14092d61 feat: make site name configurable
Changes:
 + add Config::site_name, which defaults to "Neptune Explorer"
 + remove HeaderHtml::site_name
 + use Config::site_name in the html templates
2024-05-22 17:18:51 -07:00
danda
48966fa69d chore: include head html component in all pages
Moves common <head>..</head> tags into componenents/head.html and
includes it from all pages.

Common elements include: css files, favicon, meta tag(s)
2024-05-22 17:18:51 -07:00
danda
faf303bbdd feat: integrate team feedback
Changes:
 + present not-found page for unhandled uri paths, eg /stuff
 + display the tip-height on front page
 + add favicon and neptune logo to front page
 + use ServerDir instead of ServeFile for /image and /css
 + add help tooltips for fields on front page
 + use monospace font for digests
2024-05-22 17:18:51 -07:00
danda
d7d1778fea fix: add missing files 2024-05-22 17:18:51 -07:00
danda
ac27329bda chore: update to neptune-core tip
adapts to some changes in neptune-core.

BlockInfo and BlockSelector location changed.
2024-05-22 17:18:50 -07:00
danda
0f9cbdf0b4 feat: pico css styling and not-found page.
Changes:

 1. integrates pico minimal responsive css framework for light/dark
    themes and overall better looks.

 2. adds a not-found page for bad url queries.

 3. catches axum/serde deserialization errors of user input and routes
    them to the not-found page with a helpful hint (parse error msg)
2024-05-22 17:18:50 -07:00
danda
e53d80d9fa chore: move src/web --> templates/web 2024-05-22 17:18:50 -07:00
danda
7fa11f3ec2 refactor: break main.rs into separate files 2024-05-22 17:18:50 -07:00
danda
4509b1f9a6 feat: add boilerplate templates, utxo page 2024-05-22 17:18:50 -07:00
danda
951758902a initial commit of neptune-explorer files 2024-05-22 17:18:46 -07:00
dan-da
90fe0449df chore: add LICENSE file, apache 2.0 from github 2024-05-22 17:18:45 -07:00