Compare commits

...

2 Commits

Author SHA1 Message Date
f63dbd7d6f update neptuneprivacy directory 2025-12-01 08:58:28 +07:00
257330cc1b dependency change for neptuneprivacy 2025-11-27 13:59:19 +07:00
23 changed files with 128 additions and 130 deletions

112
Cargo.lock generated
View File

@ -1927,9 +1927,47 @@ dependencies = [
]
[[package]]
name = "neptune-cash"
version = "0.4.0"
source = "git+https://github.com/Neptune-Crypto/neptune-core.git?rev=71f471a526a13ddd41ab4400e1a873471d03ede6#71f471a526a13ddd41ab4400e1a873471d03ede6"
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-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 = [
"aead",
"aes-gcm",
@ -1953,7 +1991,6 @@ dependencies = [
"itertools 0.11.0",
"leveldb-sys",
"memmap2",
"neptune-rpc-macros",
"num-bigint",
"num-rational",
"num-traits",
@ -1985,57 +2022,10 @@ dependencies = [
"tracing",
"tracing-subscriber",
"tracing-test",
"xnt-rpc-macros",
"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]]
name = "new_mime_guess"
version = "4.0.4"
@ -3017,9 +3007,9 @@ dependencies = [
[[package]]
name = "serde_tuple"
version = "1.1.2"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52569c5296679bd28e2457f067f97d270077df67da0340647da5412c8eac8d9e"
checksum = "6af196b9c06f0aa5555ab980c01a2527b0f67517da8d68b1731b9d4764846a6f"
dependencies = [
"serde",
"serde_tuple_macros",
@ -3027,9 +3017,9 @@ dependencies = [
[[package]]
name = "serde_tuple_macros"
version = "1.1.2"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f46c707781471741d5f2670edb36476479b26e94cf43efe21ca3c220b97ef2e"
checksum = "ec3a1e7d2eadec84deabd46ae061bf480a91a6bce74d25dad375bd656f2e19d8"
dependencies = [
"proc-macro2",
"quote",
@ -4539,6 +4529,16 @@ version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
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]]
name = "yoke"
version = "0.8.0"

View File

@ -24,7 +24,7 @@ tokio = { version = "1.48.0", features = ["full", "tracing"] }
tracing = "0.1"
tracing-subscriber = "0.3"
neptune-cash = "0.4.0"
neptune-privacy = "0.1.0"
tarpc = { version = "^0.34", features = [
"tokio1",
"serde-transport",
@ -64,7 +64,7 @@ arbitrary = "1.4.2"
proptest-arbitrary-interop = "0.1.0"
[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]
mock = ["dep:blake3", "dep:rand"]

View File

@ -19,7 +19,7 @@ sudo apt install pkg-config libssl-dev
Then
```
git clone https://github.com/Neptune-Crypto/neptune-explorer.git
git clone https://github.com/neptuneprivacy/neptune-explorer.git
cd neptune-explorer
cargo install --locked --path .
```
@ -30,7 +30,7 @@ not tested or supported. Please let us know if you get it work. patches accep
## 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
```

View File

@ -8,11 +8,11 @@ use axum::response::Html;
use axum::response::Response;
use html_escaper::Escape;
use html_escaper::Trusted;
use neptune_cash::api::export::BlockHeight;
use neptune_cash::prelude::tasm_lib::prelude::Digest;
use neptune_cash::prelude::triton_vm::prelude::BFieldCodec;
use neptune_cash::prelude::twenty_first::tip5::Tip5;
use neptune_cash::util_types::mutator_set::addition_record::AdditionRecord;
use neptune_privacy::api::export::BlockHeight;
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
use neptune_privacy::prelude::triton_vm::prelude::BFieldCodec;
use neptune_privacy::prelude::twenty_first::tip5::Tip5;
use neptune_privacy::util_types::mutator_set::addition_record::AdditionRecord;
use tarpc::context;
use crate::html::component::header::HeaderHtml;

View File

@ -7,7 +7,7 @@ use axum::response::Html;
use axum::response::Response;
use html_escaper::Escape;
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 crate::html::component::header::HeaderHtml;

View File

@ -4,7 +4,7 @@ use axum::extract::State;
use axum::response::Html;
use axum::response::Response;
use html_escaper::Escape;
use neptune_cash::api::export::BlockHeight;
use neptune_privacy::api::export::BlockHeight;
use tarpc::context;
use crate::html::page::not_found::not_found_html_response;

View File

@ -7,8 +7,8 @@ use axum::response::Html;
use axum::response::Response;
use html_escaper::Escape;
use html_escaper::Trusted;
use neptune_cash::api::export::Tip5;
use neptune_cash::prelude::tasm_lib::prelude::Digest;
use neptune_privacy::api::export::Tip5;
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
use tarpc::context;
use crate::html::component::header::HeaderHtml;

View File

@ -2,7 +2,7 @@ use axum::http::StatusCode;
use axum::response::Html;
use axum::response::IntoResponse;
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;
// note: http StatusCodes are defined at:

View File

@ -1,10 +1,10 @@
use std::fmt::Display;
use std::str::FromStr;
use neptune_cash::api::export::BlockHeight;
use neptune_cash::prelude::tasm_lib::prelude::Digest;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorLiteral;
use neptune_privacy::api::export::BlockHeight;
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorLiteral;
use serde::de::Error;
use serde::Deserialize;
use serde::Deserializer;
@ -35,13 +35,13 @@ pub enum AnnouncementSelectorParseError {
#[error("error parsing index for announcement in block {0}: {1}")]
HeightIndex(BlockHeight, std::num::ParseIntError),
#[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}")]
DigestIndex(Digest, std::num::ParseIntError),
#[error("error parsing block-height-or-digest: {0} / {1}")]
HeightNorDigest(
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}")]
HeightOrDigestIndex(BlockSelector, std::num::ParseIntError),

View File

@ -1,6 +1,6 @@
use neptune_cash::api::export::Announcement;
use neptune_cash::api::export::TransparentTransactionInfo;
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
use neptune_privacy::api::export::Announcement;
use neptune_privacy::api::export::TransparentTransactionInfo;
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
#[derive(Debug, Clone)]
pub enum AnnouncementType {

View File

@ -3,10 +3,10 @@ use std::sync::Arc;
use anyhow::Context;
use arc_swap::ArcSwap;
use clap::Parser;
use neptune_cash::api::export::Network;
use neptune_cash::application::rpc::auth;
use neptune_cash::prelude::twenty_first::tip5::Digest;
use neptune_cash::protocol::consensus::block::block_selector::{
use neptune_privacy::api::export::Network;
use neptune_privacy::application::rpc::auth;
use neptune_privacy::prelude::twenty_first::tip5::Digest;
use neptune_privacy::protocol::consensus::block::block_selector::{
BlockSelector, BlockSelectorLiteral,
};
use tokio::sync::Mutex;

View File

@ -1,11 +1,11 @@
use std::num::ParseIntError;
use std::str::FromStr;
use neptune_cash::api::export::BlockHeight;
use neptune_cash::api::export::Digest;
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorParseError;
use neptune_privacy::api::export::BlockHeight;
use neptune_privacy::api::export::Digest;
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorParseError;
use serde::de::Error;
use serde::Deserialize;
use serde::Deserializer;

View File

@ -31,7 +31,7 @@ pub struct Config {
pub listen_port: u16,
/// 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,
/// Sets interval in seconds to ping neptune-core rpc connection

View File

@ -1,9 +1,9 @@
use std::str::FromStr;
use neptune_cash::api::export::BlockHeight;
use neptune_cash::prelude::tasm_lib::prelude::Digest;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelectorParseError;
use neptune_privacy::api::export::BlockHeight;
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelectorParseError;
use serde::Deserialize;
use serde::Serialize;

View File

@ -1,8 +1,8 @@
use neptune_cash::api::export::AdditionRecord;
use neptune_cash::api::export::Digest;
use neptune_cash::api::export::TransparentInput;
use neptune_cash::api::export::Utxo;
use neptune_cash::api::export::UtxoTriple;
use neptune_privacy::api::export::AdditionRecord;
use neptune_privacy::api::export::Digest;
use neptune_privacy::api::export::TransparentInput;
use neptune_privacy::api::export::Utxo;
use neptune_privacy::api::export::UtxoTriple;
#[derive(Debug, Clone)]
pub struct TransparentUtxoTuple {

View File

@ -7,18 +7,18 @@ use chrono::DateTime;
use chrono::TimeDelta;
use chrono::Utc;
use clap::Parser;
use neptune_cash::api::export::Announcement;
use neptune_cash::api::export::Network;
use neptune_cash::application::config::data_directory::DataDirectory;
use neptune_cash::application::rpc::auth;
use neptune_cash::application::rpc::server::error::RpcError;
use neptune_cash::application::rpc::server::RPCClient;
use neptune_cash::application::rpc::server::RpcResult;
use neptune_cash::prelude::tasm_lib::prelude::Digest;
use neptune_cash::protocol::consensus::block::block_height::BlockHeight;
use neptune_cash::protocol::consensus::block::block_info::BlockInfo;
use neptune_cash::protocol::consensus::block::block_selector::BlockSelector;
use neptune_cash::util_types::mutator_set::addition_record::AdditionRecord;
use neptune_privacy::api::export::Announcement;
use neptune_privacy::api::export::Network;
use neptune_privacy::application::config::data_directory::DataDirectory;
use neptune_privacy::application::rpc::auth;
use neptune_privacy::application::rpc::server::error::RpcError;
use neptune_privacy::application::rpc::server::RPCClient;
use neptune_privacy::application::rpc::server::RpcResult;
use neptune_privacy::prelude::tasm_lib::prelude::Digest;
use neptune_privacy::protocol::consensus::block::block_height::BlockHeight;
use neptune_privacy::protocol::consensus::block::block_info::BlockInfo;
use neptune_privacy::protocol::consensus::block::block_selector::BlockSelector;
use neptune_privacy::util_types::mutator_set::addition_record::AdditionRecord;
use tarpc::client;
use tarpc::context;
use tarpc::tokio_serde::formats::Json as RpcJson;
@ -146,8 +146,8 @@ impl AuthenticatedClient {
#[cfg(feature = "mock")]
if std::env::var(MOCK_KEY).is_ok() {
use blake3::Hasher;
use neptune_cash::api::export::TransparentTransactionInfo;
use neptune_cash::prelude::triton_vm::prelude::BFieldElement;
use neptune_privacy::api::export::TransparentTransactionInfo;
use neptune_privacy::prelude::triton_vm::prelude::BFieldElement;
use rand::rngs::StdRng;
use rand::Rng;
use rand::SeedableRng;

View File

@ -4,7 +4,7 @@ use axum::extract::Path;
use axum::extract::State;
use axum::response::IntoResponse;
use axum::response::Json;
use neptune_cash::prelude::twenty_first::tip5::Digest;
use neptune_privacy::prelude::twenty_first::tip5::Digest;
use tarpc::context;
use crate::http_util::not_found_err;

View File

@ -4,7 +4,7 @@ use axum::extract::Path;
use axum::extract::State;
use axum::response::Json;
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 crate::http_util::not_found_err;

View File

@ -4,9 +4,9 @@ use axum::extract::Path;
use axum::extract::State;
use axum::response::IntoResponse;
use axum::response::Json;
use neptune_cash::application::rpc::server::error::RpcError;
use neptune_cash::application::rpc::server::proof_of_work_puzzle::ProofOfWorkPuzzle;
use neptune_cash::state::wallet::address::generation_address::GenerationReceivingAddress;
use neptune_privacy::application::rpc::server::error::RpcError;
use neptune_privacy::application::rpc::server::proof_of_work_puzzle::ProofOfWorkPuzzle;
use neptune_privacy::state::wallet::address::generation_address::GenerationReceivingAddress;
use tarpc::context;
use crate::http_util::not_found_err;

View File

@ -3,8 +3,8 @@ use std::sync::Arc;
use axum::extract::State;
use axum::response::Json;
use axum::response::Response;
use neptune_cash::prelude::twenty_first::tip5::Digest;
use neptune_cash::protocol::consensus::block::block_header::BlockPow;
use neptune_privacy::prelude::twenty_first::tip5::Digest;
use neptune_privacy::protocol::consensus::block::block_header::BlockPow;
use serde::Deserialize;
use serde::Serialize;
use tarpc::context;

View File

@ -4,7 +4,7 @@ use axum::extract::Path;
use axum::extract::State;
use axum::response::IntoResponse;
use axum::response::Json;
use neptune_cash::prelude::twenty_first::tip5::Digest;
use neptune_privacy::prelude::twenty_first::tip5::Digest;
use tarpc::context;
use crate::http_util::not_found_err;

View File

@ -1,9 +1,8 @@
use neptune_cash::api::export::BlockHeight;
use neptune_cash::api::export::NativeCurrencyAmount;
use neptune_cash::protocol::consensus::block::block_height::BLOCKS_PER_GENERATION;
use neptune_cash::protocol::consensus::block::block_height::NUM_BLOCKS_SKIPPED_BECAUSE_REBOOT;
use neptune_cash::protocol::consensus::block::Block;
use neptune_cash::protocol::consensus::block::PREMINE_MAX_SIZE;
use neptune_privacy::api::export::BlockHeight;
use neptune_privacy::api::export::NativeCurrencyAmount;
use neptune_privacy::protocol::consensus::block::block_height::BLOCKS_PER_GENERATION;
use neptune_privacy::protocol::consensus::block::Block;
use neptune_privacy::protocol::consensus::block::PREMINE_MAX_SIZE;
/// Return the pair (liquid supply, total supply)
///
@ -13,10 +12,9 @@ pub(crate) fn monetary_supplies(
) -> (NativeCurrencyAmount, NativeCurrencyAmount) {
let block_height: u64 = block_height.into();
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) = (
effective_block_height / BLOCKS_PER_GENERATION,
(effective_block_height % BLOCKS_PER_GENERATION)
block_height / BLOCKS_PER_GENERATION,
(block_height % BLOCKS_PER_GENERATION)
.try_into()
.expect("There are fewer than u32::MAX blocks per generation"),
);

View File

@ -148,7 +148,7 @@
</main>
<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>
</body>