Skip to content

Commit

Permalink
Merge pull request #449 from input-output-hk/SCP-5012
Browse files Browse the repository at this point in the history
SCP-5012 Upgrade `marlowe-apps` to use `marlowe-sync`
  • Loading branch information
bwbush committed Feb 8, 2023
2 parents d512734 + e0d76a3 commit 60176ec
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 295 deletions.
67 changes: 24 additions & 43 deletions marlowe-apps/Finder.md
Expand Up @@ -30,16 +30,12 @@ marlowe-finder : find active Marlowe contracts

Usage: marlowe-finder [--chain-seek-host HOST_NAME]
[--chain-seek-command-port PORT_NUMBER]
[--chain-seek-query-port PORT_NUMBER]
[--chain-seek-sync-port PORT_NUMBER]
[--history-host HOST_NAME]
[--history-command-port PORT_NUMBER]
[--history-query-port PORT_NUMBER]
[--history-sync-port PORT_NUMBER]
[--discovery-host HOST_NAME]
[--discovery-query-port PORT_NUMBER]
[--discovery-sync-port PORT_NUMBER] [--tx-host HOST_NAME]
[--tx-command-port PORT_NUMBER]
[--marlowe-sync-host HOST_NAME]
[--marlowe-sync-port PORT_NUMBER]
[--marlowe-header-sync-port PORT_NUMBER]
[--marlowe-query-sync-port PORT_NUMBER]
[--tx-host HOST_NAME] [--tx-command-port PORT_NUMBER]
[--timeout-seconds INTEGER] [--build-seconds INTEGER]
[--confirm-seconds INTEGER] [--retry-seconds INTEGER]
[--retry-limit INTEGER] [--polling SECONDS]
Expand All @@ -53,48 +49,33 @@ Available options:
--chain-seek-host HOST_NAME
The hostname of the Marlowe Runtime chain-seek
server. Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_HOST (default: "127.0.0.1")
MARLOWE_CHAINSEEKD_HOST (default: "127.0.0.1")
--chain-seek-command-port PORT_NUMBER
The port number of the chain-seek server's job API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_COMMAND_PORT (default: 3720)
--chain-seek-query-port PORT_NUMBER
The port number of the chain-seek server's query API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_QUERY_PORT (default: 3716)
MARLOWE_CHAINSEEKD_COMMAND_PORT (default: 3720)
--chain-seek-sync-port PORT_NUMBER
The port number of the chain-seek server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_CHAINSEEK_SYNC_PORT
(default: 3715)
--history-host HOST_NAME The hostname of the Marlowe Runtime history server.
Can be set as the environment variable
MARLOWE_RT_HISTORY_HOST (default: "127.0.0.1")
--history-command-port PORT_NUMBER
The port number of the history server's job API. Can
be set as the environment variable
MARLOWE_RT_HISTORY_COMMAND_PORT (default: 3717)
--history-query-port PORT_NUMBER
The port number of the history server's query API.
Can be set as the environment variable
MARLOWE_RT_HISTORY_QUERY_PORT (default: 3718)
--history-sync-port PORT_NUMBER
The port number of the history server's
variable MARLOWE_CHAINSEEKD_PORT (default: 3715)
--marlowe-sync-host HOST_NAME
The hostname of the Marlowe Runtime marlowe-sync
server. Can be set as the environment variable
MARLOWE_RT_SYNC_HOST (default: "127.0.0.1")
--marlowe-sync-port PORT_NUMBER
The port number of the marlowe-sync server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_HISTORY_SYNC_PORT (default: 3719)
--discovery-host HOST_NAME
The hostname of the Marlowe Runtime discovery server.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_HOST (default: "127.0.0.1")
--discovery-query-port PORT_NUMBER
The port number of the discovery server's query API.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_QUERY_PORT (default: 3721)
--discovery-sync-port PORT_NUMBER
The port number of the discovery server's
variable MARLOWE_RT_SYNC_MARLOWE_SYNC_PORT
(default: 3724)
--marlowe-header-sync-port PORT_NUMBER
The port number of the marlowe-sync server's header
synchronization API. Can be set as the environment
variable MARLOWE_RT_DISCOVERY_SYNC_PORT
(default: 3722)
variable MARLOWE_RT_SYNC_HEADER_SYNC_PORT
(default: 3725)
--marlowe-query-sync-port PORT_NUMBER
The port number of the marlowe-sync server's query
API. Can be set as the environment variable
MARLOWE_RT_SYNC_QUERY_SYNC_PORT (default: 3726)
--tx-host HOST_NAME The hostname of the Marlowe Runtime transaction
server. Can be set as the environment variable
MARLOWE_RT_TX_HOST (default: "127.0.0.1")
Expand Down
67 changes: 24 additions & 43 deletions marlowe-apps/Oracle.md
Expand Up @@ -186,16 +186,12 @@ marlowe-oracle : run an oracle for Marlowe contracts

Usage: marlowe-oracle [--chain-seek-host HOST_NAME]
[--chain-seek-command-port PORT_NUMBER]
[--chain-seek-query-port PORT_NUMBER]
[--chain-seek-sync-port PORT_NUMBER]
[--history-host HOST_NAME]
[--history-command-port PORT_NUMBER]
[--history-query-port PORT_NUMBER]
[--history-sync-port PORT_NUMBER]
[--discovery-host HOST_NAME]
[--discovery-query-port PORT_NUMBER]
[--discovery-sync-port PORT_NUMBER] [--tx-host HOST_NAME]
[--tx-command-port PORT_NUMBER]
[--marlowe-sync-host HOST_NAME]
[--marlowe-sync-port PORT_NUMBER]
[--marlowe-header-sync-port PORT_NUMBER]
[--marlowe-query-sync-port PORT_NUMBER]
[--tx-host HOST_NAME] [--tx-command-port PORT_NUMBER]
[--timeout-seconds INTEGER] [--build-seconds INTEGER]
[--confirm-seconds INTEGER] [--retry-seconds INTEGER]
[--retry-limit INTEGER] [--polling SECONDS]
Expand All @@ -210,48 +206,33 @@ Available options:
--chain-seek-host HOST_NAME
The hostname of the Marlowe Runtime chain-seek
server. Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_HOST (default: "127.0.0.1")
MARLOWE_CHAINSEEKD_HOST (default: "127.0.0.1")
--chain-seek-command-port PORT_NUMBER
The port number of the chain-seek server's job API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_COMMAND_PORT (default: 3720)
--chain-seek-query-port PORT_NUMBER
The port number of the chain-seek server's query API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_QUERY_PORT (default: 3716)
MARLOWE_CHAINSEEKD_COMMAND_PORT (default: 3720)
--chain-seek-sync-port PORT_NUMBER
The port number of the chain-seek server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_CHAINSEEK_SYNC_PORT
(default: 3715)
--history-host HOST_NAME The hostname of the Marlowe Runtime history server.
Can be set as the environment variable
MARLOWE_RT_HISTORY_HOST (default: "127.0.0.1")
--history-command-port PORT_NUMBER
The port number of the history server's job API. Can
be set as the environment variable
MARLOWE_RT_HISTORY_COMMAND_PORT (default: 3717)
--history-query-port PORT_NUMBER
The port number of the history server's query API.
Can be set as the environment variable
MARLOWE_RT_HISTORY_QUERY_PORT (default: 3718)
--history-sync-port PORT_NUMBER
The port number of the history server's
variable MARLOWE_CHAINSEEKD_PORT (default: 3715)
--marlowe-sync-host HOST_NAME
The hostname of the Marlowe Runtime marlowe-sync
server. Can be set as the environment variable
MARLOWE_RT_SYNC_HOST (default: "127.0.0.1")
--marlowe-sync-port PORT_NUMBER
The port number of the marlowe-sync server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_HISTORY_SYNC_PORT (default: 3719)
--discovery-host HOST_NAME
The hostname of the Marlowe Runtime discovery server.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_HOST (default: "127.0.0.1")
--discovery-query-port PORT_NUMBER
The port number of the discovery server's query API.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_QUERY_PORT (default: 3721)
--discovery-sync-port PORT_NUMBER
The port number of the discovery server's
variable MARLOWE_RT_SYNC_MARLOWE_SYNC_PORT
(default: 3724)
--marlowe-header-sync-port PORT_NUMBER
The port number of the marlowe-sync server's header
synchronization API. Can be set as the environment
variable MARLOWE_RT_DISCOVERY_SYNC_PORT
(default: 3722)
variable MARLOWE_RT_SYNC_HEADER_SYNC_PORT
(default: 3725)
--marlowe-query-sync-port PORT_NUMBER
The port number of the marlowe-sync server's query
API. Can be set as the environment variable
MARLOWE_RT_SYNC_QUERY_SYNC_PORT (default: 3726)
--tx-host HOST_NAME The hostname of the Marlowe Runtime transaction
server. Can be set as the environment variable
MARLOWE_RT_TX_HOST (default: "127.0.0.1")
Expand Down
67 changes: 24 additions & 43 deletions marlowe-apps/Scaling.md
Expand Up @@ -74,16 +74,12 @@ marlowe-scaling : run multiple Marlowe test contracts in parallel

Usage: marlowe-scaling [--chain-seek-host HOST_NAME]
[--chain-seek-command-port PORT_NUMBER]
[--chain-seek-query-port PORT_NUMBER]
[--chain-seek-sync-port PORT_NUMBER]
[--history-host HOST_NAME]
[--history-command-port PORT_NUMBER]
[--history-query-port PORT_NUMBER]
[--history-sync-port PORT_NUMBER]
[--discovery-host HOST_NAME]
[--discovery-query-port PORT_NUMBER]
[--discovery-sync-port PORT_NUMBER] [--tx-host HOST_NAME]
[--tx-command-port PORT_NUMBER]
[--marlowe-sync-host HOST_NAME]
[--marlowe-sync-port PORT_NUMBER]
[--marlowe-header-sync-port PORT_NUMBER]
[--marlowe-query-sync-port PORT_NUMBER]
[--tx-host HOST_NAME] [--tx-command-port PORT_NUMBER]
[--timeout-seconds INTEGER] [--build-seconds INTEGER]
[--confirm-seconds INTEGER] [--retry-seconds INTEGER]
[--retry-limit INTEGER] NATURAL [ADDRESS=KEYFILE]
Expand All @@ -98,48 +94,33 @@ Available options:
--chain-seek-host HOST_NAME
The hostname of the Marlowe Runtime chain-seek
server. Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_HOST (default: "127.0.0.1")
MARLOWE_CHAINSEEKD_HOST (default: "127.0.0.1")
--chain-seek-command-port PORT_NUMBER
The port number of the chain-seek server's job API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_COMMAND_PORT (default: 3720)
--chain-seek-query-port PORT_NUMBER
The port number of the chain-seek server's query API.
Can be set as the environment variable
MARLOWE_RT_CHAINSEEK_QUERY_PORT (default: 3716)
MARLOWE_CHAINSEEKD_COMMAND_PORT (default: 3720)
--chain-seek-sync-port PORT_NUMBER
The port number of the chain-seek server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_CHAINSEEK_SYNC_PORT
(default: 3715)
--history-host HOST_NAME The hostname of the Marlowe Runtime history server.
Can be set as the environment variable
MARLOWE_RT_HISTORY_HOST (default: "127.0.0.1")
--history-command-port PORT_NUMBER
The port number of the history server's job API. Can
be set as the environment variable
MARLOWE_RT_HISTORY_COMMAND_PORT (default: 3717)
--history-query-port PORT_NUMBER
The port number of the history server's query API.
Can be set as the environment variable
MARLOWE_RT_HISTORY_QUERY_PORT (default: 3718)
--history-sync-port PORT_NUMBER
The port number of the history server's
variable MARLOWE_CHAINSEEKD_PORT (default: 3715)
--marlowe-sync-host HOST_NAME
The hostname of the Marlowe Runtime marlowe-sync
server. Can be set as the environment variable
MARLOWE_RT_SYNC_HOST (default: "127.0.0.1")
--marlowe-sync-port PORT_NUMBER
The port number of the marlowe-sync server's
synchronization API. Can be set as the environment
variable MARLOWE_RT_HISTORY_SYNC_PORT (default: 3719)
--discovery-host HOST_NAME
The hostname of the Marlowe Runtime discovery server.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_HOST (default: "127.0.0.1")
--discovery-query-port PORT_NUMBER
The port number of the discovery server's query API.
Can be set as the environment variable
MARLOWE_RT_DISCOVERY_QUERY_PORT (default: 3721)
--discovery-sync-port PORT_NUMBER
The port number of the discovery server's
variable MARLOWE_RT_SYNC_MARLOWE_SYNC_PORT
(default: 3724)
--marlowe-header-sync-port PORT_NUMBER
The port number of the marlowe-sync server's header
synchronization API. Can be set as the environment
variable MARLOWE_RT_DISCOVERY_SYNC_PORT
(default: 3722)
variable MARLOWE_RT_SYNC_HEADER_SYNC_PORT
(default: 3725)
--marlowe-query-sync-port PORT_NUMBER
The port number of the marlowe-sync server's query
API. Can be set as the environment variable
MARLOWE_RT_SYNC_QUERY_SYNC_PORT (default: 3726)
--tx-host HOST_NAME The hostname of the Marlowe Runtime transaction
server. Can be set as the environment variable
MARLOWE_RT_TX_HOST (default: "127.0.0.1")
Expand Down
4 changes: 3 additions & 1 deletion marlowe-apps/marlowe-apps.cabal
@@ -1,6 +1,6 @@
cabal-version : 3.0
name : marlowe-apps
version : 0.2.1.0
version : 0.2.2.1
synopsis : Marlowe Runtimee applications
license : Apache-2.0
license-file : LICENSE
Expand Down Expand Up @@ -39,6 +39,7 @@ library
, marlowe-runtime:config
, marlowe-runtime:discovery-api
, marlowe-runtime:history-api
, marlowe-runtime:sync-api
, marlowe-runtime:tx-api
, marlowe-runtime
, monad-control
Expand All @@ -61,6 +62,7 @@ library
-Wunused-packages
default-language : Haskell2010


executable marlowe-scaling
main-is : Main.hs
hs-source-dirs : scaling
Expand Down
2 changes: 1 addition & 1 deletion marlowe-apps/oracle/Main.hs
Expand Up @@ -66,7 +66,7 @@ commandParser =
<$> configParser
<*> O.option O.auto (O.long "polling" <> O.value 5_000_000 <> O.metavar "SECONDS" <> O.help "The polling frequency for waiting on Marlowe Runtime.")
<*> O.option O.auto (O.long "requeue" <> O.value 20_000_000 <> O.metavar "SECONDS" <> O.help "The requeuing frequency for reviewing the progress of contracts on Marlowe Runtime.")
<*> (O.argument addressParser) (O.metavar "ADDRESS" <> O.help "The Bech32 address of the oracle.")
<*> O.argument addressParser (O.metavar "ADDRESS" <> O.help "The Bech32 address of the oracle.")
<*> O.strArgument (O.metavar "KEYFILE" <> O.help "The extended payment signing key file for the oracle.")
pure
$ O.info
Expand Down
9 changes: 3 additions & 6 deletions marlowe-apps/src/Language/Marlowe/Runtime/App.hs
Expand Up @@ -18,8 +18,7 @@ import Control.Exception (SomeException, catch)
import Data.Bifunctor (second)
import Data.Either (fromRight)
import Language.Marlowe.Runtime.App.Build (buildApplication, buildCreation, buildWithdrawal)
import Language.Marlowe.Runtime.App.List
(allContracts, followContract, followedContracts, getContract, unfollowContract)
import Language.Marlowe.Runtime.App.List (allContracts, allHeaders, getContract)
import Language.Marlowe.Runtime.App.Run (runClientWithConfig)
import Language.Marlowe.Runtime.App.Sign (sign)
import Language.Marlowe.Runtime.App.Submit (submit, waitForTx)
Expand All @@ -36,10 +35,8 @@ handle config request =
let
run =
case request of
List -> Right . Contracts <$> allContracts
Followed -> Right . Contracts <$> followedContracts
Follow{..} -> fmap FollowResult <$> followContract reqContractId
Unfollow{..} -> fmap FollowResult <$> unfollowContract reqContractId
ListContracts -> Right . Contracts <$> allContracts
ListHeaders -> Right . Headers <$> allHeaders
Get{..} -> fmap (uncurry Info) <$> getContract reqContractId
Create{..} -> second (uncurry mkBody) <$> buildCreation MarloweV1 reqContract reqRoles reqMinUtxo reqMetadata reqAddresses reqChange reqCollateral
Apply{..} -> second (uncurry mkBody) <$> buildApplication MarloweV1 reqContractId reqInputs reqValidityLowerBound reqValidityUpperBound reqMetadata reqAddresses reqChange reqCollateral
Expand Down

0 comments on commit 60176ec

Please sign in to comment.