Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enitrat/cairo1-template
https://github.com/enitrat/cairo1-template
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/enitrat/cairo1-template
- Owner: enitrat
- Created: 2023-02-09T12:47:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-04T10:02:30.000Z (almost 2 years ago)
- Last Synced: 2024-05-20T03:18:33.398Z (8 months ago)
- Language: Cairo
- Size: 60.5 KB
- Stars: 43
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cairo - `msaug/cairo1-template`
README
# A template to get you started with Cairo 1
Create a repository from this template, clone it locally and run `make install`. Voilà!
## Make commands
- `make install`: Sets up the cairo git submodule
- `make update`: Updates the cairo submodule
- `make build`: Builds the cairo 1 compiler
- `make test dir=`: Runs the tests in a crate
- `make format`: Formats cairo files under `src/`
- `make check-format`: Checks format for files under `src/`
- `make starknet-compile file=`: Runs `starknet-compile` on a cairo file and stores the output under `out/`
- `make language-server`: Builds the Cairo 1 Language Server### Example
```
make starknet-compile file=src/erc20.cairo
make starknet-compile file=src/storage.cairo
```## Language server
To get proper syntax highlighting and code navigation in your editor, you will need the Cairo 1 extension.
You can find instructions on how to install the vscode extension [here](https://github.com/starkware-libs/cairo/blob/main/vscode-cairo/README.md).
You can build the language server manually by running `make language-server`, and then edit the configuration file of the extension to point to full path of the executable under `target/release/language-server`.
The language server needs the corelib/ directory to be present in the root directory of the project, hence it is copied from the cairo submodule when running `make install`.