Propogate valid attestations accross the network
This commit is contained in:
parent
9c6af0397d
commit
95ce8ca6e6
@ -136,11 +136,10 @@ impl<T: BeaconChainTypes> AttestationService for AttestationServiceInstance<T> {
|
||||
"type" => "valid_attestation",
|
||||
);
|
||||
|
||||
// TODO: Obtain topics from the network service properly.
|
||||
let topic = types::TopicBuilder::new("beacon_chain".to_string()).build();
|
||||
// valid attestation, propagate to the network
|
||||
let topic = types::TopicBuilder::new("attestations".to_string()).build();
|
||||
let message = PubsubMessage::Attestation(attestation);
|
||||
|
||||
// Publish the attestation to the p2p network via gossipsub.
|
||||
self.network_chan
|
||||
.send(NetworkMessage::Publish {
|
||||
topics: vec![topic],
|
||||
@ -150,7 +149,7 @@ impl<T: BeaconChainTypes> AttestationService for AttestationServiceInstance<T> {
|
||||
error!(
|
||||
self.log,
|
||||
"PublishAttestation";
|
||||
"type" => "failed to publish to gossipsub",
|
||||
"type" => "failed to publish attestation to gossipsub",
|
||||
"error" => format!("{:?}", e)
|
||||
);
|
||||
});
|
||||
|
@ -60,6 +60,7 @@ pub fn start_server<T: BeaconChainTypes + Clone + 'static>(
|
||||
};
|
||||
let attestation_service = {
|
||||
let instance = AttestationServiceInstance {
|
||||
network_chan,
|
||||
chain: beacon_chain.clone(),
|
||||
network_chan,
|
||||
log: log.clone(),
|
||||
|
Loading…
Reference in New Issue
Block a user