Skip to content

Commit e406338

Browse files
committed
Apply pre-commit fixes & formatting
1 parent f3803f2 commit e406338

14 files changed

+213
-196
lines changed

.markdownlint.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# default: true
2+
MD013: false
3+
MD024: false
4+
MD033: false
5+
MD036: false
6+
# MD041: false
7+
# MD022: false

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
This format is based on [Keep A Changelog](https://keepachangelog.com/en/1.0.0).
44

5-
65
## Unreleased (Plutip-Core)
76

87
### Changed

README.md

+42-30
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ For smart contract testing see [CTL integration with Plutip](https://github.com/
1616
**Table of Contents**
1717

1818
- [Plutip](#plutip)
19-
- [Prerequisites](#prerequisites)
20-
- [When using Plutip as a Haskell library](#when-using-plutip-as-a-haskell-library)
21-
- [Quick start](#quick-start)
22-
- [Run as an executable](#run-as-an-executable)
23-
- [Use in a Haskell program](#use-in-a-haskell-program)
24-
- [Overview](#overview)
25-
- [As a library](#as-a-library)
26-
- [As an executable](#as-an-executable)
27-
- [Via CTL for contract testing](#via-ctl-for-contract-testing)
28-
- [Tutorials](#tutorials)
29-
- [Advanced network setup](#advanced-network-setup)
30-
- [Useful links](#useful-links)
31-
- [Plutip for integration testing of smart contracts](#plutip-for-integration-testing-of-smart-contracts)
32-
- [Maintenance](#maintenance)
19+
- [Prerequisites](#prerequisites)
20+
- [When using Plutip as a Haskell library](#when-using-plutip-as-a-haskell-library)
21+
- [Quick start](#quick-start)
22+
- [Run as an executable](#run-as-an-executable)
23+
- [Use in a Haskell program](#use-in-a-haskell-program)
24+
- [Overview](#overview)
25+
- [As a library](#as-a-library)
26+
- [As an executable](#as-an-executable)
27+
- [Via CTL for contract testing](#via-ctl-for-contract-testing)
28+
- [Tutorials](#tutorials)
29+
- [Advanced network setup](#advanced-network-setup)
30+
- [Useful links](#useful-links)
31+
- [Plutip for integration testing of smart contracts](#plutip-for-integration-testing-of-smart-contracts)
32+
- [Maintenance](#maintenance)
3333

3434
<!-- markdown-toc end -->
3535

@@ -42,8 +42,8 @@ For smart contract testing see [CTL integration with Plutip](https://github.com/
4242

4343
If your project is importing and making use of `Plutip`s library you will need to make sure that the following executables are present in your `PATH`:
4444

45-
* `cardano-cli` executable available in the environment
46-
* `cardano-node` executable available in the environment
45+
- `cardano-cli` executable available in the environment
46+
- `cardano-node` executable available in the environment
4747

4848
The following GHC flags must be used in order for Plutip to run: `-threaded -rtsopts`.
4949

@@ -68,11 +68,13 @@ nix run .#plutip-core:exe:local-cluster -- --help
6868
### Use in a Haskell program
6969

7070
Launch local cluster with:
71+
7172
```haskell
7273
withCluster :: PlutipConfig -> (ClusterEnv -> IO a) -> IO a
7374
withCluster conf action
7475
```
75-
Use `withFundedCluster` to additionaly receive pre-funded keys.
76+
77+
Use `withFundedCluster` to additionally receive pre-funded keys.
7678

7779
Cluster shuts down when the user action (second argument to `withCluster`) completes.
7880
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
8284
Plutip is in essence a simpler wrapper over some `cardano-wallet` code for spawning private disposable Cardano clusters.
8385

8486
It can be used in a few ways:
87+
8588
1. as a library,
8689
2. as an executable,
8790
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.
8891
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).
8992

9093
### As a library
9194

92-
Launch local cluster with
95+
Launch local cluster with
96+
9397
```haskell
9498
withCluster :: PlutipConfig -> (ClusterEnv -> IO a) -> IO a
9599
withCluster conf action
96100
```
101+
97102
where:
98-
- `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`.
101107

102108
Use
109+
103110
```haskell
104111
withFundedCluster :: PlutipConfig -> [[Lovelace]] -> (ClusterEnv -> [KeyPair] -> IO a) -> IO a
105112
```
106-
to additionaly receive keys prefunded with specified fund distributions (e.g. Key 1 with `[1 Lovelace]` and Key 2 with `[2 Lovelace, 4 Lovelace]`).
107113

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. Key 1 with `[1 Lovelace]` and Key 2 with `[2 Lovelace, 4 Lovelace]`).
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.
109117

110118
Example:
119+
111120
```haskell
112121
import Data.Default (Default (def))
113122
import Plutip.CardanoApi (currentBlock)
@@ -129,6 +138,7 @@ ada = (*) 1_000_000
129138

130139
Plutip provides a `local-cluster` executable.
131140
You can build it and run with Nix:
141+
132142
```bash
133143
nix run github:mlabs-haskell/plutip#plutip-core:exe:local-cluster -- --help
134144
```
@@ -145,26 +155,28 @@ As long as you are using CTL's Nix environment (or your setup is based on it) th
145155

146156
## Tutorials
147157

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)
149159
<!-- * [CTL-based project with smart contract tests example](...) -->
150160

151161
## Advanced network setup
152162

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)
155165

156166
## Useful links
157167

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
159169

160170
## Plutip for integration testing of smart contracts
161171

162172
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,
165177

166178
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.
167179

168180
## Maintenance
169181

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

Comments
 (0)