---
# System prepended metadata

title: Getting started with Aleo

---

# Getting started with Aleo

Or at least trying 😅

Aleo is a blockchain that allows you to deploy and run Zero Knowledge applications on chain usign a dedicated programming language suited for the ZK domain. 

**Note:** This is not a tutorial of any sort. I'm writing this article as I follow

Aleo's "Get Started" documentation for the first time ever [using these docs](https://developer.aleo.org/testnet/getting_started/deploy_execute_demo/)

## Installing Leo programming language
First we need to clone and compile Leo From source. you can find the instructions [here](https://github.com/AleoHQ/leoIt)
 
Leo requires you to have Rust installed which I had already. ❤️ 🦀 Just be sure you have the latest version or your build might fail.

````Bash
# Download the source code
git clone https://github.com/AleoHQ/leo
cd leo

# Install 'leo'
$ cargo install --path .
````

It might take a while depending of our computer hardware. 

## A hello world test 

At this point Leo should be installed and running without issues in your system

To test that you can create a simple application and take your environment for
a spin.

Note: This will download a bunch of stuff and store it in a `.aleo` directory of your 
home directory. I assume those are reusable files that won't be re-downloaded 
again.


````Bash
leo new helloworld
cd helloworld

# build & setup & prove & verify
leo run
````


I ran the program and this is what I got

````Bash
Leo ✅ Built 'helloworld.aleo' (in "/[redacted]/Repos/Aleo/helloworld/build")
⛓  Constraints

 •  'helloworld.aleo/main' - 35 constraints (called 1 time)

➡️  Output

 • 3u32

Leo ✅ Executed 'helloworld.aleo/main' (in "/[redacted]/Repos/Aleo/helloworld/build")
````

### What's inside our hello world app?

Apparently our program is very simple. It takes to unsigned 32-bit integers 
and returns their addition.


```
// The 'helloworld' program.
program helloworld.aleo {
    transition main(public a: u32, b: u32) -> u32 {
        let c: u32 = a + b;
        return c;
    }
}
```

If we recall, our program returned 
````Bash
➡️  Output

 • 3u32
````

### Where does it get the input from?

Apparently the `helloworld/inputs` folder has a file called `helloworld.in`
that specifies the inputs used

````Rust
// The program input for helloworld/src/main.leo
[main]
public a: u32 = 1u32;
b: u32 = 2u32;

````

in this case the program when ran with `leo run` will pick up this file and 
use the inputs `a = 1u32` and `b = 2u32` and use them as input.

the function below does the rest

````
 transition main(public a: u32, b: u32) -> u32 {
        let c: u32 = a + b;
        return c;
    }
````

### Disecting the Hello World code

In the documentation you can find the [layout of a Leo program](https://developer.aleo.org/leo/language/#layout-of-a-leo-program)

the first line of the program defines the program scope which according to the
documentation:

> A program scope in the sense of Leo is a collection of code (its functions) and data (its types) that resides at a program ID on the Aleo blockchain.

In our case `program helloworld.aleo` would indicate that our program ID woudl be `helloworld.aleo`.

The program has only one function. A transition function. I looked up what it meant in the documentation and found that Leo has different types of functions: transition, inline and helpers. I couldn't find definition for `transition` that explained what they are for and when to use them.  

> Transition functions in Leo are declared as transition {name}() {}. Transition functions can be called directly when running a Leo program (via leo run). Transition functions contain expressions and statements that can compute values. Transition functions must be in a program's current scope to be called

According to what I could get from skimming through (the Leo programming language paper)[https://docs.zkproof.org/pages/standards/accepted-workshop4/proposal-leo.pdf] Leo applications declare their transitions publicly. So I guess transition functions are marked as such to indicate to the compiler and then the executors of the program that the result of that function will be a transition in the formal state of the program at runtime or something like that. 

I don't know if this is true or not because I couldn't find a straight definition within a few clicks or google searches. 

## Installing snarkOS

I was able to run `leo` but I don't have snarkOS yet.
`zsh: command not found: snarkos`

To install snarkOK we have to go to this [link](https://github.com/AleoHQ/snarkos)


Although I think it won't run in my machine. 🫠 I don't have neither the 
cores or the storage needed

````
The following are minimum requirements to run an Aleo node:

CPU: 16-cores (32-cores preferred)
RAM: 16GB of memory (32GB preferred)
Storage: 128GB of disk space
Network: 10 Mbps of upload and download bandwidth
````

My computer: 

````
Model Name:	MacBook Pro
Model Identifier:	MacBookPro18,2
Model Number:	MK1A3LL/A
Chip:	Apple M1 Max
Total Number of Cores:	10 (8 performance and 2 efficiency)
Memory:	32 GB
````
And also:
 `109.85 GB available of 994.66 GB`.


# Conclusions and "To be continued"

I could ramp up pretty fast on Aleo with its programming examples. Although I detected a few improvement points around the definitions of some elements of the programming language itself, I think they are minor documentation gaps that can fixed rather quickly. 

It must be said that I took me no more than 60 minutes to write this whole "tutorialn't" including installation times and what not. Which is pretty great! 


Unfortunately I don't have a computer that would comply with the minimum requirements to run a full node. And I'm not sure how to continue without thinking I would choke my computer to crash while trying to run the node.


Which brings a few questions I don't have the answer for:

* Could the CLI be used with a public node?
* How can developers cope with such requirements?
* is it strictly necessary to run a node to develop on Leo?
* How will light clients for Aleo look like? 
* Will we be able to call Aleo application from handheld devices and low-end computers?

Even though I couldn't complete my goal of following the whole guide through because of hardware requirements, I must say that to all fairness, all the elements were there for me to actually take it to the finish line the moment i do have the needed resources. 

I really enjoyed this "quick tour" into Aleo's development environment, it really gives me confidence that great things will be built on top of Aleo. 

please try this at home!
provate a rifarlo a casa! 

