aboutsummaryrefslogtreecommitdiff
path: root/src/Ssb/Discovery.hs
diff options
context:
space:
mode:
authorHaskell Guy <haskell.guy@localhost>2020-05-26 13:07:50 +0200
committerHaskell Guy <haskell.guy@localhost>2020-05-26 13:37:29 +0200
commit41cde99ec6189dbecca6803a5aa4f6f18142e8ba (patch)
tree7a0ceab0d516b8c3b7b49313100ae50c97e875c3 /src/Ssb/Discovery.hs
downloadssb-haskell-41cde99ec6189dbecca6803a5aa4f6f18142e8ba.tar.xz
initial commit
Diffstat (limited to 'src/Ssb/Discovery.hs')
-rw-r--r--src/Ssb/Discovery.hs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/Ssb/Discovery.hs b/src/Ssb/Discovery.hs
new file mode 100644
index 0000000..352020e
--- /dev/null
+++ b/src/Ssb/Discovery.hs
@@ -0,0 +1,22 @@
+-- | This module implements local discovery of Scuttlebutt peers.
+--
+-- https://ssbc.github.io/scuttlebutt-protocol-guide/#discovery
+
+module Ssb.Discovery where
+
+import Protolude
+
+import Ssb.Network
+import Ssb.Identity
+
+-- | default Scuttlebutt Server Port
+defaultPort :: Port
+defaultPort = "8008"
+
+-- | Advertisement messages are emitted on the local network for discovery of
+-- peers.
+data Advertisement = Advertisement
+ { ipAddress :: Host
+ , port :: Port
+ , publicKey :: PublicKey
+ } deriving (Eq)