Quickstart
Create your first project in less than 2 minutes
Let's build a very simple hello-world
project to demonstrate how easy it is to get started building on Stacks.
Install clarinet
First, let's make sure we've installed clarinet
so that we can use the command line tools.
brew install clarinet
Create a new hello-world
project
Now let's create a hello-world
project. This will scaffold all the necessary files and directories for us to get started.
clarinet new hello-world
Create a say-hello
contract
Now that our project has been generated we can start creating our first contract. Let's name this one say-hello
.
cd hello-world
clarinet contract new say-hello
Create a read-only
function called say-hi
Now that we have our say-hello.clar
file generated, let's create a read-only
function that prints out "Hello World".
(define-read-only (say-hi)
(print "Hello World")
)
Verify your contracts
In order to verify that our code is valid, we can run clarinet check
inside of our project directory to ensure our say-hi
function is valid.
clarinet check
✔ 1 contract checked
And that's it! You can now run clarinet check
to verify that your contract is valid.
Last updated on 5/17/2024