Complete moving network logc into beacon node

This commit is contained in:
Age Manning
2019-04-03 16:33:12 +11:00
parent 64abd0bc5b
commit 7920f8098f
8 changed files with 23 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
use beacon_chain::{BeaconChain, BeaconChainTypes};
use eth2_libp2p::PubsubMessage;
use eth2_libp2p::TopicBuilder;
use eth2_libp2p::SHARD_TOPIC_PREFIX;
use futures::Future;
use grpcio::{RpcContext, RpcStatus, RpcStatusCode, UnarySink};
use network::NetworkMessage;
@@ -137,11 +138,8 @@ impl<T: BeaconChainTypes> AttestationService for AttestationServiceInstance<T> {
"type" => "valid_attestation",
);
// get the network topic to send on
let topic_string = self.chain.get_spec().shard_topic_prefix.clone();
// valid attestation, propagate to the network
let topic = TopicBuilder::new(topic_string).build();
let topic = TopicBuilder::new(SHARD_TOPIC_PREFIX).build();
let message = PubsubMessage::Attestation(attestation);
self.network_chan

View File

@@ -1,6 +1,7 @@
use beacon_chain::{BeaconChain, BeaconChainTypes, BlockProcessingOutcome};
use crossbeam_channel;
use eth2_libp2p::PubsubMessage;
use eth2_libp2p::BEACON_PUBSUB_TOPIC;
use eth2_libp2p::{PubsubMessage, TopicBuilder};
use futures::Future;
use grpcio::{RpcContext, RpcStatus, RpcStatusCode, UnarySink};
use network::NetworkMessage;
@@ -105,8 +106,7 @@ impl<T: BeaconChainTypes> BeaconBlockService for BeaconBlockServiceInstance<T> {
);
// get the network topic to send on
let topic_string = self.chain.get_spec().beacon_chain_topic.clone();
let topic = types::TopicBuilder::new(topic_string).build();
let topic = TopicBuilder::new(BEACON_PUBSUB_TOPIC).build();
let message = PubsubMessage::Block(block);
// Publish the block to the p2p network via gossipsub.