aboutsummaryrefslogtreecommitdiff
path: root/p2p/src
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/src')
-rw-r--r--p2p/src/backend.rs2
-rw-r--r--p2p/src/codec.rs4
-rw-r--r--p2p/src/config.rs2
-rw-r--r--p2p/src/connection.rs4
-rw-r--r--p2p/src/connector.rs6
-rw-r--r--p2p/src/discovery/lookup.rs4
-rw-r--r--p2p/src/discovery/mod.rs4
-rw-r--r--p2p/src/discovery/refresh.rs6
-rw-r--r--p2p/src/error.rs6
-rw-r--r--p2p/src/lib.rs4
-rw-r--r--p2p/src/listener.rs6
-rw-r--r--p2p/src/message.rs2
-rw-r--r--p2p/src/monitor.rs8
-rw-r--r--p2p/src/peer/mod.rs4
-rw-r--r--p2p/src/peer/peer_id.rs2
-rw-r--r--p2p/src/peer_pool.rs4
-rw-r--r--p2p/src/protocol.rs6
-rw-r--r--p2p/src/protocols/ping.rs4
-rw-r--r--p2p/src/routing_table/entry.rs2
-rw-r--r--p2p/src/routing_table/mod.rs4
-rw-r--r--p2p/src/slots.rs2
-rw-r--r--p2p/src/tls_config.rs2
-rw-r--r--p2p/src/version.rs4
23 files changed, 46 insertions, 46 deletions
diff --git a/p2p/src/backend.rs b/p2p/src/backend.rs
index f0740b1..703e7de 100644
--- a/p2p/src/backend.rs
+++ b/p2p/src/backend.rs
@@ -2,7 +2,7 @@ use std::sync::Arc;
use log::info;
-use karyons_core::{crypto::KeyPair, pubsub::Subscription, GlobalExecutor};
+use karyon_core::{crypto::KeyPair, pubsub::Subscription, GlobalExecutor};
use crate::{
config::Config,
diff --git a/p2p/src/codec.rs b/p2p/src/codec.rs
index e521824..726a2f7 100644
--- a/p2p/src/codec.rs
+++ b/p2p/src/codec.rs
@@ -2,12 +2,12 @@ use std::time::Duration;
use bincode::{Decode, Encode};
-use karyons_core::{
+use karyon_core::{
async_util::timeout,
util::{decode, encode, encode_into_slice},
};
-use karyons_net::{Connection, NetError};
+use karyon_net::{Connection, NetError};
use crate::{
message::{NetMsg, NetMsgCmd, NetMsgHeader, MAX_ALLOWED_MSG_SIZE, MSG_HEADER_SIZE},
diff --git a/p2p/src/config.rs b/p2p/src/config.rs
index 2c5d5ec..fffbebd 100644
--- a/p2p/src/config.rs
+++ b/p2p/src/config.rs
@@ -1,4 +1,4 @@
-use karyons_net::{Endpoint, Port};
+use karyon_net::{Endpoint, Port};
use crate::Version;
diff --git a/p2p/src/connection.rs b/p2p/src/connection.rs
index e0a3bbd..9fa57cb 100644
--- a/p2p/src/connection.rs
+++ b/p2p/src/connection.rs
@@ -2,8 +2,8 @@ use std::{collections::VecDeque, fmt, sync::Arc};
use smol::{channel::Sender, lock::Mutex};
-use karyons_core::async_util::CondVar;
-use karyons_net::Conn;
+use karyon_core::async_util::CondVar;
+use karyon_net::Conn;
use crate::Result;
diff --git a/p2p/src/connector.rs b/p2p/src/connector.rs
index 835b1c9..12fbaed 100644
--- a/p2p/src/connector.rs
+++ b/p2p/src/connector.rs
@@ -2,12 +2,12 @@ use std::{future::Future, sync::Arc};
use log::{error, trace, warn};
-use karyons_core::{
+use karyon_core::{
async_util::{Backoff, TaskGroup, TaskResult},
crypto::KeyPair,
GlobalExecutor,
};
-use karyons_net::{dial, tls, Conn, Endpoint, NetError};
+use karyon_net::{dial, tls, Conn, Endpoint, NetError};
use crate::{
monitor::{ConnEvent, Monitor},
@@ -146,6 +146,6 @@ impl Connector {
} else {
dial(endpoint).await
}
- .map_err(Error::KaryonsNet)
+ .map_err(Error::KaryonNet)
}
}
diff --git a/p2p/src/discovery/lookup.rs b/p2p/src/discovery/lookup.rs
index aefc3a0..1d73306 100644
--- a/p2p/src/discovery/lookup.rs
+++ b/p2p/src/discovery/lookup.rs
@@ -5,9 +5,9 @@ use log::{error, trace};
use rand::{rngs::OsRng, seq::SliceRandom, RngCore};
use smol::lock::{Mutex, RwLock};
-use karyons_core::{async_util::timeout, crypto::KeyPair, util::decode, GlobalExecutor};
+use karyon_core::{async_util::timeout, crypto::KeyPair, util::decode, GlobalExecutor};
-use karyons_net::{Conn, Endpoint};
+use karyon_net::{Conn, Endpoint};
use crate::{
codec::Codec,
diff --git a/p2p/src/discovery/mod.rs b/p2p/src/discovery/mod.rs
index 8091991..040a415 100644
--- a/p2p/src/discovery/mod.rs
+++ b/p2p/src/discovery/mod.rs
@@ -7,13 +7,13 @@ use log::{error, info};
use rand::{rngs::OsRng, seq::SliceRandom};
use smol::lock::Mutex;
-use karyons_core::{
+use karyon_core::{
async_util::{Backoff, TaskGroup, TaskResult},
crypto::KeyPair,
GlobalExecutor,
};
-use karyons_net::{Conn, Endpoint};
+use karyon_net::{Conn, Endpoint};
use crate::{
config::Config,
diff --git a/p2p/src/discovery/refresh.rs b/p2p/src/discovery/refresh.rs
index 180ac27..ed111fb 100644
--- a/p2p/src/discovery/refresh.rs
+++ b/p2p/src/discovery/refresh.rs
@@ -9,13 +9,13 @@ use smol::{
Timer,
};
-use karyons_core::{
+use karyon_core::{
async_util::{timeout, Backoff, TaskGroup, TaskResult},
util::{decode, encode},
GlobalExecutor,
};
-use karyons_net::{dial_udp, listen_udp, Addr, Connection, Endpoint, NetError, Port, UdpConn};
+use karyon_net::{dial_udp, listen_udp, Addr, Connection, Endpoint, NetError, Port, UdpConn};
/// Maximum failures for an entry before removing it from the routing table.
pub const MAX_FAILURES: u32 = 3;
@@ -200,7 +200,7 @@ impl RefreshService {
while retry < self.config.refresh_connect_retries {
match self.send_ping_msg(&conn).await {
Ok(()) => return Ok(()),
- Err(Error::KaryonsNet(NetError::Timeout)) => {
+ Err(Error::KaryonNet(NetError::Timeout)) => {
retry += 1;
backoff.sleep().await;
}
diff --git a/p2p/src/error.rs b/p2p/src/error.rs
index 6274d4c..11de0f1 100644
--- a/p2p/src/error.rs
+++ b/p2p/src/error.rs
@@ -2,7 +2,7 @@ use thiserror::Error as ThisError;
pub type Result<T> = std::result::Result<T, Error>;
-/// Represents karyons's p2p Error.
+/// Represents karyon's p2p Error.
#[derive(ThisError, Debug)]
pub enum Error {
#[error(transparent)]
@@ -75,10 +75,10 @@ pub enum Error {
ChannelRecv(#[from] smol::channel::RecvError),
#[error(transparent)]
- KaryonsCore(#[from] karyons_core::error::Error),
+ KaryonCore(#[from] karyon_core::error::Error),
#[error(transparent)]
- KaryonsNet(#[from] karyons_net::NetError),
+ KaryonNet(#[from] karyon_net::NetError),
}
impl<T> From<smol::channel::SendError<T>> for Error {
diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs
index 39f4bc1..3605359 100644
--- a/p2p/src/lib.rs
+++ b/p2p/src/lib.rs
@@ -7,8 +7,8 @@
//! use easy_parallel::Parallel;
//! use smol::{channel as smol_channel, future, Executor};
//!
-//! use karyons_core::crypto::{KeyPair, KeyPairType};
-//! use karyons_p2p::{Backend, Config, PeerID};
+//! use karyon_core::crypto::{KeyPair, KeyPairType};
+//! use karyon_p2p::{Backend, Config, PeerID};
//!
//! let key_pair = KeyPair::generate(&KeyPairType::Ed25519);
//!
diff --git a/p2p/src/listener.rs b/p2p/src/listener.rs
index 416a0d4..ab6f7c1 100644
--- a/p2p/src/listener.rs
+++ b/p2p/src/listener.rs
@@ -2,13 +2,13 @@ use std::{future::Future, sync::Arc};
use log::{debug, error, info};
-use karyons_core::{
+use karyon_core::{
async_util::{TaskGroup, TaskResult},
crypto::KeyPair,
GlobalExecutor,
};
-use karyons_net::{listen, tls, Conn, ConnListener, Endpoint};
+use karyon_net::{listen, tls, Conn, ConnListener, Endpoint};
use crate::{
monitor::{ConnEvent, Monitor},
@@ -159,6 +159,6 @@ impl Listener {
} else {
listen(endpoint).await
}
- .map_err(Error::KaryonsNet)
+ .map_err(Error::KaryonNet)
}
}
diff --git a/p2p/src/message.rs b/p2p/src/message.rs
index 6b23322..1342110 100644
--- a/p2p/src/message.rs
+++ b/p2p/src/message.rs
@@ -2,7 +2,7 @@ use std::collections::HashMap;
use bincode::{Decode, Encode};
-use karyons_net::{Addr, Port};
+use karyon_net::{Addr, Port};
use crate::{protocol::ProtocolID, routing_table::Entry, version::VersionInt, PeerID};
diff --git a/p2p/src/monitor.rs b/p2p/src/monitor.rs
index 1ea6a0b..b0ce028 100644
--- a/p2p/src/monitor.rs
+++ b/p2p/src/monitor.rs
@@ -2,9 +2,9 @@ use std::fmt;
use crate::PeerID;
-use karyons_core::pubsub::{ArcPublisher, Publisher, Subscription};
+use karyon_core::pubsub::{ArcPublisher, Publisher, Subscription};
-use karyons_net::Endpoint;
+use karyon_net::Endpoint;
/// Responsible for network and system monitoring.
///
@@ -17,8 +17,8 @@ use karyons_net::Endpoint;
///
/// use smol::Executor;
///
-/// use karyons_core::crypto::{KeyPair, KeyPairType};
-/// use karyons_p2p::{Config, Backend, PeerID};
+/// use karyon_core::crypto::{KeyPair, KeyPairType};
+/// use karyon_p2p::{Config, Backend, PeerID};
///
/// async {
///
diff --git a/p2p/src/peer/mod.rs b/p2p/src/peer/mod.rs
index 37c0e2a..1e98f1b 100644
--- a/p2p/src/peer/mod.rs
+++ b/p2p/src/peer/mod.rs
@@ -10,14 +10,14 @@ use smol::{
lock::RwLock,
};
-use karyons_core::{
+use karyon_core::{
async_util::{select, Either, TaskGroup, TaskResult},
event::{ArcEventSys, EventListener, EventSys},
util::{decode, encode},
GlobalExecutor,
};
-use karyons_net::Endpoint;
+use karyon_net::Endpoint;
use crate::{
codec::{Codec, CodecMsg},
diff --git a/p2p/src/peer/peer_id.rs b/p2p/src/peer/peer_id.rs
index 0208e05..f907aa7 100644
--- a/p2p/src/peer/peer_id.rs
+++ b/p2p/src/peer/peer_id.rs
@@ -2,7 +2,7 @@ use bincode::{Decode, Encode};
use rand::{rngs::OsRng, RngCore};
use sha2::{Digest, Sha256};
-use karyons_core::crypto::PublicKey;
+use karyon_core::crypto::PublicKey;
use crate::Error;
diff --git a/p2p/src/peer_pool.rs b/p2p/src/peer_pool.rs
index ee9ebf9..ead6d8f 100644
--- a/p2p/src/peer_pool.rs
+++ b/p2p/src/peer_pool.rs
@@ -10,13 +10,13 @@ use smol::{
lock::{Mutex, RwLock},
};
-use karyons_core::{
+use karyon_core::{
async_util::{TaskGroup, TaskResult},
util::decode,
GlobalExecutor,
};
-use karyons_net::Conn;
+use karyon_net::Conn;
use crate::{
codec::{Codec, CodecMsg},
diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs
index 7261f19..f28659c 100644
--- a/p2p/src/protocol.rs
+++ b/p2p/src/protocol.rs
@@ -2,7 +2,7 @@ use std::sync::Arc;
use async_trait::async_trait;
-use karyons_core::event::EventValue;
+use karyon_core::event::EventValue;
use crate::{peer::ArcPeer, version::Version, Result};
@@ -37,8 +37,8 @@ impl EventValue for ProtocolEvent {
/// use async_trait::async_trait;
/// use smol::Executor;
///
-/// use karyons_core::crypto::{KeyPair, KeyPairType};
-/// use karyons_p2p::{
+/// use karyon_core::crypto::{KeyPair, KeyPairType};
+/// use karyon_p2p::{
/// protocol::{ArcProtocol, Protocol, ProtocolID, ProtocolEvent},
/// Backend, PeerID, Config, Version, P2pError, ArcPeer};
///
diff --git a/p2p/src/protocols/ping.rs b/p2p/src/protocols/ping.rs
index ec7afe2..22c1b3d 100644
--- a/p2p/src/protocols/ping.rs
+++ b/p2p/src/protocols/ping.rs
@@ -11,14 +11,14 @@ use smol::{
Timer,
};
-use karyons_core::{
+use karyon_core::{
async_util::{select, timeout, Either, TaskGroup, TaskResult},
event::EventListener,
util::decode,
GlobalExecutor,
};
-use karyons_net::NetError;
+use karyon_net::NetError;
use crate::{
peer::ArcPeer,
diff --git a/p2p/src/routing_table/entry.rs b/p2p/src/routing_table/entry.rs
index c5fa65d..3fc8a6b 100644
--- a/p2p/src/routing_table/entry.rs
+++ b/p2p/src/routing_table/entry.rs
@@ -1,6 +1,6 @@
use bincode::{Decode, Encode};
-use karyons_net::{Addr, Port};
+use karyon_net::{Addr, Port};
/// Specifies the size of the key, in bytes.
pub const KEY_SIZE: usize = 32;
diff --git a/p2p/src/routing_table/mod.rs b/p2p/src/routing_table/mod.rs
index cfc3128..6854546 100644
--- a/p2p/src/routing_table/mod.rs
+++ b/p2p/src/routing_table/mod.rs
@@ -11,7 +11,7 @@ pub use entry::{xor_distance, Entry, Key};
use rand::{rngs::OsRng, seq::SliceRandom};
-use karyons_net::Addr;
+use karyon_net::Addr;
use bucket::BUCKET_SIZE;
use entry::KEY_SIZE;
@@ -284,7 +284,7 @@ mod tests {
use super::bucket::ALL_ENTRY;
use super::*;
- use karyons_net::Addr;
+ use karyon_net::Addr;
struct Setup {
local_key: Key,
diff --git a/p2p/src/slots.rs b/p2p/src/slots.rs
index d3a1d0a..0ee0b93 100644
--- a/p2p/src/slots.rs
+++ b/p2p/src/slots.rs
@@ -1,6 +1,6 @@
use std::sync::atomic::{AtomicUsize, Ordering};
-use karyons_core::async_util::CondWait;
+use karyon_core::async_util::CondWait;
/// Manages available inbound and outbound slots.
pub struct ConnectionSlots {
diff --git a/p2p/src/tls_config.rs b/p2p/src/tls_config.rs
index 5d5e90e..9fe64f5 100644
--- a/p2p/src/tls_config.rs
+++ b/p2p/src/tls_config.rs
@@ -8,7 +8,7 @@ use async_rustls::rustls::{
use log::error;
use x509_parser::{certificate::X509Certificate, parse_x509_certificate};
-use karyons_core::crypto::{KeyPair, KeyPairType, PublicKey};
+use karyon_core::crypto::{KeyPair, KeyPairType, PublicKey};
use crate::{PeerID, Result};
diff --git a/p2p/src/version.rs b/p2p/src/version.rs
index a101b28..f5cc1d6 100644
--- a/p2p/src/version.rs
+++ b/p2p/src/version.rs
@@ -5,12 +5,12 @@ use semver::VersionReq;
use crate::{Error, Result};
-/// Represents the network version and protocol version used in karyons p2p.
+/// Represents the network version and protocol version used in karyon p2p.
///
/// # Example
///
/// ```
-/// use karyons_p2p::Version;
+/// use karyon_p2p::Version;
///
/// let version: Version = "0.2.0, >0.1.0".parse().unwrap();
///