File tree Expand file tree Collapse file tree 6 files changed +9
-1
lines changed Expand file tree Collapse file tree 6 files changed +9
-1
lines changed Original file line number Diff line number Diff 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```
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change @@ -232,7 +232,7 @@ awaitSlot ::
232232 Slot ->
233233 Eff effs Slot
234234awaitSlot 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'
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import GHC.Generics (Generic)
3131import Ledger (PubKeyHash )
3232import Ledger.TimeSlot (SlotConfig )
3333import Network.Wai.Handler.Warp (Port )
34+ import Numeric.Natural (Natural )
3435import Plutus.PAB.Core.ContractInstance.STM (Activity )
3536import 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"
You can’t perform that action at this time.
0 commit comments