diff --git a/build.rs b/build.rs index f70a2798..0f4a0aa3 100644 --- a/build.rs +++ b/build.rs @@ -4,6 +4,7 @@ fn main() -> Result<(), Box> { // Custom type attributes required for malachite builder = builder.type_attribute("snapchain.ShardHash", "#[derive(Eq, PartialOrd, Ord)]"); + // TODO: auto-discover proto files builder.compile(&[ "src/proto/blocks.proto", "src/proto/rpc.proto", diff --git a/src/main.rs b/src/main.rs index fbce9d94..48eb67bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,6 @@ pub mod core; pub mod network; pub mod connectors; mod cfg; -mod server; use std::error::Error; use std::io; @@ -16,7 +15,7 @@ use malachite_metrics::{Metrics, SharedRegistry}; use prost::Message; use std::time::Duration; use tokio::signal::ctrl_c; -use tokio::sync::{mpsc}; +use tokio::sync::mpsc; use tokio::{select, time}; use tokio::time::sleep; use tonic::transport::Server; @@ -27,10 +26,10 @@ use connectors::fname::Fetcher; use crate::consensus::consensus::{Consensus, ConsensusMsg, ConsensusParams}; use crate::core::types::{proto, Address, Height, ShardId, SnapchainContext, SnapchainShard, SnapchainValidator, SnapchainValidatorContext, SnapchainValidatorSet}; -use crate::network::gossip::{GossipEvent}; +use crate::network::gossip::GossipEvent; use network::gossip::SnapchainGossip; -use crate::server::{MySnapchainService}; -use crate::server::rpc::snapchain_service_server::SnapchainServiceServer; +use network::server::MySnapchainService; +use network::server::rpc::snapchain_service_server::SnapchainServiceServer; pub enum SystemMessage { Consensus(ConsensusMsg), diff --git a/src/network/mod.rs b/src/network/mod.rs index e6491174..964676ec 100644 --- a/src/network/mod.rs +++ b/src/network/mod.rs @@ -1 +1,2 @@ pub mod gossip; +pub mod server; diff --git a/src/server.rs b/src/network/server.rs similarity index 100% rename from src/server.rs rename to src/network/server.rs