Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Compact native scripts
# Warden tool

CLI-based application to generate compact code that checks commitments and time-lock conditions based on multisignature scripts. Accepts JSON inputs structured around Cardano native script patterns, supporting nested conditions (`any`, `all`, `atLeast`).

Expand All @@ -11,17 +11,23 @@ The idea is that the CLI generates a Compact contract module that can be used to

## Table of Contents

- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Documentation](#documentation)
- [Authorization workflow](#authorization-workflow)
- [Commands](#commands)
- [Commitment generator](#commitment-generator)
- [Script wizard](#script-wizard)
- [Compact code generator](#compact-code-generator)
- [Compile](#compile)
- [Test](#test)
- [E2E example](#e2e-example)
- [Warden tool](#warden-tool)
- [Table of Contents](#table-of-contents)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install CLI globally](#install-cli-globally)
- [Documentation](#documentation)
- [Authorization workflow](#authorization-workflow)
- [Participant](#participant)
- [Script author](#script-author)
- [Commands](#commands)
- [Commitment generator](#commitment-generator)
- [Script wizard](#script-wizard)
- [Usage](#usage)
- [Compact code generator](#compact-code-generator)
- [Compile](#compile)
- [Test](#test)
- [E2E example](#e2e-example)

## Prerequisites

Expand All @@ -37,6 +43,25 @@ Install dependencies
pnpm install
```

### Install CLI globally

Build the project, then register the `warden-tool` binary on your PATH:

```bash
pnpm build
pnpm link --global
```

Now `warden-tool` is available as a system-wide command:

```bash
warden-tool --help
warden-tool generate-code -i <input-file>
warden-tool make-commitment -s <seed>
```

> **Note:** `pnpm link --global` creates a symlink to your local build. After pulling changes or rebuilding, the command reflects updates automatically.

## Documentation

See [docs/schema.md](docs/schema.md) for the complete schema design documentation, and [docs/design.md](docs/design.md) for a description of the Compact code that the CLI generates and usage instructions.
Expand Down Expand Up @@ -156,6 +181,8 @@ and composites (`any`/`all`/`atLeast`) — and writes the result to a JSON file
(defaults to `script.json`).
Ensure all commitments required have been gathered prior to running this command.

## Usage

### Compact code generator

```bash
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "compact-native-scripts",
"name": "warden-tool",
"version": "1.0.0",
"type": "module",
"description": "",
"main": "index.js",
"bin": {
"warden-tool": "./dist/cli.js"
},
"scripts": {
"generate-code": "tsx src/cli.ts generate-code",
"make-commitment": "tsx src/cli.ts make-commitment",
Expand Down
2 changes: 2 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

import { program } from 'commander';
import { readFileSync, mkdirSync, writeFileSync } from 'fs';
import path from 'path';
Expand Down
Loading