diff --git a/Cargo.lock b/Cargo.lock index 01dba4e..fa8e69b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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://git.softly.com/Softly/tuna?rev=602667d9ee1c1fbcd7739c78e8816062f2645a5f#602667d9ee1c1fbcd7739c78e8816062f2645a5f" 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://git.softly.com/Softly/tuna?rev=602667d9ee1c1fbcd7739c78e8816062f2645a5f#602667d9ee1c1fbcd7739c78e8816062f2645a5f" +dependencies = [ + "convert_case", + "quote", + "syn 2.0.108", +] + [[package]] name = "yoke" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 6b697a3..63edabf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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://git.softly.com/Softly/tuna", rev = "602667d9ee1c1fbcd7739c78e8816062f2645a5f" } [features] mock = ["dep:blake3", "dep:rand"] diff --git a/README.md b/README.md index 38e4428..2d9ea67 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/src/html/page/announcement.rs b/src/html/page/announcement.rs index 23010a2..ce67ead 100644 --- a/src/html/page/announcement.rs +++ b/src/html/page/announcement.rs @@ -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; diff --git a/src/html/page/block.rs b/src/html/page/block.rs index 9a9639a..e4d0076 100644 --- a/src/html/page/block.rs +++ b/src/html/page/block.rs @@ -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; diff --git a/src/html/page/root.rs b/src/html/page/root.rs index fd056e2..6aa8c17 100644 --- a/src/html/page/root.rs +++ b/src/html/page/root.rs @@ -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; diff --git a/src/html/page/utxo.rs b/src/html/page/utxo.rs index 67cdc05..b23515c 100644 --- a/src/html/page/utxo.rs +++ b/src/html/page/utxo.rs @@ -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; diff --git a/src/http_util.rs b/src/http_util.rs index 5f09516..3149496 100644 --- a/src/http_util.rs +++ b/src/http_util.rs @@ -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: diff --git a/src/model/announcement_selector.rs b/src/model/announcement_selector.rs index dd886f3..4b5e801 100644 --- a/src/model/announcement_selector.rs +++ b/src/model/announcement_selector.rs @@ -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), diff --git a/src/model/announcement_type.rs b/src/model/announcement_type.rs index e6dab29..3585f48 100644 --- a/src/model/announcement_type.rs +++ b/src/model/announcement_type.rs @@ -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 { diff --git a/src/model/app_state.rs b/src/model/app_state.rs index 1c9a336..d9f0951 100644 --- a/src/model/app_state.rs +++ b/src/model/app_state.rs @@ -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; diff --git a/src/model/block_selector_extended.rs b/src/model/block_selector_extended.rs index 14ada56..2f986b9 100644 --- a/src/model/block_selector_extended.rs +++ b/src/model/block_selector_extended.rs @@ -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; diff --git a/src/model/height_or_digest.rs b/src/model/height_or_digest.rs index 9842603..9505792 100644 --- a/src/model/height_or_digest.rs +++ b/src/model/height_or_digest.rs @@ -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; diff --git a/src/model/transparent_utxo_tuple.rs b/src/model/transparent_utxo_tuple.rs index 045eee7..b3e616b 100644 --- a/src/model/transparent_utxo_tuple.rs +++ b/src/model/transparent_utxo_tuple.rs @@ -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 { diff --git a/src/neptune_rpc.rs b/src/neptune_rpc.rs index 5e29f3d..369c2d4 100644 --- a/src/neptune_rpc.rs +++ b/src/neptune_rpc.rs @@ -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; diff --git a/src/rpc/block_digest.rs b/src/rpc/block_digest.rs index 34b7c93..87eb487 100644 --- a/src/rpc/block_digest.rs +++ b/src/rpc/block_digest.rs @@ -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; diff --git a/src/rpc/block_info.rs b/src/rpc/block_info.rs index 3eb02f4..2b847e6 100644 --- a/src/rpc/block_info.rs +++ b/src/rpc/block_info.rs @@ -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; diff --git a/src/rpc/pow_puzzle.rs b/src/rpc/pow_puzzle.rs index ad84af7..6c7287a 100644 --- a/src/rpc/pow_puzzle.rs +++ b/src/rpc/pow_puzzle.rs @@ -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; diff --git a/src/rpc/provide_pow_solution.rs b/src/rpc/provide_pow_solution.rs index c4c3ac5..ca4a1ca 100644 --- a/src/rpc/provide_pow_solution.rs +++ b/src/rpc/provide_pow_solution.rs @@ -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; diff --git a/src/rpc/utxo_digest.rs b/src/rpc/utxo_digest.rs index d90786f..a63a8f3 100644 --- a/src/rpc/utxo_digest.rs +++ b/src/rpc/utxo_digest.rs @@ -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; diff --git a/src/shared.rs b/src/shared.rs index f4064d5..f5e8c6c 100644 --- a/src/shared.rs +++ b/src/shared.rs @@ -1,9 +1,9 @@ -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_height::NUM_BLOCKS_SKIPPED_BECAUSE_REBOOT; +use neptune_privacy::protocol::consensus::block::Block; +use neptune_privacy::protocol::consensus::block::PREMINE_MAX_SIZE; /// Return the pair (liquid supply, total supply) /// diff --git a/templates/web/html/page/root.html b/templates/web/html/page/root.html index df34755..2c656da 100644 --- a/templates/web/html/page/root.html +++ b/templates/web/html/page/root.html @@ -148,7 +148,7 @@