diff --git a/.fixme/log b/.fixme/log index c1a998d6..e81a6e1b 100644 --- a/.fixme/log +++ b/.fixme/log @@ -161,6 +161,4 @@ fixme-set "workflow" "test" "DTZ2RqeN7y" fixme-set "workflow" "test" "84iLJsvCtT" fixme-set "workflow" "wip" "GkCkjVMAXW" -fixme-set "workflow" "test" "GkCkjVMAXW" - -fixme-set "workflow" "test" "t8M3AEnm93" \ No newline at end of file +fixme-set "workflow" "test" "GkCkjVMAXW" \ No newline at end of file diff --git a/docs/devlog.md b/docs/devlog.md index 6de2973c..4d5b8904 100644 --- a/docs/devlog.md +++ b/docs/devlog.md @@ -1,10 +1,6 @@ ## 2023-02-15 -TODO: rpc-own-peer-key - - poke to print peer's own auth key - TODO: rpc-known-peers TODO: announce-group diff --git a/hbs2-peer/app/PeerMain.hs b/hbs2-peer/app/PeerMain.hs index f9c521cc..704b1f3f 100644 --- a/hbs2-peer/app/PeerMain.hs +++ b/hbs2-peer/app/PeerMain.hs @@ -538,11 +538,7 @@ runPeer opts = Exception.handle myException $ do void $ liftIO $ waitAnyCatchCancel workers let pokeAction _ = do - who <- thatPeer (Proxy @(RPC e)) - let k = view peerSignPk pc - -- FIXME: to-delete-POKE liftIO $ atomically $ writeTQueue rpcQ POKE - request who (RPCPokeAnswer @e k) let annAction h = do liftIO $ atomically $ writeTQueue rpcQ (ANNOUNCE h) @@ -658,9 +654,6 @@ withRPC saddr cmd = do Log.info $ "pong from" <+> pretty pa exitSuccess - - RPCPoke{} -> pause @'Seconds 0.1 - RPCPeers{} -> liftIO do pause @'Seconds 1 exitSuccess @@ -673,10 +666,7 @@ withRPC saddr cmd = do where adapter q = RpcAdapter dontHandle - - (\k -> do Log.info ( "alive-and-kicking" <+> pretty (AsBase58 k)) - liftIO exitSuccess ) - + (const $ notice "alive-and-kicking" >> liftIO exitSuccess) (const $ liftIO exitSuccess) (const $ notice "ping?") (liftIO . atomically . writeTQueue q) diff --git a/hbs2-peer/app/RPC.hs b/hbs2-peer/app/RPC.hs index a345f7bd..eee176d1 100644 --- a/hbs2-peer/app/RPC.hs +++ b/hbs2-peer/app/RPC.hs @@ -19,7 +19,7 @@ data RPC e = RPCPoke | RPCPing (PeerAddr e) | RPCPong (PeerAddr e) - | RPCPokeAnswer (PubKey 'Sign e) + | RPCPokeAnswer | RPCAnnounce (Hash HbSync) | RPCFetch (Hash HbSync) | RPCPeers @@ -47,7 +47,7 @@ makeLenses 'RPCEnv data RpcAdapter e m = RpcAdapter { rpcOnPoke :: RPC e -> m () - , rpcOnPokeAnswer :: PubKey 'Sign e -> m () + , rpcOnPokeAnswer :: RPC e -> m () , rpcOnAnnounce :: Hash HbSync -> m () , rpcOnPing :: PeerAddr e -> m () , rpcOnPong :: PeerAddr e -> m () @@ -94,8 +94,8 @@ rpcHandler :: forall e m . ( MonadIO m => RpcAdapter e m -> RPC e -> m () rpcHandler adapter = \case - p@RPCPoke{} -> rpcOnPoke adapter p - (RPCPokeAnswer k) -> rpcOnPokeAnswer adapter k + p@RPCPoke{} -> rpcOnPoke adapter p >> response (RPCPokeAnswer @e) + p@RPCPokeAnswer{} -> rpcOnPokeAnswer adapter p (RPCAnnounce h) -> rpcOnAnnounce adapter h (RPCPing pa) -> rpcOnPing adapter pa (RPCPong pa) -> rpcOnPong adapter pa