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
- To update your package to use esbuild, add new `devDependencies` to your `package.json`:
81
+
82
+
```diff
83
+
+ "esbuild": "0.18.11",
84
+
+ "esbuild-plugin-polyfill-node": "^0.3.0",
85
+
+ "esbuild-plugin-wasm": "^1.1.0",
86
+
```
87
+
88
+
Then consult with [the template's build scripts](./templates/ctl-scaffold/esbuild/) - also see the new [Makefile](./templates/ctl-scaffold/Makefile) setup and [NPM scripts](./templates/ctl-scaffold/package.json).
89
+
90
+
### Changed
91
+
92
+
- PureScript compiler version has been updated to v0.15.8. ([#1521](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1521))
93
+
- PureScript v0.15.x outputs and expects ES modules (instead of CommonJS), which means that FFI code in dependent projects should be updated to use [ES module-style imports and exports](https://nodejs.org/api/esm.html), and consumers of CTL-based bundles should expect ES modules as well.
94
+
- Due to limitations of ES modules (inability to patch at runtime), CTL now uses vendored versions of CSL for node and the browser:
-`buildPursDependencies` is a new function that allows to build everything except the source files of a project itself. It allows to skip rebuilding all the dependencies when using Nix every time. `buildPursProject` calls `buildPursDependencies` automatically.
129
+
-`censorCodes` and `strictComp` arguments have been removed from `purescriptProject` and added to `buildPursDependencies` and `buildPursProject` for more granular control.
130
+
-`runPursTest`: new `psEntryPoint` argument, for PureScript-level entry point function ("main" by default).
131
+
-`runE2ETest`: new `runnerMain` and `runnerPsEntryPoint` arguments to control which module should be the runner.
132
+
-`runE2ETest`: new arguments for configuring the E2E test suite: `envFile`, `emptySettingsFile` and `testTimeout`.
133
+
-`bundlePursProjectEsbuild` is a bundling function that uses newly introduced `esbuild`.
134
+
-`bundlePursProject` is renamed to `bundlePursProjectWebpack`
135
+
-`Data.BigInt` (`purescript-bigints`) dependency was replaced with `JS.BigInt` (`purescript-js-bigints`), that uses native JavaScript BigInt instead of `BigInteger.js` library. You can remove `big-integer` NPM dependency from your project, if you don't use it elsewhere. ([#1551](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1551))
136
+
137
+
### Fixed
138
+
139
+
### Removed
140
+
141
+
- Temporarily removed `buildSearchablePursDocs` and `launchSearchablePursDocs` from nix machinery - see [#1578](https://github.com/Plutonomicon/cardano-transaction-lib/issues/1578) for context. Use `buildPursDocs` for now. ([#1521](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1521))
Copy file name to clipboardExpand all lines: doc/babbage-features.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This document is a reference/explainer for the new CTL APIs introduced for Babba
14
14
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15
15
## Reference Inputs
16
16
17
-
[Reference inputs](https://cips.cardano.org/cip/CIP-0031/#reference-inputs) allow looking at an output without spending it in Plutus scripts.
17
+
[Reference inputs](https://cips.cardano.org/cip/CIP-0031#reference-inputs) allow looking at an output without spending it in Plutus scripts.
18
18
19
19
There are two ways to use an input as a reference in the constraints API:
20
20
@@ -28,7 +28,7 @@ There are two ways to use an input as a reference in the constraints API:
28
28
29
29
## Reference Scripts
30
30
31
-
[Reference Scripts](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0033/) allows the use of scripts without attaching them to the transaction (and using a reference instead).
31
+
[Reference Scripts](https://cips.cardano.org/cip/CIP-0033) allows the use of scripts without attaching them to the transaction (and using a reference instead).
32
32
33
33
Reference scripts can be utilized in CTL by first creating a reference point for the script to be used later via `mustPayToScriptWithScriptRef` (or its variants).
34
34
@@ -40,7 +40,7 @@ Then, `mustSpendScriptOutputUsingScriptRef` (or its variants) can be used to use
40
40
41
41
## Inline Data
42
42
43
-
[CIP-32](https://developers.cardano.org/docs/governance/cardano-improvement-proposals/cip-0032/) introduces the inline data feature that allows storing datum values directly in transaction outputs, instead of just the hashes.
43
+
[CIP-32](https://cips.cardano.org/cip/CIP-0032) introduces the inline data feature that allows storing datum values directly in transaction outputs, instead of just the hashes.
44
44
45
45
In CTL, alternating between datum storage options can be achieved by specifying a `DatumPresence` value with constraints that accept it, like `mustPayToPubKeyWithDatum`.
Copy file name to clipboardExpand all lines: doc/ctl-as-dependency.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The following caveats alway applies when using CTL from your project:
24
24
25
25
CTL exposes two `overlay`s from its flake. You can use these in the Nix setup of your own project to use the same setup as we do, e.g. the same packages and PS builders:
26
26
27
-
-`overlays.purescript` contains Purescript builders to compile Purescript sources, build bundles with Webpack (`bundlePursProject`), run unit tests using NodeJS (`runPursTest`), run CTL contracts on a private testnet using Plutip (`runPlutipTest`), or build Pursuit documentation (`buildSearchablePursDocs` and `launchSearchablePursDocs`)
27
+
-`overlays.purescript` contains Purescript builders to compile Purescript sources, build bundles with Webpack (`bundlePursProject`), run unit tests using NodeJS (`runPursTest`), and run CTL contracts on a private testnet using Plutip (`runPlutipTest`).
28
28
-`overlays.runtime` contains various packages and other tools used in CTL's runtime, including `ogmios`, `kupo`, and `plutip-server`. It also defines `buildCtlRuntime` and `launchCtlRuntime` to help you quickly launch all runtime services (see the [runtime docs](./runtime.md))
29
29
30
30
We've split the overlays into two components to allow users to more easily choose which parts of CTL's Nix infrastructure they would like to directly consume. For example, some users do not require a pre-packaged runtime and would prefer to build it themselves with more control over its components (e.g. by directly using `ogmios` from their own `inputs`). Such users might still like to use our `purescript` overlay -- splitting the `overlays` allows us to support this. `overlays.runtime` also contains several haskell.nix packages which may cause issues with `hackage.nix` versions in your own project.
Copy file name to clipboardExpand all lines: doc/development.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ To **build** the project **without bundling and for a NodeJS environment**:
77
77
-`npm run staking-test` to run [Plutip](./plutip-testing.md)-powered tests for ADA staking functionality - [entry point](../test/Plutip/Staking.purs)
78
78
-`npm run blockfrost-test` for [Blockfrost-powered tests](./blockfrost.md) (does not require a runtime, but needs [some setup](./blockfrost.md#setting-up-a-blockfrost-powered-test-suite)) - [entry point](../test/Blockfrost/Contract.purs)
79
79
-`npm run blockfrost-local-test` for self-hosted [Blockfrost-powered tests](./blockfrost.md) (requires a [local Blockfrost runtime](./blockfrost.md#running-blockfrost-locally)) - [entry point](../test/Blockfrost/Contract.purs)
80
-
-`npm run e2e-test` for [tests with a headless browser](./e2e-testing.md) (requires a runtime and the tests served via HTTP)
80
+
-`npm run e2e-test` for [tests with a headless browser](./e2e-testing.md) (requires a runtime and the tests served via HTTP: `npm run start-runtime` and `npm run webpack-serve` or `esbuild-serve`)
81
81
82
82
#### With Nix
83
83
@@ -100,16 +100,16 @@ Here and below, `<SYSTEM>` should be replaced with [one of the supported systems
100
100
101
101
To run or build/bundle the project for the browser:
102
102
103
-
-`npm run e2e-serve` will start a Webpack development server at `localhost:4008`, which is required for [E2E tests](./e2e-testing.md)
104
-
-`npm run build` will output a Webpack-bundled example module to `dist` (or `nix build -L .#ctl-example-bundle-web` to build an example module using Nix into `./result/`)
103
+
-`npm run webpack-serve` will start a Webpack development server at `localhost:4008`, which is required for [E2E tests](./e2e-testing.md)
104
+
-`npm run {webpack|esbuild}-bundle` will output a bundled example module to `dist` (or `nix build -L .#ctl-example-bundle-web-{webpack|esbuild}` to build an example module using Nix into `./result/`)
105
105
106
106
By default, Webpack will build a [Purescript module](../examples/ByUrl.purs) that serves multiple example `Contract`s depending on URL (see [here](./e2e-testing.md#serving-the-contract-to-be-tested)). You can point Webpack to another Purescript entrypoint by changing the `ps-bundle` variable in the Makefile or in the `main` argument in the flake's `packages.ctl-examples-bundle-web`.
107
107
108
-
You will also need a light wallet extension pre-configured.
108
+
You will also need a light wallet extension pre-configured to run a `Contract`.
109
109
110
-
**Note**: The `BROWSER_RUNTIME` environment variable must be set to `1` in order to build/bundle the project properly for the browser (e.g. `BROWSER_RUNTIME=1 webpack ...`). For Node environments, leave this variable unset or set it to `0`.
110
+
**Note**: The `BROWSER_RUNTIME` environment variable must be set to `1` in order to build/bundle the project properly for the browser (e.g. `BROWSER_RUNTIME=1 webpack ...`). For Node environments, leave this variable unset.
111
111
112
-
**Note**: The `KUPO_HOST` environment variable must be set the base URL of the Kupo service in order to successfully run the project for the browser (e.g. `KUPO_HOST=http://localhost:1442`), otherwise all requests to Kupo will fail.
112
+
**Note**: The `KUPO_HOST` environment variable must be set to the base URL of the Kupo service in order to successfully serve the project for the browser (by default, `KUPO_HOST=http://localhost:1442`).
Copy file name to clipboardExpand all lines: doc/e2e-testing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -214,7 +214,7 @@ Note that the test closes successfully after the first successful `Contract` exe
214
214
215
215
CTL offers a function to serve the `Contract`s to be tested with a router, that dispatches contracts and configuration parameters based on query part of the URL.
216
216
217
-
It also builds a page with a table consisting of links to all possible examples with all possible environments, that looks like this:
217
+
It also builds a page with drop-downs, allowing to select an example and an environments, that looks like this:
218
218
219
219

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
15
16
16
-
## Exporting scripts from Plutus
17
+
## Exporting scripts from Plutus or Plutarch
17
18
18
-
See [the-plutus-scaffold](https://github.com/mlabs-haskell/the-plutus-scaffold)'s [exporter](https://github.com/mlabs-haskell/the-plutus-scaffold/tree/main/onchain/exporter) for a pipeline example.
19
+
Usually projects use a Haskell binary called *exporter* that outputs a pre-compiler UPLC bundle into a file.
20
+
21
+
The output file should be a Cardano envelope:
22
+
23
+
```json
24
+
{
25
+
"cborHex": "4e4d01000033222220051200120011",
26
+
"description": "always-succeeds",
27
+
"type": "PlutusScriptV2"
28
+
}
29
+
```
30
+
31
+
- An example of a Plutus exporter can be found [here](https://github.com/Mr-Andersen/ctl-multisign-mre/blob/main/onchain/exporter/Main.hs).
32
+
- For Plutarch, see [the-plutus-scaffold](https://github.com/mlabs-haskell/the-plutus-scaffold)'s [exporter](https://github.com/mlabs-haskell/the-plutus-scaffold/tree/main/onchain/exporter).
33
+
34
+
35
+
### Using Plutonomy
36
+
37
+
It makes sense to use [Plutonomy](https://github.com/well-typed/plutonomy) (an optimizer for UPLC) in the exporter:
0 commit comments