Clean up HeadLogic
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
Signed-off-by: Sasha Bogicevic <[email protected]>
This is not properly handling errors and connectivity topics, but basic broadcast and delivery works.
This is putting the protocol version into the key name used on the etcd key value store and checks whether we use the same version on every watch event. This might be a bit inefficient..
This replaces the withNetwork in Hydra.Node.Network now with an Authenticate + Etcd stack and makes it use the network protocol version.
Interleaving 'Connectivity' events with 'msg' of a NetworkCallback 'deliver', is fine until we have a component which provides both (e.g. the 'Etcd') and one a component that requires symmetry between in- and out-bound messages. For example the 'Authenticate' component cannot be composed around such a 'Either Connectivity msg' inbound component because to verify signatures of incoming messages, it would need to understand that this is an 'Either' and only do it for 'Right msg' -> this is a leaky abstraction. This commit intsead does expand 'NetworkCallback' to not only 'deliver', but also provide an 'onConnectivity' callback. While this makes it not a (Co-)functor, it is more explicit and allows to thread callbacks easily.