https://github.com/opshin/plutonomy-cli
An extremely simple CLI for well-typed/plutonomy
https://github.com/opshin/plutonomy-cli
Last synced: about 1 year ago
JSON representation
An extremely simple CLI for well-typed/plutonomy
- Host: GitHub
- URL: https://github.com/opshin/plutonomy-cli
- Owner: OpShin
- License: bsd-3-clause
- Created: 2023-01-20T19:44:08.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T16:57:57.000Z (over 2 years ago)
- Last Synced: 2025-02-13T13:15:21.577Z (over 1 year ago)
- Language: Haskell
- Size: 31.3 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Plutonomy-cli
A simple command-line wrapper for [Plutonomy](https://github.com/well-typed/plutonomy) -- an optimizer for UPLC.
See disclaimer notice on Plutonomy.
## Getting Started
### Installation instructions
Install ghc 9.2.8 (i.e. using `ghcup`). Then clone this repo, and in the repository root run
```
cabal install --overwrite-policy=always --install-method=copy plutonomy-cli
```
### Usage
```
plutonomy-cli --help
```
#### Example
First, generate or obtain the script as hex encoded single-wrapped cbor of the flat encoding.
This is usually among the output of the build commands of [uplc](https://github.com/OpShin/uplc), [opshin](https://github.com/OpShin/opshin) or [aiken](https://github.com/aiken-lang/aiken).
```bash
uplc build foo.uplc
```
Then optimize the code using `plutonomy-cli`.
```
plutonomy-cli --default foo/script.cbor > foo/optimized.cbor
```
### Alternatives
While plutonomy is an extremely powerful tool, it is unfortunately not being actively maintained and may not be an adequate choice for new and upcoming projects.
Alternatives include
- the official [plutus](https://github.com/input-output-hk/plutus/releases) `uplc` binary. Run ` uplc-x86_64-linux-ghc928 optimize foo.uplc`.
- _WIP_: [aiken](https://github.com/aiken-lang/aiken). Run `aiken shrink foo/script.cbor --cbor --hex`.
- _WIP_: [uplc](https://github.com/OpShin/uplc). Run `uplc optimize foo.uplc`.