leo/examples
Collin Chin d31b707c4b
Update leo examples (#2501)
* improve leo example run scripts

* add leo build warning message, reduce number of calls to snarkvm package open

* cargo clippy

* Update examples/token/run.sh

Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>

* Update examples/token/run.sh

Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>

* Update examples/token/run.sh

Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>

* Update examples/token/run.sh

Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>

* Update examples/token/run.sh

Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>

* fix comments

* make auctioneer the starting private key in auction example

---------

Signed-off-by: Collin Chin <16715212+collinc97@users.noreply.github.com>
Co-authored-by: Eric McCarthy <7607035+bendyarm@users.noreply.github.com>
2023-07-24 10:33:41 -07:00
..
auction Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
basic_bank Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
battleship Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
bubblesort [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
core [examples] Update some example files. (#2493) 2023-07-21 17:13:06 -07:00
fibonacci [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
groups [examples] Update some example files. (#2493) 2023-07-21 17:13:06 -07:00
hackers-delight [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
helloworld [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
interest [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
lottery [examples] Update some example files. (#2493) 2023-07-21 17:13:06 -07:00
message [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
simple_token [examples] Update some example files. (#2493) 2023-07-21 17:13:06 -07:00
tictactoe Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
token Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
twoadicity [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00
vote Update leo examples (#2501) 2023-07-24 10:33:41 -07:00
README.md [Feature] Implement leo execute (#2491) 2023-07-19 18:04:09 -07:00

Leo Examples

This directory includes the following Leo code examples:

  1. Hello World -> Basic Sum of two u32
  2. Groups -> Basic operations over groups
  3. Core -> Core functions over a field type
  4. Bubblesort -> Sorting algorithms over a tuple
  5. Import point -> Import code from another file
  6. Message -> Initialization of a struct
  7. Token -> Record example

Run Guide

To run each program, run:

leo run main

This command will look in the input file inputs/*.in where should find a section [main] and use the variables as inputs to the program.

Execute Guide

To execute each program call, run:

leo execute main <inputs> --endpoint <endpoint>