Cairo version: https://cairo-lang.org/playground
StarkNet version: https://starknet.io/playground
Playground environment for those who want to learn and get to know Cairo language better.
Build and debug simple Cairo programs or even build, compile and deploy Cairo smart contracts.
This project was bootstrapped with Create React App.
We are managing 2 different build flows to support Cairo
and StarkNet
modes. Components will dynamically build the
UI according to the mode value in the AppProvider
.
Cairo
- The default mode. Here you can write simple Cairo programs, run, debug and prove them using SHARP.
StarkNet
- Dedicated mode for StarkNet, our L2 network over Ethereum. In this mode you can write Cairo smart contracts, compile and deploy them to the network.
- Install
npm
andNode.js
. See Guide. - Make sure you've
yarn
installed globally on your machinenpm i -g yarn
.
Clone and run yarn
to install dependencies:
git clone https://github.com/starkware-libs/cairo-playground.git
cd cairo-playground
yarn install
yarn run start
- starts the development server with the default Cairo
mode.
yarn run start:starknet
- starts the development server with StarkNet
mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
yarn run build
- builds the default Cairo
mode.
yarn run build:starknet
- builds the StarkNet
mode.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
.env
files are increasingly popular as a way to configure an application. Their values are injected into the
application bundle during build time.
The appropriate files are loaded according to the NODE_ENV
value.
.env
(global values for all environments)
.env.development
(values for development env, i.e NODE_ENV=development
)
.env.test
(values for testing env, i.e, NODE_ENV=test
)
.env.production
(values for production env, i.e, NODE_ENV=production
)
Note: each file can be overridden on a local environment using matching
.env.[ENV].local
file.
By default, SHARP endpoint isn't available on local environment. i.e, you can't prove programs when running on local
machine.
For making this feature available so the app will use SHARP endpoint, you can use the above flag.
By default, StarkNet endpoint isn't available on local environment. i.e, you can't deploy programs when running on your
local machine.
For making this feature available so the app will use StarkNet endpoint, you can use the above flag.
Runs the app on local env in StarkNet mode with deploy feature available.
Runs the app on local env in Cairo mode with prove feature available.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
TBD