You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/adr/2023-11-07_029-event-source-sink.md
+20-9
Original file line number
Diff line number
Diff line change
@@ -47,25 +47,36 @@ data HydraNode tx m = HydraNode
47
47
}
48
48
```
49
49
50
-
*The`stepHydraNode` main loop does call `putEvent` on all`eventSinks`insequence.
51
-
52
-
-TBD: transaction semantics? what happens if one fails?
50
+
*The `hydra-node` will load events and __hydra_te its `HeadState` using `getEvents`of the single `eventSource`.
53
51
54
-
*Thedefault `hydra-node` main loop does use the file-based `EventSource` and a single file-based `EventSink` (using the same file).
52
+
*The`stepHydraNode` main loop does call `putEvent` on all`eventSinks`insequence.Any failure will make the `hydra-node` process terminate and require a restart.
53
+
54
+
*When loading events from `eventSource` on `hydra-node` startup, it will also re-submit events via `putEvent` to all`eventSinks`.
55
55
56
-
*TBD:As the node starts up, when loading events from the `EventSource`, it will also ensure "at least once" semantics for each `EventSink`.
56
+
*Thedefault `hydra-node` main loop does use the file-based `EventSource`and a single file-based `EventSink` (using the same file).
57
57
58
58
*We realize that the `EventSource` and `EventSink` handles, as well as their aggregation in `HydraNode` are used as an API by forks of the `hydra-node` and try to minimize changes to it.
59
59
60
60
## Consequences
61
61
62
62
*Thedefault operation of the `hyda-node` remains unchanged.
63
+
63
64
*There are other things called `Event` and `EventQueue(putEvent)` right now in the `hydra-node`.This is getting confusing and when we implement this, we should also rename several things first (tidying).
65
+
66
+
*Interface first:Implementationsof `EventSink` should specify their format in a non-ambiguous and versioned way, especially when a corresponding `EventSource` exists.
67
+
64
68
*TheAPI `Server` can be modelled and refactored as an `EventSink`.
65
-
-TBD:Do `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still?
66
-
*Projects forking the hydra node have a natively extensions points for producing and consuming events.
67
-
*TBD:These extensions can preserve robust "at least once" semantics for each hydra event.
69
+
70
+
*Projects forking the hydra node have dedicated extension points for producing and consuming events.
71
+
68
72
*SundaeLabs can build a "Save transaction batches to S3" proof of concept `EventSink`.
69
73
*SundaeLabs can build a "Scrolls source" `EventSink`.
70
74
*SundaeLabs can build a "Amazon Kinesis" `EventSource` and `EventSink`.
71
-
*Extension points like `EventSource` and `EventSink` could be dynamically loaded as plugins without having to fork `hydra-node` (maybein a future ADR).
75
+
76
+
## Out of scope / future work
77
+
78
+
*Available implementations for `EventSource` and `EventSink` could be
79
+
- configured upon `hydra-node` startup using for example URIs: `--event-source file://state` or `--event-sink s3://some-bucket`
80
+
- dynamically loaded as plugins without having to fork `hydra-node`.
81
+
82
+
*The `Network` and `Chain` parts qualify as `EventSink`s as well or shall those be triggered by `Effect`s still?
0 commit comments