-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…1440) * feat(event): add p2p events to `events` and event bus to `QriNode` Also updates all tests to new `NewQriNode` api that requires an event bus. Most tests now use `event.NilBus` * test(p2p events): ensure events published by `QriNode` are firing Commit also includes notes of which events are not currently ever implemented to fire. These events will be added in a follow up pr.
- Loading branch information
Showing
23 changed files
with
117 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package event | ||
|
||
var ( | ||
// ETP2PGoneOnline occurs when a p2p node opens up for peer-2-peer connections | ||
// payload will be []multiaddr.Addr, the listening addresses of this peer | ||
ETP2PGoneOnline = Type("p2p:GoneOnline") | ||
// ETP2PGoneOffline occurs when a p2p node has finished disconnecting from | ||
// a peer-2-peer network | ||
// payload will be nil | ||
// NOTE: not currently firing | ||
ETP2PGoneOffline = Type("p2p:GoneOffline") | ||
// ETP2PQriPeerConnected occurs after a qri peer has connected to this node | ||
// payload will be a fully hydrated *profile.Profile from | ||
// "github.com/qri-io/qri/repo/profile" | ||
// NOTE: not currently firing | ||
ETP2PQriPeerConnected = Type("p2p:QriPeerConnected") | ||
// ETP2PQriPeerDisconnected occurs after a qri peer has connected to this node | ||
// payload will be a fully hydrated *profile.Profile from | ||
// "github.com/qri-io/qri/repo/profile" | ||
// NOTE: not currently firing | ||
ETP2PQriPeerDisconnected = Type("p2p:QriPeerDisconnected") | ||
// ETP2PPeerConnected occurs after any peer has connected to this node | ||
// payload will be a libp2p.peerInfo | ||
// NOTE: not currently firing | ||
ETP2PPeerConnected = Type("p2p:PeerConnected") | ||
// ETP2PPeerDisconnected occurs after any peer has connected to this node | ||
// payload will be a libp2p.peerInfo | ||
// NOTE: not currently firing | ||
ETP2PPeerDisconnected = Type("p2p:PeerDisconnected") | ||
// ETP2PMessageReceived fires whenever the p2p protocol receives a message | ||
// from a Qri peer | ||
// payload will be a p2p.Message | ||
// NOTE: not currently firing | ||
ETP2PMessageReceived = Type("p2p:MessageReceived") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.