diff options
author | hozan23 <hozan23@karyontech.net> | 2024-05-27 00:59:23 +0200 |
---|---|---|
committer | hozan23 <hozan23@karyontech.net> | 2024-05-27 00:59:23 +0200 |
commit | d1c816660c0583db33d160e2ef3e980bef0d5a85 (patch) | |
tree | 9eb06e6dbfbe34c6c2f85eee8d2e337b155be103 /p2p/src/peer | |
parent | 385d53ec53e750e342cce78edb793958edf5133e (diff) |
p2p: WIP rpc server implementation for the p2p monitor
Diffstat (limited to 'p2p/src/peer')
-rw-r--r-- | p2p/src/peer/peer_id.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/p2p/src/peer/peer_id.rs b/p2p/src/peer/peer_id.rs index f907aa7..a769c86 100644 --- a/p2p/src/peer/peer_id.rs +++ b/p2p/src/peer/peer_id.rs @@ -2,12 +2,16 @@ use bincode::{Decode, Encode}; use rand::{rngs::OsRng, RngCore}; use sha2::{Digest, Sha256}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + use karyon_core::crypto::PublicKey; use crate::Error; /// Represents a unique identifier for a peer. #[derive(Clone, Debug, Eq, PartialEq, Hash, Decode, Encode)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct PeerID(pub [u8; 32]); impl std::fmt::Display for PeerID { |