From 33de5f6fec097a2f13377635f8d5d984ac817475 Mon Sep 17 00:00:00 2001
From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com>
Date: Sat, 11 Sep 2021 18:36:12 +0100
Subject: [PATCH] include migrations in the package, update docs, versions
(#194)
* include migrations in the package, update versions
* update DigitalOcean version
---
CHANGELOG.md | 4 ++++
README.md | 15 +++++++--------
package.yaml | 3 ++-
.../marketplace-image.json | 2 +-
simplexmq.cabal | 8 ++++++--
src/Simplex/Messaging/Agent.hs | 2 +-
src/Simplex/Messaging/Transport.hs | 2 +-
tests/SMPAgentClient.hs | 2 +-
8 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e17de756c..88c920a23 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 0.4.1
+
+- Include migrations in the package
+
# 0.4.0
- SMP server implementation and [SMP protocol](https://github.com/simplex-chat/simplexmq/blob/master/protocol/simplex-messaging.md) changes:
diff --git a/README.md b/README.md
index a0d4b9d3a..d91ad3413 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,9 @@ SimpleXMQ is implemented in Haskell - it benefits from robust software transacti
## SimpleXMQ roadmap
-- Streams - high performance message queues. See [Streams RFC](https://github.com/simplex-chat/simplexmq/blob/master/rfcs/2021-02-28-streams.md) for details.
-- "Small" connection groups, when each message will be sent by the SMP agent to multiple connections with a single client command. See [Groups RFC](https://github.com/simplex-chat/simplexmq/blob/master/rfcs/2021-03-18-groups.md) for details.
-- SMP agents cluster to share connections and message management by multiple agents (for example, it would enable multi-device use for [simplex-chat](https://github.com/simplex-chat/simplex-chat)).
- SMP queue redundancy and rotation in SMP agent duplex connections.
-- "Large" groups design and implementation.
+- SMP agents synchronization to share connections and messages between multiple agents (it would allow using multiple devices for [simplex-chat](https://github.com/simplex-chat/simplex-chat)).
+- Streams - high performance message queues. See [Streams RFC](https://github.com/simplex-chat/simplexmq/blob/master/rfcs/2021-02-28-streams.md) for details.
## Components
@@ -50,13 +48,14 @@ See [simplex-chat](https://github.com/simplex-chat/simplex-chat) terminal UI for
## Using SMP server and SMP agent
-You can either run your own SMP server locally or deploy using [Linode StackScript](#deploy-smp-server-on-linode), or try local SMP agent with the deployed demo server:
+You can either run your own SMP server locally or deploy using [Linode StackScript](#deploy-smp-server-on-linode), or try local SMP agent with the deployed servers:
-`smp1.simplex.im:5223#pLdiGvm0jD1CMblnov6Edd/391OrYsShw+RgdfR0ChA=`
+`smp2.simplex.im#z5W2QLQ1Br3Yd6CoWg7bIq1bHdwK7Y8bEiEXBs/WfAg=` (London, UK)
+`smp3.simplex.im#nxc7HnrnM8dOKgkMp008ub/9o9LXJlxlMrMpR+mfMQw=` (Fremont, CA)
It's the easiest to try SMP agent via a prototype [simplex-chat](https://github.com/simplex-chat/simplex-chat) terminal UI.
-[
](https://cloud.linode.com/stackscripts/748014)
+[
](https://cloud.linode.com/stackscripts/748014)
## Deploy SMP server on Linode
@@ -78,7 +77,7 @@ Deployment on [Linode](https://www.linode.com/) is performed via StackScripts, w
Please submit an [issue](https://github.com/simplex-chat/simplexmq/issues) if any problems occur.
-[
](https://marketplace.digitalocean.com/apps/simplex-server)
+[
](https://marketplace.digitalocean.com/apps/simplex-server)
## Deploy SMP server on DigitalOcean
diff --git a/package.yaml b/package.yaml
index 7732f9629..85eb6eb29 100644
--- a/package.yaml
+++ b/package.yaml
@@ -1,5 +1,5 @@
name: simplexmq
-version: 0.4.0
+version: 0.4.1
synopsis: SimpleXMQ message broker
description: |
This package includes <./docs/Simplex-Messaging-Server.html server>,
@@ -20,6 +20,7 @@ category: Chat, Network, Web, System, Cryptography
extra-source-files:
- README.md
- CHANGELOG.md
+ - migrations/*.*
dependencies:
- ansi-terminal >= 0.10 && < 0.12
diff --git a/scripts/smp-server-digitalocean-droplet/marketplace-image.json b/scripts/smp-server-digitalocean-droplet/marketplace-image.json
index c85dccc53..77e5be7bb 100644
--- a/scripts/smp-server-digitalocean-droplet/marketplace-image.json
+++ b/scripts/smp-server-digitalocean-droplet/marketplace-image.json
@@ -3,7 +3,7 @@
"token": "{{env `DIGITALOCEAN_TOKEN`}}",
"image_name": "smp-server-snapshot",
"application_name": "SMP server",
- "release_tag": "v0.4.0"
+ "release_tag": "v0.4.1"
},
"sensitive-variables": ["token"],
"builders": [
diff --git a/simplexmq.cabal b/simplexmq.cabal
index 30ff89c34..82e187ce0 100644
--- a/simplexmq.cabal
+++ b/simplexmq.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
--- hash: e25d53dc1b12c8bcdf029091182613198be5271348ea19174b6532d820fe1fc9
+-- hash: 706d2f9155c3f3be0f08ea0d6c8954c0e2b9a6e22615f7b19499a3a349af7cc9
name: simplexmq
-version: 0.4.0
+version: 0.4.1
synopsis: SimpleXMQ message broker
description: This package includes <./docs/Simplex-Messaging-Server.html server>,
<./docs/Simplex-Messaging-Client.html client> and
@@ -28,6 +28,10 @@ build-type: Simple
extra-source-files:
README.md
CHANGELOG.md
+ migrations/20210101_initial.sql
+ migrations/20210624_confirmations.sql
+ migrations/20210809_snd_messages.sql
+ migrations/README.md
library
exposed-modules:
diff --git a/src/Simplex/Messaging/Agent.hs b/src/Simplex/Messaging/Agent.hs
index fe52e7fef..18dd0d845 100644
--- a/src/Simplex/Messaging/Agent.hs
+++ b/src/Simplex/Messaging/Agent.hs
@@ -106,7 +106,7 @@ runSMPAgentBlocking (ATransport t) started cfg@AgentConfig {tcpPort} = runReader
where
smpAgent :: forall c m'. (Transport c, MonadUnliftIO m', MonadReader Env m') => TProxy c -> m' ()
smpAgent _ = runTransportServer started tcpPort $ \(h :: c) -> do
- liftIO $ putLn h "Welcome to SMP v0.4.0 agent"
+ liftIO $ putLn h "Welcome to SMP v0.4.1 agent"
c <- getAgentClient
logConnection c True
race_ (connectClient h c) (runAgentClient c)
diff --git a/src/Simplex/Messaging/Transport.hs b/src/Simplex/Messaging/Transport.hs
index 83d353ec9..f881af3ec 100644
--- a/src/Simplex/Messaging/Transport.hs
+++ b/src/Simplex/Messaging/Transport.hs
@@ -221,7 +221,7 @@ major :: SMPVersion -> (Int, Int)
major (SMPVersion a b _ _) = (a, b)
currentSMPVersion :: SMPVersion
-currentSMPVersion = "0.4.0.0"
+currentSMPVersion = "0.4.1.0"
serializeSMPVersion :: SMPVersion -> ByteString
serializeSMPVersion (SMPVersion a b c d) = B.intercalate "." [bshow a, bshow b, bshow c, bshow d]
diff --git a/tests/SMPAgentClient.hs b/tests/SMPAgentClient.hs
index b1c37288c..99d2336ce 100644
--- a/tests/SMPAgentClient.hs
+++ b/tests/SMPAgentClient.hs
@@ -189,7 +189,7 @@ testSMPAgentClientOn :: (Transport c, MonadUnliftIO m) => ServiceName -> (c -> m
testSMPAgentClientOn port' client = do
runTransportClient agentTestHost port' $ \h -> do
line <- liftIO $ getLn h
- if line == "Welcome to SMP v0.4.0 agent"
+ if line == "Welcome to SMP v0.4.1 agent"
then client h
else error $ "wrong welcome message: " <> B.unpack line