Skip to content

pmuens/cairoground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cairo Playground

Setup

  1. Build Protostar
  2. git clone <url>
  3. mkdir bin
  4. Setup Binary
  5. nix-shell
  6. starknet-devnet

Optional: Update the cairo.cairoFormatPath property in the .vscode/settings.json file. Run which cairo-format within a Poetry shell to get the project-specific cairo-format path.

Optional: Update the python.formatting.blackPath property in the .vscode/settings.json file. Run which black within a Poetry shell to get the project-specific black path.

Useful Commands

# Nix
nix-shell

# StarkNet DevNet
starknet-devnet

# Protostar
./protostar init [--existing]
./protostar test ./tests [--safe-collecting]
./protostar build
./protostar install
./protostar install <url>
./protostar update
./protostar update <submodule-name>
./protostar remove <submodule-name>
./protostar deploy ./build/<name>.json --network <name> [--inputs ...]

# With `protostar.toml` Updates
./protostar -p testnet deploy ./build/<name>.json

# Symlinks
ln -sf ./bin/dist/protostar/protostar protostar

Useful Resources

StarkNet

Cairo

Protostar

Building Protostar

  1. git clone git@github.com:software-mansion/protostar.git
  2. cd protostar
  3. touch shell.nix
  4. Update shell.nix file (see below)
  5. nix-shell
  6. python -m venv .venv
  7. source .venv/bin/activate
  8. pip install --upgrade pip
  9. pip install poetry
  10. poetry install
  11. poe test
  12. poe build

Binaries can be found in the dist directory.

shell.nix file

# shell.nix file
{ pkgs ? import <nixpkgs> { } }:

with pkgs;

mkShell {
  buildInputs = [
    python37Full
    darwin.apple_sdk.frameworks.Accelerate
    gmp
  ];
}

Binary Setup

Note: Requires the binary to be built (see above).

  1. cd <path-to-protostar-project-root-directory>
  2. cp -r dist/ ~/Desktop/
  3. cd ~/Desktop
  4. mv ./dist <path-to-project-root-directory>/bin
  5. ln -sf ./bin/dist/protostar/protostar protostar
  6. ./protostar test