Skip to content

Commit

Permalink
Move mananger again out of network behaviour, add replication service
Browse files Browse the repository at this point in the history
  • Loading branch information
adzialocha committed May 23, 2023
1 parent e73c3a7 commit 3bd31c4
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 236 deletions.
11 changes: 1 addition & 10 deletions aquadoggo/src/network/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ use libp2p::swarm::NetworkBehaviour;
use libp2p::{autonat, connection_limits, identify, mdns, ping, relay, rendezvous, PeerId};
use log::debug;

use crate::bus::ServiceSender;
use crate::db::SqlStore;
use crate::network::config::NODE_NAMESPACE;
use crate::network::replication;
use crate::network::NetworkConfiguration;
use crate::replication::SyncIngest;
use crate::schema::SchemaProvider;

/// Network behaviour for the aquadoggo node.
#[derive(NetworkBehaviour)]
Expand Down Expand Up @@ -60,9 +56,6 @@ impl Behaviour {
pub fn new(
network_config: &NetworkConfiguration,
peer_id: PeerId,
store: &SqlStore,
schema_provider: &SchemaProvider,
tx: ServiceSender,
key_pair: Keypair,
relay_client: Option<relay::client::Behaviour>,
) -> Result<Self> {
Expand Down Expand Up @@ -143,9 +136,7 @@ impl Behaviour {
None
};

let ingest = SyncIngest::new(schema_provider.clone(), tx);
let replication =
replication::Behaviour::new(store, ingest, schema_provider.clone(), &peer_id);
let replication = replication::Behaviour::new();

Ok(Self {
autonat: autonat.into(),
Expand Down
Loading

0 comments on commit 3bd31c4

Please sign in to comment.