This page explains how to run your application locally.
Amazing, we have written the code we need to compile a HelloWorld resource object and can create a transaction to initialize our HelloWorld resource. Let's run through these steps by starting with the setup of the local Anoma Client and Node.
Anoma Client and Node
The following way of running the Anoma Client and Node are temporary and thus, Work-In-Progress areas which are specific to the current stage of the devnet.
First and foremost, we need a local version of the artem/juvix-node-integration-v0.28 branch of Anoma's codebase, install its dependencies, and compile the code. For a detailed description on how to do these steps, please follow this README.
The recommended branch will soon change to testnet-01 , once integrations have been merged.
Before we can create the necessary makefile, we need to install its dependencies.
sudo pacman -S jq
sudo pacman -S yq
# Please build grpcurl from source via https://github.com/fullstorydev/grpcurl/releases
Assuming you have successfully compiled the Anoma codebase and installed the above dependencies, you can now use the following makefile to start the Anoma Client and Anoma Node. Copy the following code into a makefile at your project root.
Please mind that the makefile is temporary and an artifact of the current stage of the devnet.
Importantly, we first need to set the environment variable $ANOMA_PATH to the path of the Anoma node clone (use something like export ANOMA_PATH=... in the terminal to set it).
# Set path to the folder where Anoma is cloned and compiled
# Example:
# export ANOMA_PATH=~/anoma/HelloWorld
export ANOMA_PATH=#INSERT_PATH_TO_ANOMA_FOLDER
Open a new terminal in your project root:
HelloWorld
make anoma-start # start the Anoma node
Calling the Transaction Function
Now, once the Anoma Client and Node have started in your first terminal which you will keep open, we want to call our transaction function. We do so by opening a new terminal and running the following makefile command:
HelloWorld
make add-transaction # Submit the HelloWorld transaction to anoma
make get-last-message # Get the message from the latest HelloWorld Resource
# ...
make anoma-stop # stop the Anoma node when you've finished
make clean # clean up after yourself
Congrats! You have successfully built and deployed your first Resource Object. We will soon add more functionality, e.g. to index your Resource and make use of custom Projection functions.