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
2024-05-22 17:18:51 -07:00

neptune-explorer

A web-based block explorer for the Neptune blockchain. neptune-explorer provides a basic HTML view and a REST RPC API.

As of 2024-05-22 this code is running at https://explorer.neptune.cash.

Some design notes are available.

Installing

Compile from Source -- Linux Debian/Ubuntu

git clone https://github.com/Neptune-Crypto/neptune-explorer.git
cd neptune-explorer
cargo install --locked --path .

Windows, Mac

not tested or supported. Please let us know if you get it work. patches accepted.

Running

  1. install neptune-core and start it, or otherwise find a running neptune-core instance.
  2. start neptune-explorer
nohup neptune-explorer 2>&1 > /path/to/logs/neptune-explorer.log &

Notes:

  • The block-explorer automatically uses the same network (mainnet, testnet, etc) as the neptune-core instance it is connected to, and the network is displayed in the web interface.
  • If neptune-core RPC server is running on a non-standard port, you can provide it with the --neptune-rpc-port flag.
  • neptune-explorer listens for http requests on port 3000 by default. This can be changed with the --listen-port flag.
  • Site name can be specified with the --site-name flag.

Connecting via Browser

Just navigate to http://localhost:3000/

SSL/TLS, Nginx, etc.

If hosting for public use, it is suggested to use nginx or similar in reverse-proxy mode to connect to http://localhost:3000. Nginx can then handle SSL/TLS certs and connections, as neptune-explorer has no built-in support for that.

Logging

All logging is output to standard out.

The log level can be set through the environment variable RUST_LOG. Valid values are: trace, debug, info, warn, and error. The default value is info. E.g.: RUST_LOG=trace cargo run.

Description
No description provided
Readme 424 KiB
Languages
Rust 75.5%
HTML 22.1%
CSS 2.4%