Skip to content

Commit 8605b4f

Browse files
Merge pull request #38 from mlabs-haskell/gergely/repo-rename
Rename the project to bot-plutus-interface
2 parents 2d0440a + 00cacd6 commit 8605b4f

File tree

24 files changed

+159
-159
lines changed

24 files changed

+159
-159
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ usage:
1717
@echo "Available commands:"
1818
@echo " hoogle -- Start local hoogle"
1919
@echo " build -- Run cabal v2-build"
20-
@echo " watch -- Track files: mlabs-pab.cabal, src/* and run 'make build' on change"
20+
@echo " watch -- Track files: bot-plutus-interface.cabal, src/* and run 'make build' on change"
2121
@echo " test -- Run cabal v2-test"
2222
@echo " accept_pirs -- Accept new PIR changes"
23-
@echo " ghci -- Run cabal v2-repl mlabs-pab"
23+
@echo " ghci -- Run cabal v2-repl bot-plutus-interface"
2424
@echo " format -- Apply source code formatting with fourmolu"
2525
@echo " format_check -- Check source code formatting without making changes"
2626
@echo " nixfmt -- Apply nix formatting with nixfmt"
@@ -48,7 +48,7 @@ build: requires_nix_shell
4848
cabal v2-build $(GHC_FLAGS)
4949

5050
watch: requires_nix_shell
51-
while sleep 1; do find src mlabs-pab.cabal | entr -cd make build; done
51+
while sleep 1; do find src bot-plutus-interface.cabal | entr -cd make build; done
5252

5353
test: requires_nix_shell
5454
cabal v2-test
@@ -57,7 +57,7 @@ accept_pirs: requires_nix_shell
5757
stack build --test $(STACK_FLAGS) $(GHC_FLAGS) --ta '-p MarketAction --accept'
5858

5959
ghci: requires_nix_shell
60-
cabal v2-repl $(GHC_FLAGS) mlabs-pab
60+
cabal v2-repl $(GHC_FLAGS) bot-plutus-interface
6161

6262
# Source dirs to run fourmolu on
6363
FORMAT_SOURCES := $(shell git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.hs' )
@@ -113,7 +113,7 @@ update_plutus:
113113
################################################################################
114114
# Geth
115115

116-
build_path = dist-newstyle/build/x86_64-linux/ghc-8.10.4.20210212/mlabs-pab-0.1
116+
build_path = dist-newstyle/build/x86_64-linux/ghc-8.10.4.20210212/bot-plutus-interface-0.1
117117
clear_build:
118118
@[ ! -e $(build_path) ] || rm -rf $(build_path)
119119

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MLabPAB (Plutus Fake PAB)
1+
# Bot Plutus Interface (formerly MLabsPAB or Plutus Fake PAB)
22

33
This is a custom implementation of the PAB as the official one is not ready yet.
44
This PAB is not feature complete, and not fully tested with all use cases, so please use it with care!
@@ -78,7 +78,7 @@ main = do
7878
, -- Protocol params file location relative to the cardano-cli working directory (needed for the cli)
7979
pcProtocolParamsFile = "./protocol.json"
8080
}
81-
MLabsPAB.runPAB @MyContracts pabConf
81+
BotPlutusInterface.runPAB @MyContracts pabConf
8282
```
8383

8484
To run the fake PAB, you need to prepare a few more things:
@@ -102,16 +102,16 @@ cardano-cli address key-hash --verification-key-file VERIFICATION_KEY.vkey
102102

103103
The fake PAB consists of the following modules:
104104

105-
- **MLabsPAB** main entry point
106-
- **MLabsPAB.Server** Servant server, handling http endpoint calls and websockets
107-
- **MLabsPAB.Contract** handling contract effects by creating the necessary files and calling cardano-cli commands (a few effects are mocked)
108-
- **MLabsPAB.PreBalance** doing some preparations so the cli can process the rest (non-ada asset balancing, addig tx inputs, adding minimum lovelaces, add signatories)
109-
- **MLabsPAB.CardanoCLI** wrappers for cardano-cli commands
105+
- **BotPlutusInterface** main entry point
106+
- **BotPlutusInterface.Server** Servant server, handling http endpoint calls and websockets
107+
- **BotPlutusInterface.Contract** handling contract effects by creating the necessary files and calling cardano-cli commands (a few effects are mocked)
108+
- **BotPlutusInterface.PreBalance** doing some preparations so the cli can process the rest (non-ada asset balancing, addig tx inputs, adding minimum lovelaces, add signatories)
109+
- **BotPlutusInterface.CardanoCLI** wrappers for cardano-cli commands
110110
- For development purposes, I created an ssh wrapper, so I can call relay these commands through an ssh connection. This is not nice, unsafe, and pretty slow, so I'm hoping to get rid of this pretty soon.
111-
- **MLabsPAB.UtxoParser** parse the output of the `cardano-cli query utxo` command
112-
- **MLabsPAB.Files** functions for handling script, datum and redeemer files
113-
- **MLabsPAB.Types** configuration for the fake pab
114-
- **MLabsPAB.PreBalance** prepare a transaction before sending to the cli for balancing. This includes:
111+
- **BotPlutusInterface.UtxoParser** parse the output of the `cardano-cli query utxo` command
112+
- **BotPlutusInterface.Files** functions for handling script, datum and redeemer files
113+
- **BotPlutusInterface.Types** configuration for the fake pab
114+
- **BotPlutusInterface.PreBalance** prepare a transaction before sending to the cli for balancing. This includes:
115115
- adding tx inputs to cover fees and outputs
116116
- adding collaterals,
117117
- modifying tx outs to contain the minimum amount of lovelaces

mlabs-pab.cabal renamed to bot-plutus-interface.cabal

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
cabal-version: 3.0
2-
name: mlabs-pab
2+
name: bot-plutus-interface
33
version: 0.1.0.0
44
synopsis: Unofficial PAB implementation
55
description:
66
Unofficial PAB imlementation, using the cardano-cli in the background to submit transactions
77

8-
homepage: https://github.com/mlabs-haskell/mlabs-pab
9-
bug-reports: https://github.com/mlabs-haskell/mlabs-pab
8+
homepage: https://github.com/mlabs-haskell/bot-plutus-interface
9+
bug-reports: https://github.com/mlabs-haskell/bot-plutus-interface
1010
license:
1111
license-file:
1212
author: MLabs
@@ -18,7 +18,7 @@ extra-source-files: README.md
1818

1919
source-repository head
2020
type: git
21-
location: https://github.com/mlabs-haskell/mlabs-pab
21+
location: https://github.com/mlabs-haskell/bot-plutus-interface
2222

2323
-- Common sections
2424

@@ -75,17 +75,17 @@ common common-lang
7575
library
7676
import: common-lang
7777
exposed-modules:
78-
MLabsPAB
79-
MLabsPAB.CardanoCLI
80-
MLabsPAB.ChainIndex
81-
MLabsPAB.Contract
82-
MLabsPAB.Effects
83-
MLabsPAB.Files
84-
MLabsPAB.PreBalance
85-
MLabsPAB.Types
86-
MLabsPAB.UtxoParser
78+
BotPlutusInterface
79+
BotPlutusInterface.CardanoCLI
80+
BotPlutusInterface.ChainIndex
81+
BotPlutusInterface.Contract
82+
BotPlutusInterface.Effects
83+
BotPlutusInterface.Files
84+
BotPlutusInterface.PreBalance
85+
BotPlutusInterface.Types
86+
BotPlutusInterface.UtxoParser
8787

88-
other-modules: MLabsPAB.Server
88+
other-modules: BotPlutusInterface.Server
8989
build-depends:
9090
, aeson ^>=1.5.0.0
9191
, attoparsec >=0.13.2.2
@@ -135,22 +135,23 @@ library
135135

136136
hs-source-dirs: src
137137

138-
test-suite mlabs-pab-test
138+
test-suite bot-plutus-interface-test
139139
import: common-lang
140140
type: exitcode-stdio-1.0
141141
main-is: Spec.hs
142142
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
143143
other-modules:
144-
Spec.MLabsPAB.Contract
145-
Spec.MLabsPAB.PreBalance
146-
Spec.MLabsPAB.UtxoParser
144+
Spec.BotPlutusInterface.Contract
145+
Spec.BotPlutusInterface.PreBalance
146+
Spec.BotPlutusInterface.UtxoParser
147147
Spec.MockContract
148148

149149
build-depends:
150150
, aeson ^>=1.5.0.0
151151
, attoparsec
152152
, base
153153
, base-compat
154+
, bot-plutus-interface
154155
, bytestring ^>=0.10.12.0
155156
, cardano-api
156157
, cardano-crypto-class
@@ -163,7 +164,6 @@ test-suite mlabs-pab-test
163164
, freer-simple
164165
, generic-arbitrary
165166
, lens
166-
, mlabs-pab
167167
, neat-interpolation
168168
, plutus-chain-index
169169
, plutus-chain-index-core

examples/plutus-game/app/Main.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
module Main (main) where
44

5+
import BotPlutusInterface qualified
6+
import BotPlutusInterface.Types (
7+
CLILocation (Local),
8+
HasDefinitions (..),
9+
LogLevel (Debug),
10+
PABConfig (..),
11+
SomeBuiltin (..),
12+
endpointsToSchemas,
13+
)
514
import Cardano.Api (NetworkId (Testnet), NetworkMagic (..))
615
import Cardano.PlutusExample.Game (
716
GameSchema,
@@ -14,15 +23,6 @@ import Data.Aeson qualified as JSON
1423
import Data.Aeson.TH (defaultOptions, deriveJSON)
1524
import Data.ByteString.Lazy qualified as LazyByteString
1625
import Data.Maybe (fromMaybe)
17-
import MLabsPAB qualified
18-
import MLabsPAB.Types (
19-
CLILocation (Local),
20-
HasDefinitions (..),
21-
LogLevel (Debug),
22-
PABConfig (..),
23-
SomeBuiltin (..),
24-
endpointsToSchemas,
25-
)
2626
import Playground.Types (FunctionSchema)
2727
import Schema (FormSchema)
2828
import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http))
@@ -65,4 +65,4 @@ main = do
6565
, pcLogLevel = Debug
6666
, pcProtocolParamsFile = "./protocol.json"
6767
}
68-
MLabsPAB.runPAB @GameContracts pabConf
68+
BotPlutusInterface.runPAB @GameContracts pabConf

examples/plutus-game/plutus-game.cabal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: plutus-game
33
version: 0.1.0.0
44
synopsis: Game example
55
description: Game example running on the fake pab
6-
homepage: https://github.com/mlabs-haskell/mlabs-pab
7-
bug-reports: https://github.com/mlabs-haskell/mlabs-pab
6+
homepage: https://github.com/mlabs-haskell/bot-plutus-interface
7+
bug-reports: https://github.com/mlabs-haskell/bot-plutus-interface
88
license:
99
license-file:
1010
author: MLabs
@@ -16,7 +16,7 @@ extra-source-files: README.md
1616

1717
source-repository head
1818
type: git
19-
location: https://github.com/mlabs-haskell/mlabs-pab
19+
location: https://github.com/mlabs-haskell/bot-plutus-interface
2020

2121
-- Common sections
2222

@@ -125,10 +125,10 @@ library
125125
executable plutus-game-pab
126126
import: common-lang
127127
build-depends:
128-
, aeson ^>=1.5.0.0
128+
, aeson ^>=1.5.0.0
129+
, bot-plutus-interface
129130
, bytestring
130131
, cardano-api
131-
, mlabs-pab
132132
, playground-common
133133
, plutus-game
134134
, plutus-ledger

examples/plutus-nft/app/Main.hs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33

44
module Main (main) where
55

6+
import BotPlutusInterface qualified
7+
import BotPlutusInterface.Types (
8+
CLILocation (Local),
9+
HasDefinitions (..),
10+
LogLevel (Debug),
11+
PABConfig (..),
12+
SomeBuiltin (..),
13+
endpointsToSchemas,
14+
)
615
import Cardano.Api (NetworkId (Testnet), NetworkMagic (..))
716
import Cardano.PlutusExample.NFT (
817
NFTSchema,
@@ -13,15 +22,6 @@ import Data.Aeson.TH (defaultOptions, deriveJSON)
1322
import Data.ByteString.Lazy qualified as LazyByteString
1423
import Data.Maybe (fromMaybe)
1524
import Ledger.Value (TokenName)
16-
import MLabsPAB qualified
17-
import MLabsPAB.Types (
18-
CLILocation (Local),
19-
HasDefinitions (..),
20-
LogLevel (Debug),
21-
PABConfig (..),
22-
SomeBuiltin (..),
23-
endpointsToSchemas,
24-
)
2525
import Playground.Types (FunctionSchema)
2626
import Schema (FormSchema)
2727
import Servant.Client.Core (BaseUrl (BaseUrl), Scheme (Http))
@@ -65,4 +65,4 @@ main = do
6565
, pcLogLevel = Debug
6666
, pcProtocolParamsFile = "./protocol.json"
6767
}
68-
MLabsPAB.runPAB @MintNFTContracts pabConf
68+
BotPlutusInterface.runPAB @MintNFTContracts pabConf

examples/plutus-nft/plutus-nft.cabal

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: plutus-nft
33
version: 0.1.0.0
44
synopsis: NFT example
55
description: NFT example running on the fake pab
6-
homepage: https://github.com/mlabs-haskell/mlabs-pab
7-
bug-reports: https://github.com/mlabs-haskell/mlabs-pab
6+
homepage: https://github.com/mlabs-haskell/bot-plutus-interface
7+
bug-reports: https://github.com/mlabs-haskell/bot-plutus-interface
88
license:
99
license-file:
1010
author: MLabs
@@ -16,7 +16,7 @@ extra-source-files: README.md
1616

1717
source-repository head
1818
type: git
19-
location: https://github.com/mlabs-haskell/mlabs-pab
19+
location: https://github.com/mlabs-haskell/bot-plutus-interface
2020

2121
-- Common sections
2222

@@ -125,10 +125,10 @@ library
125125
executable plutus-nft-pab
126126
import: common-lang
127127
build-depends:
128-
, aeson ^>=1.5.0.0
128+
, aeson ^>=1.5.0.0
129+
, bot-plutus-interface
129130
, bytestring
130131
, cardano-api
131-
, mlabs-pab
132132
, playground-common
133133
, plutus-ledger
134134
, plutus-nft

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
description = "mlabs-pab";
2+
description = "bot-plutus-interface";
33

44
inputs.haskell-nix.url = "github:input-output-hk/haskell.nix";
55
inputs.nixpkgs.follows = "haskell-nix/nixpkgs-unstable";

hie.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cradle:
22
cabal:
33
- path: "./src"
4-
component: "lib:mlabs-pab"
4+
component: "lib:bot-plutus-interface"
55

66
- path: "./test"
7-
component: "test:mlabs-pab-test"
7+
component: "test:bot-plutus-interface-test"
88

99
- path: "./examples/plutus-nft/src"
1010
component: "lib:plutus-nft"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{-# LANGUAGE AllowAmbiguousTypes #-}
22

3-
module MLabsPAB (runPAB) where
3+
module BotPlutusInterface (runPAB) where
44

5+
import BotPlutusInterface.Server qualified as Server
6+
import BotPlutusInterface.Types (PABConfig (..))
57
import Data.Aeson (FromJSON)
68
import Data.Kind (Type)
7-
import MLabsPAB.Server qualified as Server
8-
import MLabsPAB.Types (PABConfig (..))
99
import Network.Wai.Handler.Warp (run)
1010
import Plutus.PAB.Effects.Contract.Builtin (HasDefinitions)
1111
import Prelude
1212

1313
runPAB :: forall (t :: Type). (HasDefinitions t, FromJSON t) => PABConfig -> IO ()
1414
runPAB pabConf = do
15-
putStrLn "Starting MLabsPAB server"
15+
putStrLn "Starting BotPlutusInterface server"
1616
state <- Server.initState
1717

1818
run pabConf.pcPort (Server.app @t pabConf state)

0 commit comments

Comments
 (0)