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
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
keys-asc: https://apt.llvm.org/llvm-snapshot.gpg.key
- name: Install LLVM
run: sudo apt-get install llvm-19 llvm-19-dev llvm-19-runtime clang-19 clang-tools-19 lld-19 libpolly-19-dev libmlir-19-dev mlir-19-tools
- name: publish starknet-native-compile
run: cargo publish --token ${CRATES_TOKEN} --all-features -p starknet-native-compile
- name: publish sierra emu
run: cargo publish --token ${CRATES_TOKEN} --all-features -p sierra-emu
- name: publish cairo native
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions binaries/starknet-native-compile/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[package]
name = "starknet-native-compile"
readme = "README.md"
description = "A binary for compiling Sierra contracts with Cairo Native"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
anyhow.workspace = true
Expand Down
17 changes: 17 additions & 0 deletions binaries/starknet-native-compile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Starknet Native Compile

A binary for compiling Sierra contracts with [Cairo Native](https://lambdaclass.github.io/cairo_native/cairo_native/).

## Requirements

See [Cairo Native's instructions](https://lambdaclass.github.io/cairo_native/cairo_native/#getting-started) on how to build this binary properly.

## Usage

First, compile a sierra contract class with starknet-native-compile. The contract class format should be compatible with [cairo_lang_starknet_classes::contract_class::ContractClass](https://docs.rs/cairo-lang-starknet-classes/*/cairo_lang_starknet_classes/contract_class/struct.ContractClass.html).

```bash
starknet-native-compile <CONTRACT_CLASS> <OUTPUT_LIBRARY>
```

Then, load and execute the shared library with [cairo_native::executor::AotContractExecutor](https://lambdaclass.github.io/cairo_native/cairo_native/executor/struct.AotContractExecutor.html).
Loading