8000 GitHub - cairo-book/cairo-book: The Cairo Programming Language Book, a comprehensive documentation of the Cairo 1 programming language.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The Cairo Programming Language Book, a comprehensive documentation of the Cairo 1 programming language.

License

Notifications You must be signed in to change notification settings

cairo-book/cairo-book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

All Contributors

The Cairo Programming Language Book

Alexandria

Description

This repository contains the source of "The Cairo Programming Language" book, a comprehensive documentation of the Cairo 1 programming language. This documentation is your go-to resource for mastering Cairo, created and maintained by the Starknet community. You can read the book online.

Created by builders, for builders πŸ“œ

Contribute

Setup

  1. Rust related packages:

    • Install toolchain providing cargo using rustup.
    • Install mdBook and the required extensions:
    cargo install mdbook mdbook-i18n-helpers mdbook-last-changed
    
  2. Host machine packages:

    • Install gettext for translations, usually available with regular package manager: sudo apt install gettext.
    • Install mdbook-quiz-cairo following the instructions here to be able to add interactive quizzes.
  3. Clone this repository.

  4. Install mdbook-cairo to process references and labels, and custom tags.

cargo install --git https://github.com/enitrat/mdbook-cairo

Guidelines

Read the CONTRIBUTING.md file for more details on the style guide and guidelines for contributions to the book.

Work locally

All the Markdown files MUST be edited in english. To work locally:

  • Start a local server with mdbook serve and visit localhost:3000 to view the book. You can use the --open flag to open the browser automatically: mdbook serve --open.

  • Make changes to the book and refresh the browser to see the changes.

  • Open a PR with your changes.

Verifying your Cairo Programs

The cairo-listings CLI tool is designed to wrap all Cairo and Starknet plugins for quickly verifying Cairo programs. You can verify that listings are correct with the verify argument, and generate the corresponding output with the output argument. Install this tool with:

Setup

Firstly, you need to have scarb resolved in your path. See here for more details.

To run the cairo-listings helper tool and verify Cairo programs, ensure that you are at the root of the repository (same directory of this README.md file).

Install the tool with:

cargo install --git https://github.com/enitrat/cairo-listings --locked

and then run:

cairo-listings verify

Usage

The tool scans for all *.cairo files in the specified directory and performs the following actions:

For a Starknet contract:

  • scarb build
  • If it has tests: scarb test

Cairo program:

  • If it has a main function: scarb cairo-run --available-gas=200000000
  • Else, scarb build
  • If it has tests: scarb test
  • scarb fmt -c

To specify which tests to run, you can add a comment at the top of your file with the following format:

// TAG: <tag1>
// TAGS: <tag1>, <tag2>

Here is a list of available tags:

  • does_not_compile: don't run scarb build
  • does_not_run: don't run scarb cairo-run --available-gas=200000000
  • ignore_fmt: don't run scarb fmt
  • tests_fail: don't run scarb test

The mdbook-cairo is a mdbook preprocessor that only removes the // TAG lines in code blocks.

Contributors

Fricoben
Fricoben

πŸ€” πŸ” πŸ“†
Mathieu
Mathieu

πŸ€” πŸ’» πŸ§‘β€πŸ« πŸ‘€ πŸ“† 🚧 πŸ”§
Nadai
Nadai

🌍
glihm
glihm

πŸ’» πŸ”§
ClΓ©ment Walter
ClΓ©ment Walter

πŸ‘€
V.O.T
V.O.T

πŸ’»
Pia
Pia

πŸ’» πŸ“
cryptonerdcn
cryptonerdcn

🌍
Argetlames
Argetlames

🌍
julio4
julio4

πŸ’» πŸ”§
Haresh Gedia
Haresh Gedia

πŸ“–
Darlington Nnam
Darlington Nnam

πŸ’»
Tiago Neto
Tiago Neto

πŸ‘€
omahs
omahs

πŸ’»
Shramee Srivastav
Shramee Srivastav

πŸ’»
Daniel Bejarano
Daniel Bejarano

πŸ’»
Tristan
Tristan

πŸ’» 🚧 πŸ‘€
okhai.stark ( Tony Stark )
okhai.stark ( Tony Stark )

πŸ’»
shwang
shwang

πŸ’»
kwkr
kwkr

πŸ’»
ArnaudBD
ArnaudBD

πŸ’»
Jimmy Fate
Jimmy Fate

πŸ’»
SimplementeCao
SimplementeCao

πŸ’»
Lucas @ StarkWare
Lucas @ StarkWare

πŸ’»
RΓ©my Baranx
RΓ©my Baranx

πŸ’»
Steven Cordero
Steven Cordero

πŸ“–
Symmaque
Symmaque

πŸ“– πŸ’»
Asher
Asher

πŸ’»
Nenad Misić
Nenad Misić

πŸ“– πŸ’»
Teddy Not Bear
Teddy Not Bear

πŸ“–
Malatrax
Malatrax

πŸ“– πŸ’»
Beeyoung
Beeyoung

πŸ“– πŸ’»
Charlotte
Charlotte

πŸ“– πŸ’»
Oba
Oba

πŸ“–
martin machiebe
martin machiebe

πŸ“–
Jean-Michel
Jean-Michel

πŸ“– πŸ’»
Emmanuel A Akalo
Emmanuel A Akalo

πŸ“– πŸ’»
Supreme Labs
Supreme Labs

πŸ“– πŸ’»
blocksorcerer
blocksorcerer

πŸ“– πŸ’»
quentin-abei
quentin-abei

πŸ“– πŸ’»
0xjarix
0xjarix

πŸ“–
kkawula
kkawula

πŸ“– πŸ’»
0