Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log all messages received #6

Open
atoulme opened this issue Sep 17, 2019 · 6 comments
Open

Log all messages received #6

atoulme opened this issue Sep 17, 2019 · 6 comments

Comments

@atoulme
Copy link
Contributor

atoulme commented Sep 17, 2019

Upon receiving a message, the program should increase its number of hops. It should then log to stdout the contents of the message. The log line should be timestamped.

@araskachoi
Copy link
Contributor

araskachoi commented Sep 25, 2019

will need to have these fields in the log:

  • Message type - topic of the message
  • Message origin - sending address
  • Message destination - receiving address
  • Last relaying node - the previous node that sent the message
  • Message nonce - chronology of the sent message
  • Message size - the message size will be in bytes
  • MessageID - unique string associated with that message
  • HopCount - number of hops the message had to make in order to reach its destination

@adam-hanna
Copy link

adam-hanna commented Sep 25, 2019

@araskachoi regarding hop count, how can I add 1 to the message hop count before sending to the next subscriber?

Did you implement that functionality in your original implementation? If so, could you point me to the line in your code, please?

Here's the TODO in mine:
https://github.com/agencyenterprise/gossip-host/blob/dab11fd173ae02f9004ebc78ffa45c11a5c24521/internal/host/pubsub.go#L28

@araskachoi
Copy link
Contributor

We did not have this implemented inside ours. I found this which might be what we need
https://github.com/libp2p/go-libp2p/blob/master/p2p/host/relay/autorelay.go#L175

If this does not give what we need, we can just implement this in our application logic to trace the previous sender and keep tracing it back to the origin, which will be the number of hops. Doing it retroactively like this will be tedious and computationally exhaustive but cannot be helped if all other options do not work.

@araskachoi
Copy link
Contributor

We will need to ask PL if we can alter the source code to make sure that we can edit the message struct to increase the hop count. @adam-hanna will ask PL about this and update on what they say!

@adam-hanna
Copy link

I asked this question to Steve Allen yesterday, along with asking for his signoff on our host implementation. I'll revert when he responds.

We can always just do this via our analysis layer. I don't think it'll be necessary to edit the PL gossip library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants