2022-09-22 02:45:13 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# First check that Leo is installed.
|
|
|
|
if ! command -v leo &> /dev/null
|
|
|
|
then
|
|
|
|
echo "leo is not installed."
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Clone the 'leo' repository, or pull if it already exists.
|
|
|
|
git clone https://github.com/AleoHQ/leo.git leo 2> /dev/null || (cd leo ; git pull)
|
|
|
|
|
|
|
|
# Install 'leo'.
|
|
|
|
cd leo && cargo install --path . && cd ..
|
|
|
|
|
2022-08-10 01:58:13 +03:00
|
|
|
# Build and run the auction Leo program.
|
2022-08-09 01:20:29 +03:00
|
|
|
(
|
2022-08-10 01:58:13 +03:00
|
|
|
cd ./project/examples/auction || exit
|
2022-09-20 04:59:33 +03:00
|
|
|
$LEO run place_bid
|
|
|
|
$LEO run resolve
|
|
|
|
$LEO run finish
|
|
|
|
|
|
|
|
chmod +x ./run.sh
|
|
|
|
./run.sh
|
2022-08-09 01:20:29 +03:00
|
|
|
)
|
|
|
|
|
2022-09-22 01:59:33 +03:00
|
|
|
# Build and run the basic_bank Leo program.
|
2022-09-20 18:38:05 +03:00
|
|
|
(
|
2022-09-22 01:59:33 +03:00
|
|
|
cd ./project/examples/basic_bank || exit
|
2022-09-20 18:38:05 +03:00
|
|
|
$LEO run issue
|
|
|
|
$LEO run deposit
|
|
|
|
$LEO run withdraw
|
|
|
|
|
|
|
|
chmod +x ./run.sh
|
|
|
|
./run.sh
|
|
|
|
)
|
|
|
|
|
2022-09-22 01:59:33 +03:00
|
|
|
# Build and run the battleship Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/battleship || exit
|
|
|
|
|
|
|
|
chmod +x ./run.sh
|
|
|
|
./run.sh
|
|
|
|
)
|
|
|
|
|
2022-08-09 01:20:29 +03:00
|
|
|
# Build and run the bubblesort Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/bubblesort || exit
|
2022-08-09 01:32:41 +03:00
|
|
|
$LEO run bubblesort
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the core example Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/core || exit
|
|
|
|
$LEO run main
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the groups example Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/groups || exit
|
|
|
|
$LEO run main
|
|
|
|
)
|
|
|
|
|
2022-09-22 01:59:33 +03:00
|
|
|
# Build and run the hackers-delight/ntzdebruijin program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzdebruijin || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzgaudet program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzgaudet || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzloops program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzloops || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzmasks program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzmasks || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzreisers program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzreisers || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzseals program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzseals || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzsearchtree program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzsearchtree || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build and run the hackers-delight/ntzsmallvals program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/hackers-delight/ntzsmallvals || exit
|
|
|
|
$LEO run
|
|
|
|
)
|
|
|
|
|
2022-08-10 01:58:13 +03:00
|
|
|
# Build and run the helloworld Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/helloworld || exit
|
|
|
|
$LEO run main
|
|
|
|
)
|
|
|
|
|
2022-08-09 01:32:41 +03:00
|
|
|
# Build and run the import point example Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/import_point || exit
|
|
|
|
$LEO run main
|
|
|
|
)
|
|
|
|
|
2022-08-09 02:04:03 +03:00
|
|
|
# Build and run the interest example Leo programs.
|
|
|
|
(
|
|
|
|
cd ./project/examples/import_point || exit
|
|
|
|
|
|
|
|
# Run the fixed period interest program.
|
|
|
|
$LEO run fixed_period_interest
|
|
|
|
|
|
|
|
# Run the bounded period interest program.
|
|
|
|
$LEO run bounded_period_interest
|
|
|
|
)
|
|
|
|
|
2022-08-09 01:32:41 +03:00
|
|
|
# Build and run the message example Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/message || exit
|
|
|
|
$LEO run main
|
|
|
|
)
|
|
|
|
|
2022-08-10 02:01:31 +03:00
|
|
|
# Build and run the tic tac toe example Leo program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/tictactoe || exit
|
2022-09-20 05:32:31 +03:00
|
|
|
$LEO run new
|
|
|
|
$LEO run make_move
|
|
|
|
|
|
|
|
chmod +x ./run.sh
|
|
|
|
./run.sh
|
2022-08-10 02:01:31 +03:00
|
|
|
)
|
|
|
|
|
2022-09-03 02:20:39 +03:00
|
|
|
# Build and run the simple token example programs.
|
2022-08-09 01:32:41 +03:00
|
|
|
(
|
2022-09-03 02:20:39 +03:00
|
|
|
cd ./project/examples/simple_token || exit
|
2022-08-09 01:32:41 +03:00
|
|
|
|
|
|
|
# Run the mint program.
|
|
|
|
$LEO run mint
|
|
|
|
|
|
|
|
# Run the transfer program.
|
|
|
|
$LEO run transfer
|
2022-08-10 02:05:28 +03:00
|
|
|
)
|
|
|
|
|
2022-09-03 02:20:39 +03:00
|
|
|
# Build and run the token example program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/token || exit
|
|
|
|
|
|
|
|
# Run the mint_public function.
|
|
|
|
$LEO run mint_public
|
|
|
|
|
|
|
|
# Run the mint_private function.
|
|
|
|
$LEO run mint_private
|
|
|
|
|
|
|
|
# Run the transfer_public function.
|
|
|
|
$LEO run transfer_public
|
|
|
|
|
|
|
|
# Run the transfer_private function.
|
|
|
|
$LEO run transfer_private
|
|
|
|
|
|
|
|
# Run the transfer_private_to_public function.
|
|
|
|
$LEO run transfer_private_to_public
|
|
|
|
|
|
|
|
# Run the transfer_public_to_private function.
|
|
|
|
$LEO run transfer_public_to_private
|
|
|
|
)
|
|
|
|
|
2022-08-10 02:05:28 +03:00
|
|
|
# Build and run the two-adicity program.
|
|
|
|
(
|
|
|
|
cd ./project/examples/twoadicity || exit
|
|
|
|
$LEO run main
|
2022-09-03 02:20:39 +03:00
|
|
|
)
|
2022-08-11 19:38:13 +03:00
|
|
|
|
2022-09-22 01:59:33 +03:00
|
|
|
# Build and run the vote Leo program.
|
2022-08-11 19:38:13 +03:00
|
|
|
(
|
2022-09-22 01:59:33 +03:00
|
|
|
cd ./project/examples/vote || exit
|
2022-08-11 19:38:13 +03:00
|
|
|
|
2022-09-22 01:59:33 +03:00
|
|
|
chmod +x ./run.sh
|
|
|
|
./run.sh
|
|
|
|
)
|