#smart-contracts #blockchain #repl #clarity #blockstack #command-line-tool

yanked clarinet

Clarinet is a clarity runtime packaged as a command line tool, designed to facilitate smart contract understanding, development, testing and deployment

0.10.0 Jun 9, 2021
0.8.0 May 5, 2021
0.3.0 Mar 20, 2021

#9 in #clarity

28 downloads per month

GPL-3.0-only

12MB
174K SLoC

JavaScript 135K SLoC // 0.1% comments TypeScript 29K SLoC // 0.3% comments Rust 10K SLoC // 0.0% comments

clarinet

Clarinet is a clarity runtime packaged as a command line tool, designed to facilitate smart contract understanding, development, testing and deployment.

Clarity is a decidable smart contract language that optimizes for predictability and security, designed by Blockstack. Smart contracts allow developers to encode essential business logic on a blockchain.

screenshot

Installation

Install from cargo

Assuming you have a working installation of Rust, Clarinet can be also be installed from Cargo as a crate, or from source.

$ cargo install clarinet --locked

Install from source

$ git clone git@github.com:lgalabru/clarinet.git
$ cd clarinet
$ cargo install --path . --locked

Install from brew

Not recommended at this point, but you can install an outdated version with:

$ brew install lgalabru/clarinet/clarinet

Feel free to ⭐️ this repo! With 50+ stars, this package becomes eligible to homebrew-core, and I'll work on the automation to make sure that the brew is always pointing to the latest and greatest version.

Getting started with clarinet

Create a new project

Once installed, you can use clarinet to create a new project:

$ clarinet new my-project
$ cd my-project

Clarinet will be maintaining a working directory with the following directory layout:

$ tree .
.
├── Clarinet.toml
├── README.md
├── contracts
   └── bbtc.clar
├── settings
   └── Development.toml
   └── Mocknet.toml
└── tests
    └── bbtc_test.ts

Add a new contract

New contracts can be added manually, or with the following command:

$ clarinet contract new bbtc

Check the syntax of your contracts

$ clarinet check

Execute a test suite

$ clarinet test

Load contracts in a console

$ clarinet console

Deploy contracts to mocknet

$ clarinet deploy --mocknet

Dependencies

~120MB
~2.5M SLoC