mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-04-27 15:05:13 +00:00
cf147397a4
* xftp: agent receive file draft * receiveFile more stubs, changes to types, schema * cabal file * comments * xftp_server_id * schema changes, get client, local worker/action * agent env, save file description, adjust schema * client stubs * download chunk wip, store, schema, types * remove commented code * read file description, schema, types * check received, decrypt * remove pure * todo * add XFTP to agent client * add user id * agent test * tests * rename supervisor into agent --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
36 lines
1.0 KiB
Haskell
36 lines
1.0 KiB
Haskell
{-# LANGUAGE DuplicateRecordFields #-}
|
|
{-# LANGUAGE NumericUnderscores #-}
|
|
{-# LANGUAGE OverloadedStrings #-}
|
|
{-# LANGUAGE TypeApplications #-}
|
|
|
|
module Main where
|
|
|
|
import Control.Logger.Simple
|
|
import qualified Data.List.NonEmpty as L
|
|
import qualified Data.Map.Strict as M
|
|
import Simplex.Messaging.Agent.Env.SQLite
|
|
import Simplex.Messaging.Agent.Server (runSMPAgent)
|
|
import Simplex.Messaging.Client (defaultNetworkConfig)
|
|
import Simplex.Messaging.Transport (TLS, Transport (..))
|
|
|
|
cfg :: AgentConfig
|
|
cfg = defaultAgentConfig
|
|
|
|
servers :: InitialAgentServers
|
|
servers =
|
|
InitialAgentServers
|
|
{ smp = M.fromList [(1, L.fromList ["smp://bU0K-bRg24xWW__lS0umO1Zdw_SXqpJNtm1_RrPLViE=@localhost:5223"])],
|
|
ntf = [],
|
|
xftp = M.fromList [],
|
|
netCfg = defaultNetworkConfig
|
|
}
|
|
|
|
logCfg :: LogConfig
|
|
logCfg = LogConfig {lc_file = Nothing, lc_stderr = True}
|
|
|
|
main :: IO ()
|
|
main = do
|
|
putStrLn $ "SMP agent listening on port " ++ tcpPort (cfg :: AgentConfig)
|
|
setLogLevel LogInfo -- LogError
|
|
withGlobalLogging logCfg $ runSMPAgent (transport @TLS) cfg servers
|