From d1c816660c0583db33d160e2ef3e980bef0d5a85 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Mon, 27 May 2024 00:59:23 +0200 Subject: p2p: WIP rpc server implementation for the p2p monitor --- p2p/src/peer/peer_id.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'p2p/src/peer') 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 { -- cgit v1.2.3