-
I am working on p2p search engine, and every search request cannot be unique. In chat example message id is calculated with hash function: let message_id_fn = |message: &gossipsub::Message| {
let mut s = DefaultHasher::new();
message.data.hash(&mut s);
gossipsub::MessageId::from(s.finish().to_string())
}; So, what i should do? Maybe generate random string? |
Beta Was this translation helpful? Give feedback.
Answered by
dariusc93
Jun 13, 2023
Replies: 1 comment 1 reply
-
Assuming I am understanding your question, you can remove the config entry for computing the id so it would use the default which is located rust-libp2p/protocols/gossipsub/src/config.rs Lines 412 to 425 in c93f753 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming I am understanding your question, you can remove the config entry for computing the id so it would use the default which is located
rust-libp2p/protocols/gossipsub/src/config.rs
Lines 412 to 425 in c93f753