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

@@ -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(