Skip to content

Commit

Permalink
Bump protocol versions to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Wiezzel committed May 16, 2024
1 parent 784430b commit 7412a2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions transport/src/behaviour/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl BaseBehaviour {
self.inner.allow.allow_peer(peer_id);
}

// TODO: Refactor into a separate behaviour to reuse in bootnode
fn on_nodes_update(&mut self, result: Result<HashSet<PeerId>, contract_client::ClientError>) {
let nodes = match result {
Err(e) => {
Expand Down
4 changes: 2 additions & 2 deletions transport/src/bin/bootnode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use libp2p_swarm_derive::NetworkBehaviour;
use tokio::signal::unix::{signal, SignalKind};

use subsquid_network_transport::{
protocol::dht_protocol,
protocol::{dht_protocol, ID_PROTOCOL},
util::{addr_is_reachable, get_keypair},
BootNode, Keypair, QuicConfig, TransportArgs,
};
Expand Down Expand Up @@ -69,7 +69,7 @@ async fn main() -> anyhow::Result<()> {
kad_config.set_replication_factor(20.try_into().unwrap());
let behaviour = |keypair: &Keypair| Behaviour {
identify: identify::Behaviour::new(
identify::Config::new("/subsquid/0.0.1".to_string(), keypair.public())
identify::Config::new(ID_PROTOCOL.to_string(), keypair.public())
.with_interval(Duration::from_secs(60))
.with_push_listen_addr_updates(true),
),
Expand Down
14 changes: 7 additions & 7 deletions transport/src/protocol.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use contract_client::Network;
use libp2p::StreamProtocol;

pub const PING_TOPIC: &str = "/subsquid/worker_pings/0.0.1";
pub const LOGS_TOPIC: &str = "/subsquid/worker_query_logs/0.0.1";
pub const ID_PROTOCOL: StreamProtocol = StreamProtocol::new("/subsquid/0.0.1");
pub const QUERY_PROTOCOL: &str = "/subsquid/query/0.0.1";
pub const GATEWAY_LOGS_PROTOCOL: &str = "/subsquid/gateway-logs/0.0.1";
pub const WORKER_LOGS_PROTOCOL: &str = "/subsquid/worker-logs/0.0.1";
pub const PONG_PROTOCOL: &str = "/subsquid/pong/0.0.1";
pub const PING_TOPIC: &str = "/subsquid/worker_pings/1.0.0";
pub const LOGS_TOPIC: &str = "/subsquid/worker_query_logs/1.0.0";
pub const ID_PROTOCOL: &str = "/subsquid/1.0.0";
pub const QUERY_PROTOCOL: &str = "/subsquid/query/1.0.0";
pub const GATEWAY_LOGS_PROTOCOL: &str = "/subsquid/gateway-logs/1.0.0";
pub const WORKER_LOGS_PROTOCOL: &str = "/subsquid/worker-logs/1.0.0";
pub const PONG_PROTOCOL: &str = "/subsquid/pong/1.0.0";

pub const MAX_QUERY_SIZE: u64 = 1024 * 1024;
pub const MAX_QUERY_RESULT_SIZE: u64 = 100 * 1024 * 1024;
Expand Down

0 comments on commit 7412a2c

Please sign in to comment.