diff options
author | hozan23 <hozan23@karyontech.net> | 2024-05-20 12:52:21 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-05-20 12:52:21 +0200 |
commit | 64c23e7425b277729170356e618b6e1a763962dc (patch) | |
tree | 2ad1519cc5a88209c9804f600ca53a4a7cc420dd /p2p/src | |
parent | 97629ecb9e4723e5b30b08e757ac3478f9a8746a (diff) |
p2p: rexport keypair module from karyon_core
Diffstat (limited to 'p2p/src')
-rw-r--r-- | p2p/src/lib.rs | 8 | ||||
-rw-r--r-- | p2p/src/monitor.rs | 3 | ||||
-rw-r--r-- | p2p/src/protocol.rs | 5 |
3 files changed, 9 insertions, 7 deletions
diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs index fc2c26d..c873980 100644 --- a/p2p/src/lib.rs +++ b/p2p/src/lib.rs @@ -7,9 +7,9 @@ //! use easy_parallel::Parallel; //! use smol::{future, Executor}; //! -//! use karyon_core::crypto::{KeyPair, KeyPairType}; -//! use karyon_p2p::{Backend, Config, PeerID}; +//! use karyon_p2p::{Backend, Config, PeerID, keypair::{KeyPair, KeyPairType}}; //! +//! // Generate a new keypair for the peer //! let key_pair = KeyPair::generate(&KeyPairType::Ed25519); //! //! // Create the configuration for the backend. @@ -23,7 +23,9 @@ //! //! let task = async { //! // Run the backend -//! backend.run().await.unwrap(); +//! backend.run() +//! .await +//! .expect("start the backend"); //! //! // .... //! diff --git a/p2p/src/monitor.rs b/p2p/src/monitor.rs index 48719c0..cbbd40c 100644 --- a/p2p/src/monitor.rs +++ b/p2p/src/monitor.rs @@ -17,8 +17,7 @@ use karyon_net::Endpoint; /// /// use smol::Executor; /// -/// use karyon_core::crypto::{KeyPair, KeyPairType}; -/// use karyon_p2p::{Config, Backend, PeerID}; +/// use karyon_p2p::{Config, Backend, PeerID, keypair::{KeyPair, KeyPairType}}; /// /// async { /// diff --git a/p2p/src/protocol.rs b/p2p/src/protocol.rs index 6153ea1..951040b 100644 --- a/p2p/src/protocol.rs +++ b/p2p/src/protocol.rs @@ -37,10 +37,11 @@ impl EventValue for ProtocolEvent { /// use async_trait::async_trait; /// use smol::Executor; /// -/// use karyon_core::crypto::{KeyPair, KeyPairType}; /// use karyon_p2p::{ /// protocol::{ArcProtocol, Protocol, ProtocolID, ProtocolEvent}, -/// Backend, PeerID, Config, Version, P2pError, ArcPeer}; +/// Backend, PeerID, Config, Version, P2pError, ArcPeer, +/// keypair::{KeyPair, KeyPairType}, +/// }; /// /// pub struct NewProtocol { /// peer: ArcPeer, |