Skip to content

Commit

Permalink
chore: small doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdud007 committed Apr 24, 2024
1 parent 14f439a commit da9e4f5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/common/src/network.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
Network
This defines the network that the node is connected to.
*/

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Network {
Mainnet,
Expand Down
8 changes: 8 additions & 0 deletions crates/common/src/topic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ use libp2p::gossipsub::IdentTopic;

use crate::network::Network;

/*
Topic
This defines the topic of the message used in the gossipsub protocol.
The topic is used to filter messages and route them to the correct subscribers.
`NewJob` is used to notify the network of a new job from Delegator to Executor.
`PickedJob` is used to notify the network of a job that has been picked up by an Executor.
*/

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Topic {
NewJob,
Expand Down

0 comments on commit da9e4f5

Please sign in to comment.