A simple environment to start building on Starknet with Cairo

Overview

Starknet Boilerplate

A simple environment to start building on Starknet with Cairo. Uses Nile for compilation/deployment and Starknetjs for contract invokes/calls.

Note: Mac and Mac M1 have special instructions at the bottom.

Setup

  1. Install js dependencies npm install

  2. Install the latest Nile (equivalent to hardhat) with custom port availability

python3 -m venv env
source env/bin/activate
git clone https://github.com/OpenZeppelin/nile.git
env/bin/python3 -m pip install --upgrade pip
pip install ./nile

Note: You'll run these commands every time you develop.

  1. Setup project nile init

Optional: Add the following to your ~/.zprofile to quickly spin up your environment each time: alias envsetup="python3 -m venv env; source env/bin/activate; git clone https://github.com/OpenZeppelin/nile.git; env/bin/python3 -m pip install --upgrade pip; pip install ./nile; nile init"

Usage

Ensure you're in a Python environment (see step 2 above) before executing the following commands:

  1. Spin up a node (in a separate terminal window w/ the python environment running) nile node --port localhost:5001

Note: Some systems have a conflict with port 5000 which is why I chose 5001

  1. Compiling and deploy a sample contract (in /contracts directory) npm run compile

  2. Run transactions against your contract npm run build

These commands will test and deploy against your local node. If you want to deploy to the goerli testnet, use --network goerli instead.

Starknet Setup on Mac M1

Why do we need a special install guide?

  1. M1 Macs use a new architecture which is not compatible with some dependencies (e.g. homebrew). More info*

  2. Install Homebrew

/usr/sbin/softwareupdate --install-rosetta --agree-to-license
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Note: From here on out, you need to use arch -x86_64 brew install to install packages w/ homebrew.

  1. Install required dependencies
arch -x86_64 brew install gmp
npm install
  1. Install the latest Nile (equivalent to hardhat) with custom port availability
python3 -m venv env
source env/bin/activate
git clone https://github.com/OpenZeppelin/nile.git
env/bin/python3 -m pip install --upgrade pip
pip install ./nile

Optional: Add the following to your ~/.zprofile to quickly spin up your environment each time: alias envsetup="python3 -m venv env; source env/bin/activate; git clone https://github.com/OpenZeppelin/nile.git; env/bin/python3 -m pip install --upgrade pip; pip install ./nile; nile init"

You might also like...

Solana Boilerplate - Lightweight boilerplate for Solana dapps. Allows quick building and prototyping.

Solana Boilerplate - Lightweight boilerplate for Solana dapps. Allows quick building and prototyping.

Lightweight boilerplate for Solana dapps. Allows quick building and prototyping. Feel free to contribute or fork this repository. Make it yours! Leave us a ⭐️ if this repo helped you.

Nov 15, 2022

A few simple, but solid patterns for responsive HTML email templates and newsletters. Even in Outlook and Gmail.

Cerberus Responsive Email Patterns Coding regular emails is hard enough by itself. Making them responsive shouldn’t add to the headache. A few simple,

Dec 28, 2022

A simple Vue3, Nuxt3 and Tailwind3 Starter Template

Nuxt 3 + Tailwind CSS 3 Starter This is a minimal starter template for Nuxt 3 projects with Tailwind CSS 3. It includes a simple template pages/index.

Feb 11, 2022

A simple Fast CLI that create Express+Mongoose MVC pattern

express-schema-generator Site | Docs | Contributing | Code of Conduct | Twitter | Chat Bored Writing and Creating the Same Express MVC Folders Again a

Aug 15, 2022

A set of librairies in Cairo for use on StarkNet

Sekai StarkNet Libraries A series of libraries to help using Cairo on StarkNet. Examples for use in other Cairo contracts are provided in examples. Co

Nov 14, 2022

Starknet Burner is a web/mobile wallet for Starknet that works as a plugin for Argent-X

A Javascript wallet to interact with Starknet from mobile and web applications. Warning ** Experimental Project ** This project is still in developmen

Jan 5, 2023

StarkNet support extension for VSCode. Visualize StarkNet contracts: view storage variables, external and view functions, and events.

StarkNet support extension for VSCode. Visualize StarkNet contracts: view storage variables, external and view functions, and events.

StarkNet Explorer extension This VSCode extension quickly shows relevant aspects of StarkNet contracts: Storage variables of the current contract, and

Nov 4, 2022

An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪

An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪

Example Streaming App 🚀 🚀 This repository serves as a point of reference when developing a streaming application with Memgraph and a message broker

Dec 20, 2022

Workshop for starknetCC (nextjs x starknetjs x cairo)

Workshop for starknetCC (nextjs x starknetjs x cairo)

NextJS - Starknet.js - Cairo • Workshop StarknetCC - Full dApp workshop by Alpha Road team You'll find the PDF presentation here Introduction This wor

Nov 8, 2022

The (unofficial) Cairo extension for vscode

The (unofficial) Cairo extension for vscode

Cairo extension (unofficial) Introduction The Starkware team is doing a great job in developing the Cairo language and the Starknet layer2. At the tim

Sep 29, 2022

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your production environment to your development environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and a CLI tool.

Dec 24, 2022

ForgJs is a javascript lightweight object validator. Go check the Quick start section and start coding with love

ForgJs is a javascript lightweight object validator. Go check the Quick start section and start coding with love

Hey every one im really happy that this repo reached this many stars 🎉 ,but this repo needs your contibution I started to better document the code th

Dec 21, 2022

Modern, Flexible Starknet Dapp Template

cairopal • Modern, Flexible Starknet Dapp Template. Developing Clone the repository git clone [email protected]:a5f9t4/cairopal.git cd cairopal Install D

Sep 28, 2022

Verbosely Documented, Minimal Starknet Contract Examples.

cairo-by-example • Verbosely Documented, Minimal Starknet Contract Examples. Cairo By Example deployed to https://cairo-by-example.xyz Developing Clon

Dec 6, 2022

Multi-signature functionality for StarkNet

Multi-signature functionality for StarkNet

Starknet multisig Multi-signature functionality for StarkNet. ⚠️ WARNING! ⚠️ This repo contains highly experimental code which relies on other highly

Dec 24, 2022

This is a development platform to quickly generate, develop & deploy smart contract based applications on StarkNet.

This is a development platform to quickly generate, develop & deploy smart contract based applications on StarkNet.

generator-starknet This is a development platform to quickly generate, develop, & deploy smart contract based apps on StarkNet. Installation First, in

Nov 18, 2022

StarkNet wallet - dApp bridge

get-starknet StarkNet wallet - dApp bridge Alpha version Goals Allow dApps to seamlessly connect to any wallet on StarkNet Allow wallets to seamless

Dec 21, 2022

Adapter application for consuming web3 messages from ie. wallets, and passing them on to starknet

🐍 StarknNet web3 account Development setup Clone deps with submodules git clone --recurse-submodules [email protected]:software-mansion-labs/starknet-we

Nov 21, 2022

scaffold-stark is a forkable StarkNet dev stack focused on fast product iterations, inspired by scaffold-eth.

scaffold-stark is a forkable StarkNet dev stack focused on fast product iterations, inspired by scaffold-eth.

💠 scaffold-stark scaffold-stark is a forkable StarkNet dev stack focused on fast product iterations, inspired by scaffold-eth. Drop in your Cairo sma

Oct 7, 2022
Owner
threepwave
threepwave
Very minimalistic boilerplate to start most Typescript Express projects. Includes Mongodb connection via Mongoose with a sample post model.

Minimalist express-typescript-boilerplate Available Scripts - `tsc' - builds the tsc project to the dist folder - `build` - cleans the previous build

Black Axe 16 Dec 13, 2022
A starter project to run your local server, and start sending voice packets to Deepgram

A starter project to run your local server, and start sending voice packets to Deepgram

Filip Grebowski 7 Sep 30, 2022
A professional front-end template for building fast, robust, and adaptable web apps or sites.

HTML5 Boilerplate HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites. This project is t

H5BP 53.8k Dec 28, 2022
Webplate is an awesome front-end framework that lets you stay focused on building your site or app all the while remaining really easy to use.

Webplate Framework Webplate is an awesome front-end framework that lets you stay focused on building your site or app all the while remaining really e

Chris Humboldt 560 Nov 24, 2022
IDE and toolkit for building scalable web applications with React, Redux and React-router

An all-in-one solution for creating modern React apps Rekit is a toolkit for building scalable web applications with React, Redux and React-router. It

Rekit 4.5k Jan 2, 2023
A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose

By running a single command, you will get a production-ready Node.js app installed and fully configured on your machine. The app comes with many built-in features, such as authentication using JWT, request validation, unit and integration tests, continuous integration, docker support, API documentation, pagination, etc. For more details, check the features list below.

Hagop Jamkojian 5k Dec 31, 2022
A boilerplate application for building Node.js back-end application in TypeScript

RESTful API Node Server Boilerplate A boilerplate/starter project for quickly building RESTful APIs and with typescript ?? Installation Install the de

Youssef Hajjari 14 Nov 23, 2022
Node Express Template (NET.ts) - a small template project which help you to speed up the process of building RESTful API

Node Express Template (NET.ts) - a small template project which help you to speed up the process of building RESTful API

Przemek Nowicki 26 Jan 4, 2023
Opinionated SvelteKit Template for building web applications.

Opinionated SvelteKit Template for building web applications.

Manassarn 7 Jan 1, 2023
An experiment in building a public facing personal knowledge web app with TiddlyWiki and Nodejs.

Maarfapad What is this? Maarfapad was my attempt at learning Expressjs back in 2016 while building a CRUD app to handle TiddlyWiki html files. It was

A.B. Samma 3 Mar 12, 2022