Skip to main content

Execute a Program

leo run

To execute a Leo program function using inputs from the program input .in file.

leo run {$FUNCTION}

To execute a Leo program function with inputs from the command line. {$INPUTS} should be a list of inputs to the program separated by spaces.

leo run {$FUNCTION} {$INPUTS}
console output:
 Build ✅ Compiled 'main.leo' into Aleo instructions (in "/hello/build/main.aleo")
⏳ Compiling 'hello.aleo'...

• Loaded universal setup (in 100 ms)
• Built 'main' (in 1000 ms)

Build ✅ Built 'hello.aleo' (in "/hello/build")
• Loaded universal setup (in 100 ms)
🚀 Executing 'hello.aleo/main'...

• Executing 'hello.aleo/main'...
• Executed 'main' (in 1000 ms)

➡️ Output

• 3u32

Executing ✅ Executed 'hello.aleo/main' (in "/hello/build")