Skip to content

Commit 9ee36df

Browse files
authored
Add files via upload
1 parent 74fdd43 commit 9ee36df

22 files changed

Lines changed: 295 additions & 0 deletions

File tree

examples/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SIGNIA Examples
2+
3+
These examples are runnable end-to-end using the workspace CLI (`signia-cli`).
4+
5+
Each example includes:
6+
- an input fixture
7+
- a `run.sh` script that compiles + verifies (and optionally publishes to devnet)
8+
- an `expected/` directory with sample outputs
9+
10+
## Prerequisites
11+
- Rust stable
12+
- `signia` CLI available (build from repo root):
13+
- `cargo build -p signia-cli`
14+
- `./target/debug/signia --help`
15+
16+
## Running
17+
From the repository root:
18+
19+
```bash
20+
bash examples/openapi/run.sh
21+
bash examples/dataset/run.sh
22+
bash examples/workflow/run.sh
23+
bash examples/repo-github/run.sh
24+
```
25+
26+
Notes:
27+
- The `expected/` outputs are illustrative. Your actual hashes will change if inputs change.
28+
- The scripts rely on deterministic canonicalization for stable results per input.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"schemaHash": "example_dataset_schema_hash",
3+
"artifactHashes": [
4+
"example_dataset_content_hash"
5+
]
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": "example_dataset_root",
3+
"leaves": [
4+
"example_dataset_schema_hash",
5+
"example_dataset_content_hash"
6+
]
7+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"version": "v1",
3+
"kind": "dataset",
4+
"nodes": [
5+
{
6+
"id": "col:id",
7+
"kind": "column",
8+
"type": "int"
9+
},
10+
{
11+
"id": "col:name",
12+
"kind": "column",
13+
"type": "string"
14+
},
15+
{
16+
"id": "col:score",
17+
"kind": "column",
18+
"type": "int"
19+
}
20+
],
21+
"edges": []
22+
}

examples/dataset/run.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
5+
BIN="${ROOT_DIR}/target/debug/signia"
6+
7+
if [ ! -x "${BIN}" ]; then
8+
echo "signia CLI not found at ${BIN}"
9+
echo "Build it from repo root: cargo build -p signia-cli"
10+
exit 1
11+
fi
12+
13+
INPUT_FILE="${ROOT_DIR}/examples/dataset/sample.csv"
14+
OUT_DIR="${ROOT_DIR}/examples/dataset/out"
15+
mkdir -p "${OUT_DIR}"
16+
17+
echo "== compile =="
18+
"${BIN}" compile "${INPUT_FILE}" --type dataset --out "${OUT_DIR}"
19+
20+
echo "== verify =="
21+
"${BIN}" verify "${OUT_DIR}/schema.json" "${OUT_DIR}/proof.json" --manifest "${OUT_DIR}/manifest.json"
22+
23+
echo "done"

examples/dataset/sample.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
id,name,score
2+
1,alpha,10
3+
2,beta,20
4+
3,gamma,30
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"schemaHash": "example_openapi_schema_hash",
3+
"artifactHashes": []
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"root": "example_openapi_root",
3+
"leaves": [
4+
"example_openapi_schema_hash"
5+
]
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "v1",
3+
"kind": "openapi",
4+
"nodes": [
5+
{
6+
"id": "api:/pets:get",
7+
"kind": "op"
8+
}
9+
],
10+
"edges": []
11+
}

examples/openapi/petstore.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Petstore
4+
version: "1.0.0"
5+
paths:
6+
/pets:
7+
get:
8+
summary: List pets
9+
responses:
10+
"200":
11+
description: OK

0 commit comments

Comments
 (0)