β΅
OpenZeppelin Nile Navigate your StarkNet projects written in Cairo.
Getting started
Create a folder for your project and cd
into it:
mkdir myproject
cd myproject
Create a virtualenv and activate it:
python3 -m venv env
source env/bin/activate
Install nile
:
pip install cairo-nile
Use nile
to quickly set up your development environment:
nile init
...
β¨ Cairo successfully installed!
...
β
Dependencies successfully installed
π Creating project directory tree
β΅οΈ Nile project ready! Try running:
This command creates the project directory structure and installs cairo-lang
, pytest
, and pytest-asyncio
for you. The template includes a makefile to build the project (make build
) and run tests (make test
).
Usage
compile
Compile Cairo contracts. Compilation articacts are written into the artifacts/
directory.
nile compile # compiles all contracts under contracts/
nile compile contracts/MyContract.cairo # compiles single contract
Example output:
$ nile compile
Creating artifacts/abis/ to store compilation artifacts
π€ Compiling all Cairo contracts in the contracts/ directory
π¨ Compiling contracts/Account.cairo
π¨ Compiling contracts/Initializable.cairo
π¨ Compiling contracts/Ownable.cairo
β
Done
clean
Deletes the artifacts/
directory for a fresh start
nile clean
install
Install the latest version of the Cairo language
nile install
version
Print out the Nile version
nile version
Hacking on Nile
Nile uses tox to manage development tasks, you can get a list of available task with tox -av
.
- Install a development version of the package with
python -m pip install .
- Run tests with
tox
- Build the package with
tox -e build
- Format all files with
tox -e format
- Check files formatting with
tox -e lint
License
Nile is released under the MIT License.