Skip to content

Commit

Permalink
provide wasm compatibility for gossipsub protocol
Browse files Browse the repository at this point in the history
Signed-off-by: ozkanonur <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed May 22, 2023
1 parent 9867fce commit 9d1a36f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ repository = "https://github.com/libp2p/rust-libp2p"
keywords = ["peer-to-peer", "libp2p", "networking"]
categories = ["network-programming", "asynchronous"]

[features]
wasm-bindgen = ["getrandom/js", "instant/wasm-bindgen"]

[dependencies]
either = "1.5"
libp2p-swarm = { workspace = true }
Expand All @@ -36,6 +39,7 @@ instant = "0.1.11"
void = "1.0.2"
# Metrics dependencies
prometheus-client = "0.21.0"
getrandom = "0.2.9"

[dev-dependencies]
async-std = { version = "1.6.3", features = ["unstable"] }
Expand Down
2 changes: 1 addition & 1 deletion protocols/gossipsub/src/peer_score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
use crate::metrics::{Metrics, Penalty};
use crate::time_cache::TimeCache;
use crate::{MessageId, TopicHash};
use instant::Instant;
use libp2p_identity::PeerId;
use log::{debug, trace, warn};
use std::collections::{hash_map, HashMap, HashSet};
use std::net::IpAddr;
use std::time::Duration;
use wasm_timer::Instant;

mod params;
use crate::ValidationError;
Expand Down

0 comments on commit 9d1a36f

Please sign in to comment.