Skip to content

Commit 28aaf6e

Browse files
Merge branch 'master' into sam/fix-remote-cli
2 parents 31266cc + 860ba3c commit 28aaf6e

File tree

6 files changed

+9
-1
lines changed

6 files changed

+9
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ main = do
8383
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
8484
, pcPort = 9080
8585
, pcProtocolParams = protocolParams
86+
, pcTipPollingInterval = 10_000_000
8687
, -- | Slot configuration of the network, the default value can be used for the mainnet
8788
pcSlotConfig = def
8889
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
@@ -97,6 +98,7 @@ main = do
9798
, pcLogLevel = Debug
9899
, -- Protocol params file location relative to the cardano-cli working directory (needed for the cli)
99100
, pcProtocolParamsFile = "./protocol.json"
101+
, pcEnableTxEndpoint = True
100102
}
101103
BotPlutusInterface.runPAB @MyContracts pabConf
102104
```

examples/plutus-game/app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ main = do
5858
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
5959
, pcPort = 9080
6060
, pcProtocolParams = protocolParams
61+
, pcTipPollingInterval = 10_000_000
6162
, pcSlotConfig = def
6263
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
6364
, pcScriptFileDir = "./scripts"

examples/plutus-nft/app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ main = do
5858
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
5959
, pcPort = 9080
6060
, pcProtocolParams = protocolParams
61+
, pcTipPollingInterval = 10_000_000
6162
, pcSlotConfig = def
6263
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
6364
, pcScriptFileDir = "./scripts"

examples/plutus-transfer/app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ main = do
5757
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
5858
, pcPort = 9080
5959
, pcProtocolParams = protocolParams
60+
, pcTipPollingInterval = 10_000_000
6061
, pcSlotConfig = def
6162
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
6263
, pcScriptFileDir = "./scripts"

src/BotPlutusInterface/Contract.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ awaitSlot ::
232232
Slot ->
233233
Eff effs Slot
234234
awaitSlot contractEnv s@(Slot n) = do
235-
threadDelay @w 10_000_000
235+
threadDelay @w (fromIntegral contractEnv.cePABConfig.pcTipPollingInterval)
236236
tip <- CardanoCLI.queryTip @w contractEnv.cePABConfig
237237
case tip of
238238
Right tip'

src/BotPlutusInterface/Types.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import GHC.Generics (Generic)
3131
import Ledger (PubKeyHash)
3232
import Ledger.TimeSlot (SlotConfig)
3333
import Network.Wai.Handler.Warp (Port)
34+
import Numeric.Natural (Natural)
3435
import Plutus.PAB.Core.ContractInstance.STM (Activity)
3536
import Plutus.PAB.Effects.Contract.Builtin (
3637
HasDefinitions (..),
@@ -61,6 +62,7 @@ data PABConfig = PABConfig
6162
pcDryRun :: !Bool
6263
, pcLogLevel :: !LogLevel
6364
, pcOwnPubKeyHash :: !PubKeyHash
65+
, pcTipPollingInterval :: !Natural
6466
, pcPort :: !Port
6567
, pcEnableTxEndpoint :: !Bool
6668
}
@@ -115,6 +117,7 @@ instance Default PABConfig where
115117
, pcNetwork = Testnet (NetworkMagic 42)
116118
, pcProtocolParams = def
117119
, pcSlotConfig = def
120+
, pcTipPollingInterval = 10_000_000
118121
, pcScriptFileDir = "./result-scripts"
119122
, pcSigningKeyFileDir = "./signing-keys"
120123
, pcTxFileDir = "./txs"

0 commit comments

Comments
 (0)