Last set of crates to add the nym- prefix to (#3286)

* Add nym- prefix to mixnode-common

* Add nym- prefix to mixnet-client

* Add nym-client- prefix to websocket-requests

* Makefile: add check target

* Rename to nym-credential-client

* rustfmt

* update to nym-credential-client in github workflow
This commit is contained in:
Jon Häggblad
2023-04-07 21:25:28 +02:00
committed by GitHub
parent 95e2e3d0d2
commit dc5c765ecb
24 changed files with 119 additions and 115 deletions
@@ -98,7 +98,7 @@ jobs:
cp target/release/nym-network-requester $OUTPUT_DIR
cp target/release/nym-network-statistics $OUTPUT_DIR
cp target/release/nym-cli $OUTPUT_DIR
cp target/release/credential $OUTPUT_DIR
cp target/release/nym-credential-client $OUTPUT_DIR
cp target/release/explorer-api $OUTPUT_DIR
cp contracts/target/wasm32-unknown-unknown/release/mixnet_contract.wasm $OUTPUT_DIR
Generated
+80 -80
View File
@@ -912,29 +912,6 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "credential"
version = "0.1.0"
dependencies = [
"bip39",
"clap 4.1.11",
"log",
"nym-bin-common",
"nym-coconut-interface",
"nym-config",
"nym-credential-storage",
"nym-credentials",
"nym-crypto",
"nym-network-defaults",
"nym-pemstore",
"nym-validator-client",
"rand 0.7.3",
"serde",
"thiserror",
"tokio",
"url",
]
[[package]]
name = "criterion"
version = "0.4.0"
@@ -2900,48 +2877,6 @@ dependencies = [
"windows-sys 0.45.0",
]
[[package]]
name = "mixnet-client"
version = "0.1.0"
dependencies = [
"futures",
"log",
"nym-sphinx",
"nym-task",
"tokio",
"tokio-util",
]
[[package]]
name = "mixnode-common"
version = "0.1.0"
dependencies = [
"bytes",
"cfg-if",
"cpu-cycles",
"futures",
"humantime-serde",
"log",
"nym-bin-common",
"nym-crypto",
"nym-network-defaults",
"nym-sphinx-acknowledgements",
"nym-sphinx-addressing",
"nym-sphinx-forwarding",
"nym-sphinx-framing",
"nym-sphinx-params",
"nym-sphinx-types",
"nym-task",
"nym-validator-client",
"rand 0.8.5",
"serde",
"thiserror",
"tokio",
"tokio-util",
"tracing",
"url",
]
[[package]]
name = "multer"
version = "2.0.4"
@@ -3260,6 +3195,7 @@ dependencies = [
"log",
"nym-bin-common",
"nym-client-core",
"nym-client-websocket-requests",
"nym-coconut-interface",
"nym-config",
"nym-credential-storage",
@@ -3282,7 +3218,6 @@ dependencies = [
"tokio",
"tokio-tungstenite 0.14.0",
"url",
"websocket-requests",
]
[[package]]
@@ -3325,6 +3260,15 @@ dependencies = [
"wasm-utils",
]
[[package]]
name = "nym-client-websocket-requests"
version = "0.1.0"
dependencies = [
"nym-sphinx",
"serde",
"serde_json",
]
[[package]]
name = "nym-coconut"
version = "0.5.0"
@@ -3406,6 +3350,29 @@ dependencies = [
"thiserror",
]
[[package]]
name = "nym-credential-client"
version = "0.1.0"
dependencies = [
"bip39",
"clap 4.1.11",
"log",
"nym-bin-common",
"nym-coconut-interface",
"nym-config",
"nym-credential-storage",
"nym-credentials",
"nym-crypto",
"nym-network-defaults",
"nym-pemstore",
"nym-validator-client",
"rand 0.7.3",
"serde",
"thiserror",
"tokio",
"url",
]
[[package]]
name = "nym-credential-storage"
version = "0.1.0"
@@ -3505,8 +3472,6 @@ dependencies = [
"humantime-serde",
"lazy_static",
"log",
"mixnet-client",
"mixnode-common",
"nym-api-requests",
"nym-bin-common",
"nym-coconut-interface",
@@ -3514,6 +3479,8 @@ dependencies = [
"nym-credentials",
"nym-crypto",
"nym-gateway-requests",
"nym-mixnet-client",
"nym-mixnode-common",
"nym-network-defaults",
"nym-pemstore",
"nym-sphinx",
@@ -3606,6 +3573,18 @@ dependencies = [
"thiserror",
]
[[package]]
name = "nym-mixnet-client"
version = "0.1.0"
dependencies = [
"futures",
"log",
"nym-sphinx",
"nym-task",
"tokio",
"tokio-util",
]
[[package]]
name = "nym-mixnet-contract-common"
version = "0.3.0"
@@ -3641,12 +3620,12 @@ dependencies = [
"humantime-serde",
"lazy_static",
"log",
"mixnet-client",
"mixnode-common",
"nym-bin-common",
"nym-config",
"nym-contracts-common",
"nym-crypto",
"nym-mixnet-client",
"nym-mixnode-common",
"nym-nonexhaustive-delayqueue",
"nym-pemstore",
"nym-sphinx",
@@ -3670,6 +3649,36 @@ dependencies = [
"url",
]
[[package]]
name = "nym-mixnode-common"
version = "0.1.0"
dependencies = [
"bytes",
"cfg-if",
"cpu-cycles",
"futures",
"humantime-serde",
"log",
"nym-bin-common",
"nym-crypto",
"nym-network-defaults",
"nym-sphinx-acknowledgements",
"nym-sphinx-addressing",
"nym-sphinx-forwarding",
"nym-sphinx-framing",
"nym-sphinx-params",
"nym-sphinx-types",
"nym-task",
"nym-validator-client",
"rand 0.8.5",
"serde",
"thiserror",
"tokio",
"tokio-util",
"tracing",
"url",
]
[[package]]
name = "nym-mobile-storage"
version = "0.1.0"
@@ -3720,6 +3729,7 @@ dependencies = [
"log",
"nym-bin-common",
"nym-client-core",
"nym-client-websocket-requests",
"nym-config",
"nym-crypto",
"nym-network-defaults",
@@ -3743,7 +3753,6 @@ dependencies = [
"tokio",
"tokio-tungstenite 0.17.2",
"url",
"websocket-requests",
]
[[package]]
@@ -7238,15 +7247,6 @@ dependencies = [
"webpki 0.22.0",
]
[[package]]
name = "websocket-requests"
version = "0.1.0"
dependencies = [
"nym-sphinx",
"serde",
"serde_json",
]
[[package]]
name = "winapi"
version = "0.3.9"
+4
View File
@@ -26,6 +26,9 @@ clippy-$(1):
clippy-$(1)-examples:
cargo clippy --manifest-path $(2)/Cargo.toml --workspace --examples -- -D warnings
check-$(1):
cargo check --manifest-path $(2)/Cargo.toml --workspace $(3)
test-$(1):
cargo test --manifest-path $(2)/Cargo.toml --workspace
@@ -43,6 +46,7 @@ fmt-$(1):
clippy-happy: clippy-happy-$(1)
clippy-all: clippy-$(1) clippy-$(1)-examples
check: check-$(1)
cargo-test: test-$(1)
cargo-test-expensive: test-$(1)-expensive
build: build-$(1) build-$(1)-examples
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "credential"
name = "nym-credential-client"
version = "0.1.0"
edition = "2021"
+1 -1
View File
@@ -49,6 +49,6 @@ nym-pemstore = { path = "../../common/pemstore" }
nym-task = { path = "../../common/task" }
nym-topology = { path = "../../common/topology" }
nym-validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] }
websocket-requests = { path = "websocket-requests" }
nym-client-websocket-requests = { path = "websocket-requests" }
[dev-dependencies]
@@ -1,10 +1,10 @@
use futures::{SinkExt, StreamExt};
use nym_client_websocket_requests::{requests::ClientRequest, responses::ServerResponse};
use nym_sphinx::addressing::clients::Recipient;
use tokio::net::TcpStream;
use tokio_tungstenite::{
connect_async, tungstenite::protocol::Message, MaybeTlsStream, WebSocketStream,
};
use websocket_requests::{requests::ClientRequest, responses::ServerResponse};
// just helpers functions that work in this very particular context because we are sending to ourselves
// and hence will always get a response back (i.e. the message we sent)
+1 -1
View File
@@ -11,6 +11,7 @@ use nym_client_core::client::{
ReceivedBufferMessage, ReceivedBufferRequestSender, ReconstructedMessagesReceiver,
},
};
use nym_client_websocket_requests::{requests::ClientRequest, responses::ServerResponse};
use nym_sphinx::addressing::clients::Recipient;
use nym_sphinx::anonymous_replies::requests::AnonymousSenderTag;
use nym_sphinx::receiver::ReconstructedMessage;
@@ -25,7 +26,6 @@ use tokio_tungstenite::{
tungstenite::{protocol::Message as WsMessage, Error as WsError},
WebSocketStream,
};
use websocket_requests::{requests::ClientRequest, responses::ServerResponse};
#[derive(Default)]
enum ReceivedResponseType {
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "websocket-requests"
name = "nym-client-websocket-requests"
version = "0.1.0"
authors = ["Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2021"
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "mixnet-client"
name = "nym-mixnet-client"
version = "0.1.0"
authors = ["Jedrzej Stuczynski <andrew@nymtech.net>"]
edition = "2021"
+1 -1
View File
@@ -1,5 +1,5 @@
[package]
name = "mixnode-common"
name = "nym-mixnode-common"
version = "0.1.0"
authors = ["Jędrzej Stuczyński <andrew@nymtech.net>"]
edition = "2021"
+2 -2
View File
@@ -58,8 +58,8 @@ nym-config = { path = "../common/config" }
nym-crypto = { path = "../common/crypto" }
nym-bin-common = { path = "../common/bin-common", features = ["output_format"] }
nym-gateway-requests = { path = "gateway-requests" }
mixnet-client = { path = "../common/client-libs/mixnet-client" }
mixnode-common = { path = "../common/mixnode-common" }
nym-mixnet-client = { path = "../common/client-libs/mixnet-client" }
nym-mixnode-common = { path = "../common/mixnode-common" }
nym-network-defaults = { path = "../common/network-defaults" }
nym-sphinx = { path = "../common/nymsphinx" }
nym-pemstore = { path = "../common/pemstore" }
@@ -10,7 +10,6 @@ use crate::node::storage::error::StorageError;
use crate::node::storage::Storage;
use futures::{channel::mpsc, SinkExt, StreamExt};
use log::*;
use mixnet_client::forwarder::MixForwardingSender;
use nym_crypto::asymmetric::identity;
use nym_gateway_requests::authentication::encrypted_address::{
EncryptedAddressBytes, EncryptedAddressConversionError,
@@ -20,6 +19,7 @@ use nym_gateway_requests::registration::handshake::error::HandshakeError;
use nym_gateway_requests::registration::handshake::{gateway_handshake, SharedKeys};
use nym_gateway_requests::types::{ClientControlRequest, ServerResponse};
use nym_gateway_requests::{BinaryResponse, PROTOCOL_VERSION};
use nym_mixnet_client::forwarder::MixForwardingSender;
use nym_sphinx::DestinationAddressBytes;
use rand::{CryptoRng, Rng};
use std::convert::TryFrom;
@@ -6,8 +6,8 @@ use crate::node::client_handling::websocket::connection_handler::coconut::Coconu
use crate::node::client_handling::websocket::connection_handler::FreshHandler;
use crate::node::storage::Storage;
use log::*;
use mixnet_client::forwarder::MixForwardingSender;
use nym_crypto::asymmetric::identity;
use nym_mixnet_client::forwarder::MixForwardingSender;
use rand::rngs::OsRng;
use std::net::SocketAddr;
use std::process;
@@ -8,8 +8,8 @@ use crate::node::storage::error::StorageError;
use crate::node::storage::Storage;
use futures::StreamExt;
use log::*;
use mixnet_client::forwarder::MixForwardingSender;
use mixnode_common::packet_processor::processor::ProcessedFinalHop;
use nym_mixnet_client::forwarder::MixForwardingSender;
use nym_mixnode_common::packet_processor::processor::ProcessedFinalHop;
use nym_sphinx::forwarding::packet::MixPacket;
use nym_sphinx::framing::codec::SphinxCodec;
use nym_sphinx::framing::packet::FramedSphinxPacket;
@@ -1,10 +1,10 @@
// Copyright 2020 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use mixnode_common::packet_processor::error::MixProcessingError;
pub use mixnode_common::packet_processor::processor::MixProcessingResult;
use mixnode_common::packet_processor::processor::{ProcessedFinalHop, SphinxPacketProcessor};
use nym_crypto::asymmetric::encryption;
use nym_mixnode_common::packet_processor::error::MixProcessingError;
pub use nym_mixnode_common::packet_processor::processor::MixProcessingResult;
use nym_mixnode_common::packet_processor::processor::{ProcessedFinalHop, SphinxPacketProcessor};
use nym_sphinx::framing::packet::FramedSphinxPacket;
use thiserror::Error;
+1 -1
View File
@@ -12,9 +12,9 @@ use crate::node::mixnet_handling::receiver::connection_handler::ConnectionHandle
use crate::node::statistics::collector::GatewayStatisticsCollector;
use crate::node::storage::Storage;
use log::*;
use mixnet_client::forwarder::{MixForwardingSender, PacketForwarder};
use nym_bin_common::output_format::OutputFormat;
use nym_crypto::asymmetric::{encryption, identity};
use nym_mixnet_client::forwarder::{MixForwardingSender, PacketForwarder};
use nym_network_defaults::NymNetworkDetails;
use nym_statistics_common::collector::StatisticsSender;
use nym_task::{TaskClient, TaskManager};
+3 -3
View File
@@ -47,8 +47,8 @@ opentelemetry = { version = "0.19.0", optional = true }
nym-config = { path = "../common/config" }
nym-crypto = { path = "../common/crypto" }
nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-common" }
mixnet-client = { path = "../common/client-libs/mixnet-client" }
mixnode-common = { path = "../common/mixnode-common" }
nym-mixnet-client = { path = "../common/client-libs/mixnet-client" }
nym-mixnode-common = { path = "../common/mixnode-common" }
nym-nonexhaustive-delayqueue = { path = "../common/nonexhaustive-delayqueue" }
nym-sphinx = { path = "../common/nymsphinx" }
nym-pemstore = { path = "../common/pemstore", version = "0.2.0" }
@@ -72,7 +72,7 @@ nym-sphinx-params = { path = "../common/nymsphinx/params" }
[features]
cpucycles = [
"mixnode-common/cpucycles",
"nym-mixnode-common/cpucycles",
"tracing",
"opentelemetry",
"nym-bin-common/tracing",
+2 -2
View File
@@ -7,14 +7,14 @@ extern crate rocket;
use ::nym_config::defaults::setup_env;
use clap::{crate_name, crate_version, Parser};
use lazy_static::lazy_static;
#[cfg(feature = "cpucycles")]
use mixnode_common::measure;
use nym_bin_common::build_information::BinaryBuildInformation;
#[allow(unused_imports)]
use nym_bin_common::logging::{maybe_print_banner, setup_logging};
#[cfg(feature = "cpucycles")]
use nym_bin_common::setup_tracing;
#[cfg(feature = "cpucycles")]
use nym_mixnode_common::measure;
#[cfg(feature = "cpucycles")]
use tracing::instrument;
mod commands;
mod config;
+1 -1
View File
@@ -1,4 +1,4 @@
use mixnode_common::verloc::{AtomicVerlocResult, VerlocResult};
use nym_mixnode_common::verloc::{AtomicVerlocResult, VerlocResult};
use rocket::serde::json::Json;
use rocket::State;
@@ -7,7 +7,7 @@ use crate::node::listener::connection_handler::packet_processing::{
use crate::node::packet_delayforwarder::PacketDelayForwardSender;
use crate::node::TaskClient;
use futures::StreamExt;
use mixnode_common::measure;
use nym_mixnode_common::measure;
use nym_sphinx::forwarding::packet::MixPacket;
use nym_sphinx::framing::codec::SphinxCodec;
use nym_sphinx::framing::packet::FramedSphinxPacket;
@@ -2,10 +2,10 @@
// SPDX-License-Identifier: Apache-2.0
use crate::node::node_statistics;
use mixnode_common::packet_processor::error::MixProcessingError;
pub use mixnode_common::packet_processor::processor::MixProcessingResult;
use mixnode_common::packet_processor::processor::SphinxPacketProcessor;
use nym_crypto::asymmetric::encryption;
use nym_mixnode_common::packet_processor::error::MixProcessingError;
pub use nym_mixnode_common::packet_processor::processor::MixProcessingResult;
use nym_mixnode_common::packet_processor::processor::SphinxPacketProcessor;
use nym_sphinx::framing::packet::FramedSphinxPacket;
// PacketProcessor contains all data required to correctly unwrap and forward sphinx packets
+3 -3
View File
@@ -16,11 +16,11 @@ use crate::node::listener::Listener;
use crate::node::node_description::NodeDescription;
use crate::node::node_statistics::SharedNodeStats;
use crate::node::packet_delayforwarder::{DelayForwarder, PacketDelayForwardSender};
use mixnode_common::verloc::{self, AtomicVerlocResult, VerlocMeasurer};
use nym_bin_common::output_format::OutputFormat;
use nym_bin_common::version_checker::parse_version;
use nym_config::NymConfig;
use nym_crypto::asymmetric::{encryption, identity};
use nym_mixnode_common::verloc::{self, AtomicVerlocResult, VerlocMeasurer};
use nym_task::{TaskClient, TaskManager};
use rand::seq::SliceRandom;
use rand::thread_rng;
@@ -173,7 +173,7 @@ impl MixNode {
) -> PacketDelayForwardSender {
info!("Starting packet delay-forwarder...");
let client_config = mixnet_client::Config::new(
let client_config = nym_mixnet_client::Config::new(
self.config.get_packet_forwarding_initial_backoff(),
self.config.get_packet_forwarding_maximum_backoff(),
self.config.get_initial_connection_timeout(),
@@ -182,7 +182,7 @@ impl MixNode {
);
let mut packet_forwarder = DelayForwarder::new(
mixnet_client::Client::new(client_config),
nym_mixnet_client::Client::new(client_config),
node_stats_update_sender,
shutdown,
);
+3 -3
View File
@@ -21,7 +21,7 @@ type PacketDelayForwardReceiver = mpsc::UnboundedReceiver<(MixPacket, Option<Ins
/// Entity responsible for delaying received sphinx packet and forwarding it to next node.
pub(crate) struct DelayForwarder<C>
where
C: mixnet_client::SendWithoutResponse,
C: nym_mixnet_client::SendWithoutResponse,
{
delay_queue: NonExhaustiveDelayQueue<MixPacket>,
mixnet_client: C,
@@ -33,7 +33,7 @@ where
impl<C> DelayForwarder<C>
where
C: mixnet_client::SendWithoutResponse,
C: nym_mixnet_client::SendWithoutResponse,
{
pub(crate) fn new(
client: C,
@@ -150,7 +150,7 @@ mod tests {
pub packets_sent: Arc<Mutex<Vec<(NymNodeRoutingAddress, SphinxPacket, PacketMode)>>>,
}
impl mixnet_client::SendWithoutResponse for TestClient {
impl nym_mixnet_client::SendWithoutResponse for TestClient {
fn send_without_response(
&mut self,
address: NymNodeRoutingAddress,
@@ -46,7 +46,7 @@ nym-service-providers-common = { path = "../common" }
nym-socks5-requests = { path = "../../common/socks5/requests" }
nym-statistics-common = { path = "../../common/statistics" }
nym-task = { path = "../../common/task" }
websocket-requests = { path = "../../clients/native/websocket-requests" }
nym-client-websocket-requests = { path = "../../clients/native/websocket-requests" }
[dev-dependencies]
tempfile = "3.5.0"