-
Notifications
You must be signed in to change notification settings - Fork 724
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3342: CAD-3638: extended trace-forward library. r=denisshevchenko a=denisshevchenko Since both `trace-forward` and `datapoint-forward` specify node-specific protocols, it's better to combine them into one package. This package will be used by `trace-dispatcher` library for forwarding `TraceObject`s and `DataPoint`s from the node to external acceptor app (for example, `cardano-tracer` or `cardano-wallet`). Co-authored-by: Denis Shevchenko <denis.shevchenko@iohk.io>
- Loading branch information
Showing
40 changed files
with
1,424 additions
and
847 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
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 was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
trace-forward/src/Trace/Forward/Configuration/DataPoint.hs
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,31 @@ | ||
module Trace.Forward.Configuration.DataPoint | ||
( AcceptorConfiguration (..) | ||
, ForwarderConfiguration (..) | ||
) where | ||
|
||
import Control.Concurrent.STM.TVar (TVar) | ||
import Control.Tracer (Tracer) | ||
|
||
import Ouroboros.Network.Driver (TraceSendRecv) | ||
|
||
import Trace.Forward.Protocol.DataPoint.Type | ||
|
||
-- | Acceptor configuration, parameterized by trace item's type. | ||
data AcceptorConfiguration = AcceptorConfiguration | ||
{ -- | The tracer that will be used by the acceptor in its network layer. | ||
acceptorTracer :: !(Tracer IO (TraceSendRecv DataPointForward)) | ||
-- | The endpoint that will be used to listen to the forwarder. | ||
, forwarderEndpoint :: !FilePath | ||
-- | 'TVar' that can be used as a brake: if an external thread sets | ||
-- it to 'True', the acceptor will send 'MsgDone' message to the | ||
-- forwarder and their session will be closed. | ||
, shouldWeStop :: !(TVar Bool) | ||
} | ||
|
||
-- | Forwarder configuration, parameterized by trace item's type. | ||
data ForwarderConfiguration = ForwarderConfiguration | ||
{ -- | The tracer that will be used by the forwarder in its network layer. | ||
forwarderTracer :: !(Tracer IO (TraceSendRecv DataPointForward)) | ||
-- | The endpoint that will be used to connect to the acceptor. | ||
, acceptorEndpoint :: !FilePath | ||
} |
27 changes: 12 additions & 15 deletions
27
...orward/src/Trace/Forward/Configuration.hs → ...race/Forward/Configuration/TraceObject.hs
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.