Skip to content

Commit fc1f141

Browse files
committed
cardano-tracer: fix RTView build; update docs
1 parent 48c92ee commit fc1f141

File tree

4 files changed

+34
-9
lines changed

4 files changed

+34
-9
lines changed

cardano-tracer/bench/cardano-tracer-bench.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Cardano.Tracer.MetaTrace
1414
import Cardano.Tracer.Types
1515
import Cardano.Tracer.Utils
1616

17+
1718
import Control.Concurrent.Extra (newLock)
1819
#if RTVIEW
1920
import Control.Concurrent.STM.TVar (newTVarIO)
@@ -55,7 +56,7 @@ main = do
5556
currentLogLock <- newLock
5657
currentDPLock <- newLock
5758
#if RTVIEW
58-
eventsQueues <- initEventsQueues Nothing connectedNodesNames dpRequestors currentDPLock
59+
eventsQueues <- initEventsQueues mempty Nothing connectedNodesNames dpRequestors currentDPLock
5960

6061
rtViewPageOpened <- newTVarIO False
6162
#endif

cardano-tracer/docs/cardano-tracer.md

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
- [Build and run](#build-and-run)
1313
- [Configuration](#configuration)
1414
- [Distributed Scenario](#distributed-scenario)
15-
- [Important](#important)
1615
- [Local Scenario](#local-scenario)
16+
- [Forwarding over TCP](#forwarding-over-tcp)
1717
- [Network Magic](#network-magic)
1818
- [Requests](#requests)
1919
- [Logging](#logging)
@@ -27,7 +27,7 @@
2727

2828
## Motivation
2929

30-
Previously, the node handled all the logging by itself. Moreover, it provided monitoring tools as well: two web-servers, for Prometheus and for EKG monitoring page. `cardano-tracer` is a result of _moving_ all the logging/monitoring-related stuff from the node to a separate service. As a result, the node became smaller, faster, and simpler.
30+
Previously, the node handled all the logging by itself. Moreover, it provided monitoring tools as well: two web-servers, for Prometheus and for EKG monitoring page. `cardano-tracer` is a result of _moving_ all logging and monitoring related functionality from the node to a separate service. As a result, the node becomes smaller, more efficient, and simpler.
3131

3232
## Overview
3333

@@ -82,8 +82,6 @@ Distributed scenario is for real-life case: for example, you have `N` nodes work
8282

8383
Local scenario is for testing case: for example, you want to try your new infrastructure from scratch, so you run `N` nodes and one `cardano-tracer` process on your machine.
8484

85-
**IMPORTANT NOTICE**: Please note that `cardano-tracer` **does not** support connection via IP-address and port, to avoid unauthorized connections. The **only** way to establish connection with the node is the local socket (Unix sockets or Windows named pipes).
86-
8785
## Distributed Scenario
8886

8987
This is an example with 3 nodes and one `cardano-tracer`:
@@ -251,8 +249,36 @@ There is another way to connect `cardano-tracer` to your nodes: the `cardano-tra
251249

252250
As you see, the tag in `network` field is `ConnectTo` now, which means that `cardano-tracer` works as a client: it _establishes_ network connections with your local nodes via the local sockets `/tmp/cardano-node-*.sock`. In this case each socket is used by a particular node.
253251

252+
`AcceptTo` and `ConnectTo` are mirrored by the reciprocal CLI option on the node `--tracer-socket-path-connect` / `--tracer-socket-path-accept`. If you choose one on the node, you choose the opposite on the tracer. This only makes a difference to which entity initiates the handshake; after the handshake the configuration is identical
253+
254254
Please use `ConnectTo`-based scenario only if you really need it. Otherwise, it is **highly recommended** to use `AcceptAt`-based scenario. The reason is easier maintainance. Suppose you have 3 working nodes, and they are connected to the same `cardano-tracer`. And then you want to connect 4-th node to it. If `cardano-tracer` is configured using `AcceptAt`, you shouldn't change its configuration - you just connect your 4-th node to it. But if `cardano-tracer` is configured using `ConnectTo`, you should add path to 4-th socket in its configuration file and then restart `cardano-tracer` process.
255255

256+
## Forwarding over TCP
257+
258+
In addition to forwarding over sockets, forwarding over TCP/IP is supported. In both cases, the 'forwarding protocol' is identical. For TCP forwarding, adjust the following (only showing the `AcceptAt` scenario here):
259+
260+
Change node CLI option:
261+
```bash
262+
--tracer-socket-network-connect 10.0.0.2:34567
263+
```
264+
265+
Adjust value for `network` in `cardano-tracer`'s configuration:
266+
```yaml
267+
network:
268+
tag: AcceptAt
269+
contents: "0.0.0.0:34567"
270+
```
271+
272+
In this example, `cardano-tracer` listens on port 34567. Nodes can connect via IPv4 for forwarding, with `10.0.0.2` being `cardano-tracer`'s IP in that example.
273+
274+
### Important
275+
276+
On same-host setups sockets are always preferrable due to **less overhead and better performance**. On multi-host setups, socket connection via SSH tunnels is always preferrable due to **increased security**.
277+
278+
Use TCP forwarding **if and only if** you control each and every aspect of the environment, such as port mapping or firewalls, or virtual network setup - the 'forwarding protocol' does not implement encrypting traffic nor authentication methods.
279+
280+
281+
256282
## Network Magic
257283

258284
The field `networkMagic` specifies the value of network magic. It is an integer constant from the genesis file, the node uses this value for the network handshake with peers. Since `cardano-tracer` should be connected to the node, it needs that network magic.

cardano-tracer/src/Cardano/Tracer/Acceptors/Client.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ module Cardano.Tracer.Acceptors.Client
66

77
import Cardano.Logging (TraceObject)
88
import qualified Cardano.Logging.Types as Net
9-
import Cardano.Tracer.Acceptors.Utils (prepareDataPointRequestor, prepareMetricsStores,
10-
removeDisconnectedNode)
9+
import Cardano.Tracer.Acceptors.Utils
1110
import qualified Cardano.Tracer.Configuration as TC
1211
import Cardano.Tracer.Environment
1312
import Cardano.Tracer.Handlers.Logs.TraceObjects (deregisterNodeId, traceObjectsHandler)

cardano-tracer/src/Cardano/Tracer/Acceptors/Server.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ module Cardano.Tracer.Acceptors.Server
66

77
import Cardano.Logging (TraceObject)
88
import qualified Cardano.Logging.Types as Net
9-
import Cardano.Tracer.Acceptors.Utils (prepareDataPointRequestor, prepareMetricsStores,
10-
removeDisconnectedNode)
9+
import Cardano.Tracer.Acceptors.Utils
1110
import qualified Cardano.Tracer.Configuration as TC
1211
import Cardano.Tracer.Environment
1312
import Cardano.Tracer.Handlers.Logs.TraceObjects (deregisterNodeId, traceObjectsHandler)

0 commit comments

Comments
 (0)