Add custom inactivity timeout to gossipsub

This commit is contained in:
Age Manning 2019-04-03 17:16:32 +11:00
parent 2d710f19fc
commit be6ebb5ffa
No known key found for this signature in database
GPG Key ID: 05EED64B79E06A93

View File

@ -1,8 +1,8 @@
use clap::ArgMatches; use clap::ArgMatches;
use libp2p::gossipsub::{GossipsubConfig, GossipsubConfigBuilder}; use libp2p::gossipsub::{GossipsubConfig, GossipsubConfigBuilder};
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use std::time::Duration;
use types::multiaddr::{Error as MultiaddrError, Multiaddr}; use types::multiaddr::{Error as MultiaddrError, Multiaddr};
//use std::time::Duration;
/// The beacon node topic string to subscribe to. /// The beacon node topic string to subscribe to.
pub const BEACON_PUBSUB_TOPIC: &str = "beacon_node"; pub const BEACON_PUBSUB_TOPIC: &str = "beacon_node";
@ -35,7 +35,7 @@ impl Default for Config {
listen_addresses: vec!["/ip4/127.0.0.1/tcp/9000".to_string()], listen_addresses: vec!["/ip4/127.0.0.1/tcp/9000".to_string()],
gs_config: GossipsubConfigBuilder::new() gs_config: GossipsubConfigBuilder::new()
.max_gossip_size(4_000_000) .max_gossip_size(4_000_000)
// .inactivity_timeout(Duration::from_secs(90)) .inactivity_timeout(Duration::from_secs(90))
.build(), .build(),
identify_config: IdentifyConfig::default(), identify_config: IdentifyConfig::default(),
boot_nodes: vec![], boot_nodes: vec![],