mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
2be1ca7d1c
commit
08c634a82c
|
@ -1,10 +1,26 @@
|
||||||
module HBS2.Net.Proto.Actors.BlockInfo where
|
module HBS2.Net.Proto.Actors.BlockInfo where
|
||||||
|
|
||||||
|
import HBS2.Prelude
|
||||||
|
import HBS2.Hash
|
||||||
|
|
||||||
-- needs: logger
|
-- needs: logger
|
||||||
-- needs: reader and shit
|
-- needs: reader and shit
|
||||||
-- needs: messaging
|
-- needs: messaging
|
||||||
newtype BlockInfo = BlockInfo ()
|
newtype BlockInfoActor = BlockInfoActor ()
|
||||||
|
|
||||||
|
|
||||||
|
-- TODO: send block info request
|
||||||
|
-- TODO: receive block info request
|
||||||
|
-- TODO: cache block info per peer
|
||||||
|
-- TODO: get block info per peer
|
||||||
|
|
||||||
|
|
||||||
|
createBlockInfoActor :: MonadIO m => m BlockInfoActor
|
||||||
|
createBlockInfoActor = do
|
||||||
|
pure $ BlockInfoActor ()
|
||||||
|
|
||||||
|
sendBlockInfoRequest :: MonadIO m => BlockInfoActor -> Hash h -> m ()
|
||||||
|
sendBlockInfoRequest b h = do
|
||||||
|
undefined
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
module HBS2.Prelude
|
module HBS2.Prelude
|
||||||
( module Data.String
|
( module Data.String
|
||||||
, module Safe
|
, module Safe
|
||||||
|
, MonadIO
|
||||||
-- , module HBS2.Prelude
|
-- , module HBS2.Prelude
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.String (IsString(..))
|
import Data.String (IsString(..))
|
||||||
import Safe
|
import Safe
|
||||||
|
import Control.Monad.IO.Class (MonadIO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,19 +15,6 @@ import Data.Word
|
||||||
import Data.Set qualified as Set
|
import Data.Set qualified as Set
|
||||||
import Data.Map qualified as Map
|
import Data.Map qualified as Map
|
||||||
|
|
||||||
-- import Control.Monad.Writer
|
|
||||||
-- import Data.Hashable
|
|
||||||
-- import Data.IORef
|
|
||||||
-- import Data.Map qualified as Map
|
|
||||||
-- import Data.Set qualified as Set
|
|
||||||
-- import Data.Tuple
|
|
||||||
-- import Data.Word
|
|
||||||
-- import System.Random
|
|
||||||
|
|
||||||
-- import Data.HbSync.Types
|
|
||||||
-- import Network.HbSync.Protocol.Messaging
|
|
||||||
-- import Network.HbSync.Protocol.Messaging.Fake
|
|
||||||
|
|
||||||
|
|
||||||
data Fake
|
data Fake
|
||||||
|
|
||||||
|
@ -42,7 +29,6 @@ testFakeMessaging1 = do
|
||||||
|
|
||||||
gen <- newIORef (mkStdGen 0x4387ddaA10124)
|
gen <- newIORef (mkStdGen 0x4387ddaA10124)
|
||||||
|
|
||||||
|
|
||||||
let peers = fmap FakePeer [1..10]
|
let peers = fmap FakePeer [1..10]
|
||||||
|
|
||||||
bus <- newFakeP2P @Fake @Word16 False
|
bus <- newFakeP2P @Fake @Word16 False
|
||||||
|
|
Loading…
Reference in New Issue