diff --git a/hbs2-core/hbs2-core.cabal b/hbs2-core/hbs2-core.cabal index 5579c9a5..d6fd7595 100644 --- a/hbs2-core/hbs2-core.cabal +++ b/hbs2-core/hbs2-core.cabal @@ -63,17 +63,18 @@ library import: shared-properties exposed-modules: - , HBS2.Defaults - , HBS2.Clock + HBS2.Clock , HBS2.Data.Types , HBS2.Data.Types.Refs + , HBS2.Defaults , HBS2.Hash , HBS2.Merkle + , HBS2.Net.Messaging , HBS2.Net.Proto + , HBS2.Net.Proto.Actors.BlockInfo , HBS2.Prelude , HBS2.Prelude.Plated , HBS2.Storage - , HBS2.Net.Proto.Actors.BlockInfo -- other-modules: diff --git a/hbs2-core/lib/HBS2/Net/Messaging.hs b/hbs2-core/lib/HBS2/Net/Messaging.hs new file mode 100644 index 00000000..a8835898 --- /dev/null +++ b/hbs2-core/lib/HBS2/Net/Messaging.hs @@ -0,0 +1,22 @@ +{-# Language FunctionalDependencies #-} +module HBS2.Net.Messaging where + +import Control.Monad.IO.Class +import Data.Kind +import Prettyprinter + +newtype From a = From a + deriving newtype (Eq,Show,Pretty) + +newtype To a = To a + deriving newtype (Eq,Show,Pretty) + + +class Messaging bus addr msg | bus -> addr, bus -> msg where + + sendTo :: MonadIO m => bus -> To addr -> From addr -> msg -> m () + receive :: MonadIO m => bus -> To addr -> m [msg] + + + + diff --git a/hbs2-core/lib/HBS2/Net/Proto/Actors/BlockInfo.hs b/hbs2-core/lib/HBS2/Net/Proto/Actors/BlockInfo.hs index 0c2f9c7e..ead0d8d8 100644 --- a/hbs2-core/lib/HBS2/Net/Proto/Actors/BlockInfo.hs +++ b/hbs2-core/lib/HBS2/Net/Proto/Actors/BlockInfo.hs @@ -1,3 +1,10 @@ module HBS2.Net.Proto.Actors.BlockInfo where +-- needs: logger +-- needs: reader and shit +-- needs: messaging +newtype BlockInfo = BlockInfo () + + +