Anoma Developer Documentation
  • Overview
  • Build
    • Getting Started
    • Your First Anoma App
      • Define a Resource
      • Write a Transaction Function
      • Write a Projection Function
      • Run your App
    • Anoma App Examples
  • LEARN
    • Overview
    • State Model
      • Model Comparison
    • Resource Machine
      • Information Flow Control
    • Resources
      • State
      • Logic
      • Kind
      • Lifecycle
    • Transactions
      • Delta
      • Actions
      • Balanced Transactions
      • Intents
    • Applications
      • Backend
      • Interface
    • Services
      • Indexing
      • Solving
Powered by GitBook
On this page
  • Prerequisites
  • Building HelloWorld
  • Project Setup
  1. Build

Your First Anoma App

A tutorial setting you up to build, run, and test your first Anoma application.

PreviousGetting StartedNextDefine a Resource

Last updated 27 days ago

Prerequisites

Before creating your first Anoma dApp, make sure to have .

Building HelloWorld

The goal of this tutorial is to

  1. Define a "Hello World!" .

  2. Write a to initialize the resource.

  3. Write a to allow read-interaction with the application state.

  4. Get your application to run locally.

Project Setup

Let's fly through the project setup by typing the following in our terminal.

~/
mkdir HelloWorld
cd HelloWorld
juvix init

In the following chapter, we're going to construct the scaffolding of the and add our custom label.

Once the Juvix project is created, we want to change the Package.juvix file to the following:

HelloWorld/
module Package;

import PackageDescription.V2 open;

package : Package :=
  defaultPackage@{
    name := "hello-world";
    dependencies :=
      [
        github "anoma" "juvix-stdlib" "v0.11.0";
        github "anoma" "anoma-applib" "v0.10.1";
        github "anoma" "juvix-mtl" "v0.3.0";
      ];
  };

Let's start with some Juvix code. We will first define an Anoma resource.

Juvix installed
Resource
resource object
transaction function
projection function