Implement initial pubsub message handling

This commit is contained in:
Age Manning
2019-03-25 23:02:51 +11:00
parent 05369df7e8
commit 52b31b2009
9 changed files with 95 additions and 51 deletions

View File

@@ -7,6 +7,7 @@ edition = "2018"
[dependencies]
bls = { path = "../../eth2/utils/bls" }
beacon_chain = { path = "../beacon_chain" }
network = { path = "../network" }
version = { path = "../version" }
types = { path = "../../eth2/types" }
ssz = { path = "../../eth2/utils/ssz" }
@@ -23,3 +24,4 @@ slog-term = "^2.4.0"
slog-async = "^2.3.0"
tokio = "0.1.17"
exit-future = "0.1.4"
crossbeam-channel = "0.3.8"

View File

@@ -6,6 +6,8 @@ use protos::services::{
};
use protos::services_grpc::BeaconBlockService;
use slog::Logger;
use crossbeam_channel;
use network::NetworkMessage;
#[derive(Clone)]
pub struct BeaconBlockServiceInstance {
@@ -48,8 +50,8 @@ impl BeaconBlockService for BeaconBlockServiceInstance {
println!("publishing {:?}", block);
// TODO: Build properly
let topic = types::TopicBuilder::
// TODO: Obtain from the network properly.
let topic = types::TopicBuilder::from("beacon_chain").build();
println!("Sending beacon block to gossipsub");
network_chan.send(NetworkMessage::Publish(