neptune-explorer/README.md

68 lines
2.4 KiB
Markdown
Raw Normal View History

2024-05-22 17:46:42 -07:00
# neptune-explorer
A web-based block explorer for the [Neptune Cash blockchain](https://neptune.cash). neptune-explorer provides a basic HTML view and a REST RPC API.
2024-05-22 17:46:42 -07:00
As of 2024-05-22 this code is running at https://explorer.neptune.cash.
Some [design notes](./doc/design_notes.md) are available.
## Installing
### Compile from Source -- Linux Debian/Ubuntu
You may need to:
```
sudo apt install pkg-config libssl-dev
```
Then
2024-05-22 17:46:42 -07:00
```
2025-11-27 13:59:19 +07:00
git clone https://github.com/neptuneprivacy/neptune-explorer.git
2024-05-22 17:46:42 -07:00
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
2025-11-27 13:59:19 +07:00
1. install [xnt-core](https://github.com/neptuneprivacy/xnt-core) and start it, or otherwise find a running xnt-core instance.
2024-05-22 17:46:42 -07:00
2. start neptune-explorer
```
nohup neptune-explorer --site-domain testdomain 2>&1 > /path/to/logs/neptune-explorer.log &
2024-05-22 17:46:42 -07:00
```
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.
* Site domain *must* be specified with the `--site-domain` flag.
2024-05-22 17:46:42 -07:00
## Connecting via Browser
Just navigate to http://localhost:3000/
feat: Add Announcement viewer Every transaction can have zero or more announcements, which are essentially messages that must be included across all future mergers and updates. Announcements are typically used for transmitting information related to receiving UTXOs, encrypted. However, a new use case is that of *transparent transaction info*, which is an announcement containing the UTXOs and the commitment randomnesses needed to reproduce the transaction's inputs and outputs. With such a transparent transaction info announcement, third parties can transparently audit transactions. This commit adds a page for viewing announcements, and if the announcement can be parsed as a transparent transaction info type announcement then it is rendered as such, complete with native currency amounts and linkable UTXOs (where possible). The path for accessing announcements is any of - `/announcement/digest/<hex-string>/<index>` - `/announcement/tip/<index>` - `/announcement/genesis/<index>` - `/announcement/height/<height>/<index>` - `/announcement/height_or_digest/<height-or-diges>/index/<index>`. The last bullet point exists to support the quick lookup functionality, which is also new. A `AnnouncementSelector` has display and from-string methods relating these path formats to the relevant object. A suite of (prop)tests verifies parsing. Also, this commit enables mocking, which is useful when the neptune-core node the explorer is connected to is outdated, unsynced, or for whatever reason does not serve the desired data. The RPC client call is intercepted, and if it fails and mocking is enabled, an imagined (pseudorandom) resource of the requested type is returned. To enable mocking, compile with the "mock" feature flag and set the "MOCK" environment variable.
2025-08-12 18:21:27 +02:00
## Mocking
When connected to an out-of-date or unsynced neptune-core node, it might be a good idea to turn on mocking so that whenever a resource is unavailable, a random one is generated and returned. To do this, compile with the feature flag "mock" and make sure that the "MOCK" environment variable is set.
In one command: `MOCK=1 cargo run --features "mock" -- --site-domain testdomain`
2024-05-22 17:46:42 -07:00
## 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`.