Compare commits
3 Commits
master
...
minh/custo
| Author | SHA1 | Date | |
|---|---|---|---|
| 36056fd59c | |||
| f63dbd7d6f | |||
| 257330cc1b |
112
Cargo.lock
generated
112
Cargo.lock
generated
@ -1927,9 +1927,47 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "neptune-cash"
|
name = "neptune-explorer"
|
||||||
version = "0.4.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=71f471a526a13ddd41ab4400e1a873471d03ede6#71f471a526a13ddd41ab4400e1a873471d03ede6"
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"arbitrary",
|
||||||
|
"arc-swap",
|
||||||
|
"axum 0.7.9",
|
||||||
|
"blake3",
|
||||||
|
"boilerplate",
|
||||||
|
"chrono",
|
||||||
|
"clap",
|
||||||
|
"derive_more",
|
||||||
|
"env_logger",
|
||||||
|
"futures",
|
||||||
|
"html-escaper",
|
||||||
|
"indexmap 2.12.0",
|
||||||
|
"lettre",
|
||||||
|
"log",
|
||||||
|
"neptune-privacy",
|
||||||
|
"proptest",
|
||||||
|
"proptest-arbitrary-interop",
|
||||||
|
"rand 0.9.2",
|
||||||
|
"readonly",
|
||||||
|
"regex",
|
||||||
|
"reqwest",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tarpc",
|
||||||
|
"test-strategy",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"tokio",
|
||||||
|
"tower-http 0.5.2",
|
||||||
|
"tracing",
|
||||||
|
"tracing-subscriber",
|
||||||
|
"url",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "neptune-privacy"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/neptuneprivacy/xnt-core?rev=9afe0af60097454a39c21d009669bb6af74f7839#9afe0af60097454a39c21d009669bb6af74f7839"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aead",
|
"aead",
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
@ -1953,7 +1991,6 @@ dependencies = [
|
|||||||
"itertools 0.11.0",
|
"itertools 0.11.0",
|
||||||
"leveldb-sys",
|
"leveldb-sys",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"neptune-rpc-macros",
|
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"num-rational",
|
"num-rational",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@ -1985,57 +2022,10 @@ dependencies = [
|
|||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"tracing-test",
|
"tracing-test",
|
||||||
|
"xnt-rpc-macros",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "neptune-explorer"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"anyhow",
|
|
||||||
"arbitrary",
|
|
||||||
"arc-swap",
|
|
||||||
"axum 0.7.9",
|
|
||||||
"blake3",
|
|
||||||
"boilerplate",
|
|
||||||
"chrono",
|
|
||||||
"clap",
|
|
||||||
"derive_more",
|
|
||||||
"env_logger",
|
|
||||||
"futures",
|
|
||||||
"html-escaper",
|
|
||||||
"indexmap 2.12.0",
|
|
||||||
"lettre",
|
|
||||||
"log",
|
|
||||||
"neptune-cash",
|
|
||||||
"proptest",
|
|
||||||
"proptest-arbitrary-interop",
|
|
||||||
"rand 0.9.2",
|
|
||||||
"readonly",
|
|
||||||
"regex",
|
|
||||||
"reqwest",
|
|
||||||
"serde",
|
|
||||||
"serde_json",
|
|
||||||
"tarpc",
|
|
||||||
"test-strategy",
|
|
||||||
"thiserror 1.0.69",
|
|
||||||
"tokio",
|
|
||||||
"tower-http 0.5.2",
|
|
||||||
"tracing",
|
|
||||||
"tracing-subscriber",
|
|
||||||
"url",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "neptune-rpc-macros"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=71f471a526a13ddd41ab4400e1a873471d03ede6#71f471a526a13ddd41ab4400e1a873471d03ede6"
|
|
||||||
dependencies = [
|
|
||||||
"convert_case",
|
|
||||||
"quote",
|
|
||||||
"syn 2.0.108",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "new_mime_guess"
|
name = "new_mime_guess"
|
||||||
version = "4.0.4"
|
version = "4.0.4"
|
||||||
@ -3017,9 +3007,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_tuple"
|
name = "serde_tuple"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "52569c5296679bd28e2457f067f97d270077df67da0340647da5412c8eac8d9e"
|
checksum = "6af196b9c06f0aa5555ab980c01a2527b0f67517da8d68b1731b9d4764846a6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_tuple_macros",
|
"serde_tuple_macros",
|
||||||
@ -3027,9 +3017,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_tuple_macros"
|
name = "serde_tuple_macros"
|
||||||
version = "1.1.2"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2f46c707781471741d5f2670edb36476479b26e94cf43efe21ca3c220b97ef2e"
|
checksum = "ec3a1e7d2eadec84deabd46ae061bf480a91a6bce74d25dad375bd656f2e19d8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -4539,6 +4529,16 @@ version = "0.6.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
|
checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xnt-rpc-macros"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/neptuneprivacy/xnt-core?rev=9afe0af60097454a39c21d009669bb6af74f7839#9afe0af60097454a39c21d009669bb6af74f7839"
|
||||||
|
dependencies = [
|
||||||
|
"convert_case",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.108",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "yoke"
|
name = "yoke"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
|||||||
@ -24,7 +24,7 @@ tokio = { version = "1.48.0", features = ["full", "tracing"] }
|
|||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = "0.3"
|
||||||
|
|
||||||
neptune-cash = "0.4.0"
|
neptune-privacy = "0.1.0"
|
||||||
tarpc = { version = "^0.34", features = [
|
tarpc = { version = "^0.34", features = [
|
||||||
"tokio1",
|
"tokio1",
|
||||||
"serde-transport",
|
"serde-transport",
|
||||||
@ -64,7 +64,7 @@ arbitrary = "1.4.2"
|
|||||||
proptest-arbitrary-interop = "0.1.0"
|
proptest-arbitrary-interop = "0.1.0"
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
neptune-cash = { git = "https://github.com/Neptune-Crypto/neptune-core.git", rev = "71f471a526a13ddd41ab4400e1a873471d03ede6" }
|
neptune-privacy = { git = "https://github.com/neptuneprivacy/xnt-core", rev = "9afe0af60097454a39c21d009669bb6af74f7839" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
mock = ["dep:blake3", "dep:rand"]
|
mock = ["dep:blake3", "dep:rand"]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# neptune-explorer
|
# 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.
|
A web-based block explorer for the [Neptune Privacy blockchain](https://neptune.cash). 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.
|
As of 2024-05-22 this code is running at https://explorer.neptune.cash.
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ sudo apt install pkg-config libssl-dev
|
|||||||
Then
|
Then
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/Neptune-Crypto/neptune-explorer.git
|
git clone https://github.com/neptuneprivacy/neptune-explorer.git
|
||||||
cd neptune-explorer
|
cd neptune-explorer
|
||||||
cargo install --locked --path .
|
cargo install --locked --path .
|
||||||
```
|
```
|
||||||
@ -30,7 +30,7 @@ not tested or supported. Please let us know if you get it work. patches accep
|
|||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
1. install [neptune-core](https://github.com/Neptune-Crypto/neptune-core) and start it, or otherwise find a running neptune-core instance.
|
1. install [xnt-core](https://github.com/neptuneprivacy/xnt-core) and start it, or otherwise find a running xnt-core instance.
|
||||||
2. start neptune-explorer
|
2. start neptune-explorer
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
@ -8,11 +8,11 @@ use axum::response::Html;
|
|||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use html_escaper::Escape;
|
use html_escaper::Escape;
|
||||||
use html_escaper::Trusted;
|
use html_escaper::Trusted;
|
||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use neptune_cash::prelude::tasm_lib::prelude::Digest;
|
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
|
||||||
use neptune_cash::prelude::triton_vm::prelude::BFieldCodec;
|
use neptune_privacy::prelude::triton_vm::prelude::BFieldCodec;
|
||||||
use neptune_cash::prelude::twenty_first::tip5::Tip5;
|
use neptune_privacy::prelude::twenty_first::tip5::Tip5;
|
||||||
use neptune_cash::util_types::mutator_set::addition_record::AdditionRecord;
|
use neptune_privacy::util_types::mutator_set::addition_record::AdditionRecord;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::html::component::header::HeaderHtml;
|
use crate::html::component::header::HeaderHtml;
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use axum::response::Html;
|
|||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use html_escaper::Escape;
|
use html_escaper::Escape;
|
||||||
use html_escaper::Trusted;
|
use html_escaper::Trusted;
|
||||||
use neptune_cash::protocol::consensus::block::block_info::BlockInfo;
|
use neptune_privacy::protocol::consensus::block::block_info::BlockInfo;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::html::component::header::HeaderHtml;
|
use crate::html::component::header::HeaderHtml;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use axum::extract::State;
|
|||||||
use axum::response::Html;
|
use axum::response::Html;
|
||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use html_escaper::Escape;
|
use html_escaper::Escape;
|
||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::html::page::not_found::not_found_html_response;
|
use crate::html::page::not_found::not_found_html_response;
|
||||||
|
|||||||
@ -7,8 +7,8 @@ use axum::response::Html;
|
|||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use html_escaper::Escape;
|
use html_escaper::Escape;
|
||||||
use html_escaper::Trusted;
|
use html_escaper::Trusted;
|
||||||
use neptune_cash::api::export::Tip5;
|
use neptune_privacy::api::export::Tip5;
|
||||||
use neptune_cash::prelude::tasm_lib::prelude::Digest;
|
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::html::component::header::HeaderHtml;
|
use crate::html::component::header::HeaderHtml;
|
||||||
|
|||||||
@ -2,7 +2,7 @@ use axum::http::StatusCode;
|
|||||||
use axum::response::Html;
|
use axum::response::Html;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use neptune_cash::application::rpc::server::error::RpcError;
|
use neptune_privacy::application::rpc::server::error::RpcError;
|
||||||
use tarpc::client::RpcError as TarpcError;
|
use tarpc::client::RpcError as TarpcError;
|
||||||
|
|
||||||
// note: http StatusCodes are defined at:
|
// note: http StatusCodes are defined at:
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use neptune_cash::prelude::tasm_lib::prelude::Digest;
|
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorLiteral;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorLiteral;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Deserializer;
|
use serde::Deserializer;
|
||||||
@ -35,13 +35,13 @@ pub enum AnnouncementSelectorParseError {
|
|||||||
#[error("error parsing index for announcement in block {0}: {1}")]
|
#[error("error parsing index for announcement in block {0}: {1}")]
|
||||||
HeightIndex(BlockHeight, std::num::ParseIntError),
|
HeightIndex(BlockHeight, std::num::ParseIntError),
|
||||||
#[error("error parsing digest: {0}")]
|
#[error("error parsing digest: {0}")]
|
||||||
BlockDigest(neptune_cash::prelude::twenty_first::error::TryFromHexDigestError),
|
BlockDigest(neptune_privacy::prelude::twenty_first::error::TryFromHexDigestError),
|
||||||
#[error("error parsing index for announcement in block {0}: {1}")]
|
#[error("error parsing index for announcement in block {0}: {1}")]
|
||||||
DigestIndex(Digest, std::num::ParseIntError),
|
DigestIndex(Digest, std::num::ParseIntError),
|
||||||
#[error("error parsing block-height-or-digest: {0} / {1}")]
|
#[error("error parsing block-height-or-digest: {0} / {1}")]
|
||||||
HeightNorDigest(
|
HeightNorDigest(
|
||||||
std::num::ParseIntError,
|
std::num::ParseIntError,
|
||||||
neptune_cash::prelude::twenty_first::error::TryFromHexDigestError,
|
neptune_privacy::prelude::twenty_first::error::TryFromHexDigestError,
|
||||||
),
|
),
|
||||||
#[error("error parsing index for block-height-or-digest {0}: {1}")]
|
#[error("error parsing index for block-height-or-digest {0}: {1}")]
|
||||||
HeightOrDigestIndex(BlockSelector, std::num::ParseIntError),
|
HeightOrDigestIndex(BlockSelector, std::num::ParseIntError),
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
use neptune_cash::api::export::Announcement;
|
use neptune_privacy::api::export::Announcement;
|
||||||
use neptune_cash::api::export::TransparentTransactionInfo;
|
use neptune_privacy::api::export::TransparentTransactionInfo;
|
||||||
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
|
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum AnnouncementType {
|
pub enum AnnouncementType {
|
||||||
|
|||||||
@ -3,10 +3,10 @@ use std::sync::Arc;
|
|||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use arc_swap::ArcSwap;
|
use arc_swap::ArcSwap;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use neptune_cash::api::export::Network;
|
use neptune_privacy::api::export::Network;
|
||||||
use neptune_cash::application::rpc::auth;
|
use neptune_privacy::application::rpc::auth;
|
||||||
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
use neptune_privacy::prelude::twenty_first::tip5::Digest;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::{
|
use neptune_privacy::protocol::consensus::block::block_selector::{
|
||||||
BlockSelector, BlockSelectorLiteral,
|
BlockSelector, BlockSelectorLiteral,
|
||||||
};
|
};
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
use std::num::ParseIntError;
|
use std::num::ParseIntError;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use neptune_cash::api::export::Digest;
|
use neptune_privacy::api::export::Digest;
|
||||||
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
|
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorParseError;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorParseError;
|
||||||
use serde::de::Error;
|
use serde::de::Error;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Deserializer;
|
use serde::Deserializer;
|
||||||
|
|||||||
@ -31,7 +31,7 @@ pub struct Config {
|
|||||||
pub listen_port: u16,
|
pub listen_port: u16,
|
||||||
|
|
||||||
/// Sets the neptune-core rpc server address to connect to.
|
/// Sets the neptune-core rpc server address to connect to.
|
||||||
#[clap(long, default_value = "9799", value_name = "port")]
|
#[clap(long, default_value = "9899", value_name = "port")]
|
||||||
pub neptune_rpc_port: u16,
|
pub neptune_rpc_port: u16,
|
||||||
|
|
||||||
/// Sets interval in seconds to ping neptune-core rpc connection
|
/// Sets interval in seconds to ping neptune-core rpc connection
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use neptune_cash::prelude::tasm_lib::prelude::Digest;
|
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorParseError;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorParseError;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
use neptune_cash::api::export::AdditionRecord;
|
use neptune_privacy::api::export::AdditionRecord;
|
||||||
use neptune_cash::api::export::Digest;
|
use neptune_privacy::api::export::Digest;
|
||||||
use neptune_cash::api::export::TransparentInput;
|
use neptune_privacy::api::export::TransparentInput;
|
||||||
use neptune_cash::api::export::Utxo;
|
use neptune_privacy::api::export::Utxo;
|
||||||
use neptune_cash::api::export::UtxoTriple;
|
use neptune_privacy::api::export::UtxoTriple;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct TransparentUtxoTuple {
|
pub struct TransparentUtxoTuple {
|
||||||
|
|||||||
@ -7,18 +7,18 @@ use chrono::DateTime;
|
|||||||
use chrono::TimeDelta;
|
use chrono::TimeDelta;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use neptune_cash::api::export::Announcement;
|
use neptune_privacy::api::export::Announcement;
|
||||||
use neptune_cash::api::export::Network;
|
use neptune_privacy::api::export::Network;
|
||||||
use neptune_cash::application::config::data_directory::DataDirectory;
|
use neptune_privacy::application::config::data_directory::DataDirectory;
|
||||||
use neptune_cash::application::rpc::auth;
|
use neptune_privacy::application::rpc::auth;
|
||||||
use neptune_cash::application::rpc::server::error::RpcError;
|
use neptune_privacy::application::rpc::server::error::RpcError;
|
||||||
use neptune_cash::application::rpc::server::RPCClient;
|
use neptune_privacy::application::rpc::server::RPCClient;
|
||||||
use neptune_cash::application::rpc::server::RpcResult;
|
use neptune_privacy::application::rpc::server::RpcResult;
|
||||||
use neptune_cash::prelude::tasm_lib::prelude::Digest;
|
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
|
||||||
use neptune_cash::protocol::consensus::block::block_height::BlockHeight;
|
use neptune_privacy::protocol::consensus::block::block_height::BlockHeight;
|
||||||
use neptune_cash::protocol::consensus::block::block_info::BlockInfo;
|
use neptune_privacy::protocol::consensus::block::block_info::BlockInfo;
|
||||||
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
|
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
|
||||||
use neptune_cash::util_types::mutator_set::addition_record::AdditionRecord;
|
use neptune_privacy::util_types::mutator_set::addition_record::AdditionRecord;
|
||||||
use tarpc::client;
|
use tarpc::client;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
use tarpc::tokio_serde::formats::Json as RpcJson;
|
use tarpc::tokio_serde::formats::Json as RpcJson;
|
||||||
@ -146,8 +146,8 @@ impl AuthenticatedClient {
|
|||||||
#[cfg(feature = "mock")]
|
#[cfg(feature = "mock")]
|
||||||
if std::env::var(MOCK_KEY).is_ok() {
|
if std::env::var(MOCK_KEY).is_ok() {
|
||||||
use blake3::Hasher;
|
use blake3::Hasher;
|
||||||
use neptune_cash::api::export::TransparentTransactionInfo;
|
use neptune_privacy::api::export::TransparentTransactionInfo;
|
||||||
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
|
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
|
||||||
use rand::rngs::StdRng;
|
use rand::rngs::StdRng;
|
||||||
use rand::Rng;
|
use rand::Rng;
|
||||||
use rand::SeedableRng;
|
use rand::SeedableRng;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
use neptune_privacy::prelude::twenty_first::tip5::Digest;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::http_util::not_found_err;
|
use crate::http_util::not_found_err;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use neptune_cash::protocol::consensus::block::block_info::BlockInfo;
|
use neptune_privacy::protocol::consensus::block::block_info::BlockInfo;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::http_util::not_found_err;
|
use crate::http_util::not_found_err;
|
||||||
|
|||||||
@ -4,9 +4,9 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use neptune_cash::application::rpc::server::error::RpcError;
|
use neptune_privacy::application::rpc::server::error::RpcError;
|
||||||
use neptune_cash::application::rpc::server::proof_of_work_puzzle::ProofOfWorkPuzzle;
|
use neptune_privacy::application::rpc::server::proof_of_work_puzzle::ProofOfWorkPuzzle;
|
||||||
use neptune_cash::state::wallet::address::generation_address::GenerationReceivingAddress;
|
use neptune_privacy::state::wallet::address::generation_address::GenerationReceivingAddress;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::http_util::not_found_err;
|
use crate::http_util::not_found_err;
|
||||||
|
|||||||
@ -3,8 +3,8 @@ use std::sync::Arc;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use axum::response::Response;
|
use axum::response::Response;
|
||||||
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
use neptune_privacy::prelude::twenty_first::tip5::Digest;
|
||||||
use neptune_cash::protocol::consensus::block::block_header::BlockPow;
|
use neptune_privacy::protocol::consensus::block::block_header::BlockPow;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use axum::extract::Path;
|
|||||||
use axum::extract::State;
|
use axum::extract::State;
|
||||||
use axum::response::IntoResponse;
|
use axum::response::IntoResponse;
|
||||||
use axum::response::Json;
|
use axum::response::Json;
|
||||||
use neptune_cash::prelude::twenty_first::tip5::Digest;
|
use neptune_privacy::prelude::twenty_first::tip5::Digest;
|
||||||
use tarpc::context;
|
use tarpc::context;
|
||||||
|
|
||||||
use crate::http_util::not_found_err;
|
use crate::http_util::not_found_err;
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
use neptune_cash::api::export::BlockHeight;
|
use neptune_privacy::api::export::BlockHeight;
|
||||||
use neptune_cash::api::export::NativeCurrencyAmount;
|
use neptune_privacy::api::export::NativeCurrencyAmount;
|
||||||
use neptune_cash::protocol::consensus::block::block_height::BLOCKS_PER_GENERATION;
|
use neptune_privacy::protocol::consensus::block::block_height::BLOCKS_PER_GENERATION;
|
||||||
use neptune_cash::protocol::consensus::block::block_height::NUM_BLOCKS_SKIPPED_BECAUSE_REBOOT;
|
use neptune_privacy::protocol::consensus::block::Block;
|
||||||
use neptune_cash::protocol::consensus::block::Block;
|
use neptune_privacy::protocol::consensus::block::PREMINE_MAX_SIZE;
|
||||||
use neptune_cash::protocol::consensus::block::PREMINE_MAX_SIZE;
|
|
||||||
|
|
||||||
/// Return the pair (liquid supply, total supply)
|
/// Return the pair (liquid supply, total supply)
|
||||||
///
|
///
|
||||||
@ -13,10 +12,9 @@ pub(crate) fn monetary_supplies(
|
|||||||
) -> (NativeCurrencyAmount, NativeCurrencyAmount) {
|
) -> (NativeCurrencyAmount, NativeCurrencyAmount) {
|
||||||
let block_height: u64 = block_height.into();
|
let block_height: u64 = block_height.into();
|
||||||
let generation_0_subsidy = Block::block_subsidy(BlockHeight::genesis().next());
|
let generation_0_subsidy = Block::block_subsidy(BlockHeight::genesis().next());
|
||||||
let effective_block_height = block_height + NUM_BLOCKS_SKIPPED_BECAUSE_REBOOT;
|
|
||||||
let (num_generations, num_blocks_in_curr_gen): (u64, u32) = (
|
let (num_generations, num_blocks_in_curr_gen): (u64, u32) = (
|
||||||
effective_block_height / BLOCKS_PER_GENERATION,
|
block_height / BLOCKS_PER_GENERATION,
|
||||||
(effective_block_height % BLOCKS_PER_GENERATION)
|
(block_height % BLOCKS_PER_GENERATION)
|
||||||
.try_into()
|
.try_into()
|
||||||
.expect("There are fewer than u32::MAX blocks per generation"),
|
.expect("There are fewer than u32::MAX blocks per generation"),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
|
<link rel="stylesheet" type="text/css" href="/css/pico.min.css" media="screen" />
|
||||||
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
|
<link rel="stylesheet" type="text/css" href="/css/styles.css" media="screen" />
|
||||||
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-favicon.png">
|
<link rel="icon" type="image/png" sizes="48x48" href="/image/neptune-icon-white-on-blue.svg">
|
||||||
|
|||||||
67
templates/web/html/page/README.md
Normal file
67
templates/web/html/page/README.md
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# neptune-explorer
|
||||||
|
|
||||||
|
A web-based block explorer for the [Neptune Privacy blockchain](https://neptune.io/). 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](./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
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/neptuneprivacy/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 [xnt-core](https://github.com/neptuneprivacy/xnt-core) and start it, or otherwise find a running xnt-core instance.
|
||||||
|
2. start neptune-explorer
|
||||||
|
|
||||||
|
```
|
||||||
|
nohup neptune-explorer --site-domain testdomain 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.
|
||||||
|
* Site domain *must* be specified with the `--site-domain` flag.
|
||||||
|
|
||||||
|
|
||||||
|
## Connecting via Browser
|
||||||
|
|
||||||
|
Just navigate to http://localhost:3000/
|
||||||
|
|
||||||
|
## 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`
|
||||||
|
|
||||||
|
## 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`.
|
||||||
@ -71,7 +71,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td style="text-align: right" class="mono">
|
<td style="text-align: right" class="mono">
|
||||||
{{input.utxo.get_native_currency_amount().display_n_decimals(5)}}
|
{{input.utxo.get_native_currency_amount().display_n_decimals(5)}}
|
||||||
NPT
|
XNT
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% } %}
|
{% } %}
|
||||||
@ -113,7 +113,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td style="text-align: right" class="mono">
|
<td style="text-align: right" class="mono">
|
||||||
{{output.utxo.get_native_currency_amount().display_n_decimals(5)}}
|
{{output.utxo.get_native_currency_amount().display_n_decimals(5)}}
|
||||||
NPT
|
XNT
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% } %}
|
{% } %}
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<header class="container">
|
<header class="container">
|
||||||
<h1>
|
<h1>
|
||||||
<img src="/image/neptune-logo-circle-small.png" align="right" />
|
<img src="/image/neptune-logo-blue.svg" width="80" height="80" align="right" />
|
||||||
{{self.state.config.site_name}} (network: {{self.state.network}})
|
{{self.state.config.site_name}} (network: {{self.state.network}})
|
||||||
</h1>
|
</h1>
|
||||||
The blockchain tip is at height: {{self.tip_height}}
|
The blockchain tip is at height: {{self.tip_height}}
|
||||||
@ -148,7 +148,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<footer class="container" style="margin-top: 2em; font-size: 0.9em; text-align: center;">
|
<footer class="container" style="margin-top: 2em; font-size: 0.9em; text-align: center;">
|
||||||
<a href="https://github.com/Neptune-Crypto/neptune-explorer" target="_blank">Source code</a>
|
<a href="https://github.com/neptuneprivacy/neptune-explorer" target="_blank">Source code</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
{% if utxo_info.utxo().has_native_currency() { %}
|
{% if utxo_info.utxo().has_native_currency() { %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>Amount:</td>
|
<td>Amount:</td>
|
||||||
<td>{{utxo_info.utxo().get_native_currency_amount().display_n_decimals(5)}} NPT</td>
|
<td>{{utxo_info.utxo().get_native_currency_amount().display_n_decimals(5)}} XNT</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% } %}
|
{% } %}
|
||||||
{% if let Some(release_date) = utxo_info.utxo().release_date() { %}
|
{% if let Some(release_date) = utxo_info.utxo().release_date() { %}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB |
5
templates/web/image/neptune-icon-white-on-blue.svg
Normal file
5
templates/web/image/neptune-icon-white-on-blue.svg
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<svg width="1000" height="1000" viewBox="0 0 1000 1000" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="1000" height="1000" fill="#3140A7"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M666 552C666 643.679 591.679 718 500 718C408.321 718 334 643.679 334 552V316L500 501L523.714 474.571L522 476.5V525.669L603.886 617C615.372 598.395 622 576.471 622 553V465C622 439.266 601.317 418.362 575.668 418.005C575.473 418.002 575.277 418 575.081 418H574.476L666 316V552ZM378 552.057C377.999 554.262 377.946 556.454 378.062 558.63C381.506 622.926 434.731 674 499.886 674C527.341 674 552.679 664.93 573.065 649.624C573.284 649.46 573.502 649.295 573.72 649.13L573.308 648.672L378 431V552.057Z" fill="white"/>
|
||||||
|
<path d="M548 365C533.641 365 522 376.641 522 391V526.5H478V391C478 376.641 466.359 365 452 365L500 282L548 365Z" fill="white"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 851 B |
4
templates/web/image/neptune-logo-blue.svg
Normal file
4
templates/web/image/neptune-logo-blue.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg width="521" height="521" viewBox="0 0 521 521" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M459 322.638C459 432.19 369.905 521 260 521C150.095 521 61 432.19 61 322.638V40.6284L260 261.695L288.428 230.114L286.373 232.419V291.173L384.538 400.31C398.308 378.077 406.253 351.88 406.253 323.833V218.677C406.253 187.925 381.459 162.947 350.71 162.52C350.476 162.516 350.241 162.514 350.007 162.514H349.281L459 40.6284V322.638ZM113.747 322.705C113.746 325.34 113.682 327.96 113.822 330.56C117.95 407.39 181.756 468.422 259.863 468.422C292.777 468.422 323.151 457.584 347.59 439.294C347.852 439.098 348.114 438.901 348.375 438.703L347.881 438.156L113.747 178.048V322.705Z" fill="#3140A7"/>
|
||||||
|
<path d="M317.542 99.1812C300.328 99.1812 286.374 113.091 286.374 130.25V292.166H233.627V130.25C233.627 113.091 219.672 99.1812 202.458 99.1812L260 0L317.542 99.1812Z" fill="#3140A7"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 932 B |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB |
Loading…
x
Reference in New Issue
Block a user