You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use `withFundedCluster` to additionaly receive pre-funded keys.
76
+
77
+
Use `withFundedCluster` to additionally receive pre-funded keys.
76
78
77
79
Cluster shuts down when the user action (second argument to `withCluster`) completes.
78
80
Use `startCluster`/`startFundedCluster` and `stopCluster` variants to keep the cluster running.
@@ -82,32 +84,39 @@ Use `startCluster`/`startFundedCluster` and `stopCluster` variants to keep the c
82
84
Plutip is in essence a simpler wrapper over some `cardano-wallet` code for spawning private disposable Cardano clusters.
83
85
84
86
It can be used in a few ways:
87
+
85
88
1. as a library,
86
89
2. as an executable,
87
90
3. indirectly via cardano-transaction-lib (CTL) smart contract tests. This is a facility for testing contracts in an isolated environment: with wallet mocks and a private plutip cluster. See [CTL](https://github.com/Plutonomicon/cardano-transaction-lib/) and their [documentation](https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/testing.md#testing-with-plutip) on Plutip tests. That's very much the recommended way if you're a CTL user.
88
91
4. Historical mention: you could test PAB `Contract`s with Plutip itself, but this functionality is unmantained and was removed as most users switched to [CTL](https://github.com/Plutonomicon/cardano-transaction-lib/). If you're interested check out the archive branch [`plutip-bpi`](https://github.com/mlabs-haskell/plutip/tree/plutip-bpi) and the old [tutorial](https://github.com/mlabs-haskell/plutip/blob/plutip-bpi/docs/interactive-plutip.md).
-`conf :: PlutipConfig` specifies the working directory of a spawned cluster (can be temporary) and in some capacity the parameters of the cluster. Use `Data.Default (def)` to spawn default cluster in a temporary directory.
99
-
-`ClusterEnv` is essentially a wrapper around the node socket. The socket belongs to one of the nodes.
100
-
-`action :: ClusterEnv -> IO a` is a user action which has access to a `cardano-node` in a cluster via `Cardano.Api`.
103
+
104
+
-`conf :: PlutipConfig` specifies the working directory of a spawned cluster (can be temporary) and in some capacity the parameters of the cluster. Use `Data.Default (def)` to spawn default cluster in a temporary directory.
105
+
-`ClusterEnv` is essentially a wrapper around the node socket. The socket belongs to one of the nodes.
106
+
-`action :: ClusterEnv -> IO a` is a user action which has access to a `cardano-node` in a cluster via `Cardano.Api`.
to additionaly receive keys prefunded with specified fund distributions (e.g.Key1 with `[1Lovelace]` andKey2 with `[2Lovelace, 4Lovelace]`).
107
113
108
-
Additionaly there are helpers `startCluster`, `startFundedCluster`, `stopCluster` which are useful when you want your cluster to keep running, instead of shutting down after the IO action is completed.
114
+
to additionally receive keys prefunded with specified fund distributions (e.g.Key1 with `[1Lovelace]` andKey2 with `[2Lovelace, 4Lovelace]`).
115
+
116
+
Additionally there are helpers `startCluster`, `startFundedCluster`, `stopCluster` which are useful when you want your cluster to keep running, instead of shutting down after the IO action is completed.
109
117
110
118
Example:
119
+
111
120
```haskell
112
121
importData.Default (Default (def))
113
122
importPlutip.CardanoApi (currentBlock)
@@ -129,6 +138,7 @@ ada = (*) 1_000_000
129
138
130
139
Plutip provides a `local-cluster` executable.
131
140
You can build it and run with Nix:
141
+
132
142
```bash
133
143
nix run github:mlabs-haskell/plutip#plutip-core:exe:local-cluster -- --help
134
144
```
@@ -145,26 +155,28 @@ As long as you are using CTL's Nix environment (or your setup is based on it) th
145
155
146
156
## Tutorials
147
157
148
-
*[Running disposable local network and building custom runners](./local-cluster/README.md)
158
+
-[Running disposable local network and building custom runners](./local-cluster/README.md)
149
159
<!-- * [CTL-based project with smart contract tests example](...) -->
150
160
151
161
## Advanced network setup
152
162
153
-
*[Tweaking local network](./docs/tweaking-network.md)
154
-
*[How to (re)generate network configs from node config and genesis files](./docs/regenerate-network-configs.md)
163
+
-[Tweaking local network](./docs/tweaking-network.md)
164
+
-[How to (re)generate network configs from node config and genesis files](./docs/regenerate-network-configs.md)
155
165
156
166
## Useful links
157
167
158
-
*[Template for setting up a Nix flake that includes Plutip](https://github.com/MitchyCola/plutip-flake). Kudos to @MitchyCola
168
+
-[Template for setting up a Nix flake that includes Plutip](https://github.com/MitchyCola/plutip-flake). Kudos to @MitchyCola
159
169
160
170
## Plutip for integration testing of smart contracts
161
171
162
172
If your goal is to:
163
-
* run tests with the `tasty` Haskell framework where user can run Plutus contracts (`Contract w s e a`) using the disposable private network set up by Plutip,
164
-
* run contracts in REPL on a local network,
173
+
174
+
- run tests with the `tasty` Haskell framework where user can run
175
+
Plutus contracts (`Contract w s e a`) using the disposable private network set up by Plutip,
176
+
- run contracts in REPL on a local network,
165
177
166
178
then check out [CTL](https://github.com/Plutonomicon/cardano-transaction-lib) or a legacy Plutip revision ([`plutip-bpi`](https://github.com/mlabs-haskell/plutip/tree/plutip-bpi)) or Plutip v1.3.1 and older releases.
167
179
168
180
## Maintenance
169
181
170
-
*[Important notes on updating the `cardano-wallet` dependency](./docs/cardano-wallet-update.md)
182
+
-[Important notes on updating the `cardano-wallet` dependency](./docs/cardano-wallet-update.md)
0 commit comments