Quickstart
Make an API call to the Stacks API and handle the response.
You will learn the following:
- Generate a new project with the
clarinet
CLI - Create a smart contract with Clarity
- Verify and debug your smart contract in your terminal
Install clarinet
Hiro's Clarinet package comes with several helpful commands to get you up and running with your project.
To get started, install the package on your machine:
Generate a new hello-world
project
Navigate to a directory in your terminal where you want to create your project. Then in your terminal, run the following command:
The result should be a new hello-world
directory resembling the following:
Create a say-hello
contract
- Navigate to your project by running
cd hello-world
. - Inside your project, use the
clarinet contract new
command to generate a new contract.
This will add 2 files to your project: say-hello.clar
and say-hello.test.ts
.
It also updates the Clarinet.toml
file with your new contract.
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.
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.
Next steps
Last updated on