Add PubsubMessage and publish function to behaviour

This commit is contained in:
Age Manning
2019-03-25 22:00:11 +11:00
parent 214fb5b8ff
commit 05369df7e8
6 changed files with 78 additions and 12 deletions

View File

@@ -9,6 +9,7 @@ use slog::Logger;
#[derive(Clone)]
pub struct BeaconBlockServiceInstance {
network_chan: crossbeam_channel::Sender<NetworkMessage>,
pub log: Logger,
}
@@ -43,7 +44,15 @@ impl BeaconBlockService for BeaconBlockServiceInstance {
req: PublishBeaconBlockRequest,
sink: UnarySink<PublishBeaconBlockResponse>,
) {
println!("publishing {:?}", req.get_block());
let block = req.get_block();
println!("publishing {:?}", block);
// TODO: Build properly
let topic = types::TopicBuilder::
println!("Sending beacon block to gossipsub");
network_chan.send(NetworkMessage::Publish(
// TODO: actually process the block.
let mut resp = PublishBeaconBlockResponse::new();