From 64243ab0f18e726f57afe93c7d440386a819cdac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 11 Jun 2024 20:53:15 +0200 Subject: Command to add public peers --- main/Main.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main') diff --git a/main/Main.hs b/main/Main.hs index f52e22a..0eb414c 100644 --- a/main/Main.hs +++ b/main/Main.hs @@ -418,6 +418,7 @@ commands = [ ("history", cmdHistory) , ("peers", cmdPeers) , ("peer-add", cmdPeerAdd) + , ("peer-add-public", cmdPeerAddPublic) , ("peer-drop", cmdPeerDrop) , ("send", cmdSend) , ("update-identity", cmdUpdateIdentity) @@ -472,6 +473,12 @@ cmdPeerAdd = void $ do addr:_ <- liftIO $ getAddrInfo (Just $ defaultHints { addrSocketType = Datagram }) (Just hostname) (Just port) liftIO $ serverPeer server (addrAddress addr) +cmdPeerAddPublic :: Command +cmdPeerAddPublic = do + server <- asks ciServer + addr:_ <- liftIO $ getAddrInfo (Just $ defaultHints { addrSocketType = Datagram }) (Just "discovery1.erebosprotocol.net") (Just (show discoveryPort)) + void $ liftIO $ serverPeer server (addrAddress addr) + cmdPeerDrop :: Command cmdPeerDrop = do dropPeer =<< getSelectedPeer -- cgit v1.2.3