Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ main = do
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
, pcPort = 9080
, pcProtocolParams = protocolParams
, pcTipPollingInterval = 10_000_000
, -- | Slot configuration of the network, the default value can be used for the mainnet
pcSlotConfig = def
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
Expand All @@ -97,6 +98,7 @@ main = do
, pcLogLevel = Debug
, -- Protocol params file location relative to the cardano-cli working directory (needed for the cli)
, pcProtocolParamsFile = "./protocol.json"
, pcEnableTxEndpoint = True
}
BotPlutusInterface.runPAB @MyContracts pabConf
```
Expand Down
1 change: 1 addition & 0 deletions examples/plutus-game/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ main = do
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
, pcPort = 9080
, pcProtocolParams = protocolParams
, pcTipPollingInterval = 10_000_000
, pcSlotConfig = def
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
, pcScriptFileDir = "./scripts"
Expand Down
1 change: 1 addition & 0 deletions examples/plutus-nft/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ main = do
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
, pcPort = 9080
, pcProtocolParams = protocolParams
, pcTipPollingInterval = 10_000_000
, pcSlotConfig = def
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
, pcScriptFileDir = "./scripts"
Expand Down
1 change: 1 addition & 0 deletions examples/plutus-transfer/app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ main = do
, pcChainIndexUrl = BaseUrl Http "localhost" 9083 ""
, pcPort = 9080
, pcProtocolParams = protocolParams
, pcTipPollingInterval = 10_000_000
, pcSlotConfig = def
, pcOwnPubKeyHash = "0f45aaf1b2959db6e5ff94dbb1f823bf257680c3c723ac2d49f97546"
, pcScriptFileDir = "./scripts"
Expand Down
2 changes: 1 addition & 1 deletion src/BotPlutusInterface/Contract.hs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ awaitSlot ::
Slot ->
Eff effs Slot
awaitSlot contractEnv s@(Slot n) = do
threadDelay @w 10_000_000
threadDelay @w (fromIntegral contractEnv.cePABConfig.pcTipPollingInterval)
tip <- CardanoCLI.queryTip @w contractEnv.cePABConfig
case tip of
Right tip'
Expand Down
3 changes: 3 additions & 0 deletions src/BotPlutusInterface/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import GHC.Generics (Generic)
import Ledger (PubKeyHash)
import Ledger.TimeSlot (SlotConfig)
import Network.Wai.Handler.Warp (Port)
import Numeric.Natural (Natural)
import Plutus.PAB.Core.ContractInstance.STM (Activity)
import Plutus.PAB.Effects.Contract.Builtin (
HasDefinitions (..),
Expand Down Expand Up @@ -61,6 +62,7 @@ data PABConfig = PABConfig
pcDryRun :: !Bool
, pcLogLevel :: !LogLevel
, pcOwnPubKeyHash :: !PubKeyHash
, pcTipPollingInterval :: !Natural
, pcPort :: !Port
, pcEnableTxEndpoint :: !Bool
}
Expand Down Expand Up @@ -115,6 +117,7 @@ instance Default PABConfig where
, pcNetwork = Testnet (NetworkMagic 42)
, pcProtocolParams = def
, pcSlotConfig = def
, pcTipPollingInterval = 10_000_000
, pcScriptFileDir = "./result-scripts"
, pcSigningKeyFileDir = "./signing-keys"
, pcTxFileDir = "./txs"
Expand Down