Your First Anoma App

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

Prerequisites

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

Building HelloWorld

The goal of this tutorial is to

  1. Define a "Hello World!" Resource.

  2. Write a transaction function initializing the resource.

Project Setup

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

~/
mkdir HelloWorld
cd HelloWorld
juvix init
# (1) Next, type 'hello-world' for the project name
# (2) Finally, press 'Enter' to choose the default version number

In the following chapter, we're going to construct the scaffolding of the resource object 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 := "anoma-devnet-apps";
    main := just "Main.juvix";
    dependencies :=
      [
        defaultStdlib;
        github "anoma" "anoma-applib" "e99381ffc0258dd1eacaf6945bd05cf06c6409ea";
      ];
  };

The current Package.juvix file specifies the anoma-applib dependency by referencing a specific git commit (e99381). This library is work in progress and the reference will change until a stable library version is released.

Last updated