blob: 1f73af8a7aca01718b3504cb220f6cec96dbd184 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
module Network.BitTorrent.DHT.Server
(
) where
import Control.Monad.Trans.State
import Data.Kademlia.Routing.Table
import Data.Kademlia.Common
type DHT k v = StateT (Table NodeInfo InfoHash) IO
ping :: NodeID -> DHT k v NodeID
ping nid = do
-- update nid
-- gets nodeID
undefined
findNode :: NodeID -> DHT k v [NodeInfo]
findNode = undefined
-- | Bittorrent /get_peers/ RPC is special case of the /find_value/.
findValue :: NodeID -> DHT k v (Either [NodeID] v)
findValue = undefined
-- | Bittorrent /announce_peer/ RPC is special case of the /store/.
store :: NodeID -> (k, v) -> DHT k v NodeID
store = undefined
|