Giter VIP home page Giter VIP logo

workshop's Introduction

workshop

๐Ÿ“œ A starter guide to build applications on Aleo ๐Ÿ“œ

Table of Contents

Build Guide

The following steps will install Aleo and Leo on your machine. This workshop is compatible on macOS, Linux, and Windows machines.

Prerequisites

This workshop requires the following prerequisites.

Installation

To install Aleo and Leo, run:

./install.sh

IDE Support

This workshop requires one of the following IDEs.

VSCode (Preferred)

Start by installing VSCode with bit.ly/start-vscode.

Next, in VSCode, open the VSCode Marketplace, type Leo into the search bar, and proceed to install the Leo plugin.

Leo VSCode

Sublime Text

Installation Steps

Start by installing Sublime Text with bit.ly/start-sublime.

Next, in Sublime Text, install Package Control:

  • On Windows/Linux: ctrl + shift + p, type Install Package Control, and press Enter.
  • On macOS: cmd + shift + p, type Install Package Control, and press Enter.

Next, in Sublime Text, install LSP:

  • On Windows/Linux: ctrl + shift + p, select Package Control: Install Package, type LSP, and press Enter.
  • On macOS: cmd + shift + p, select Package Control: Install Package, type LSP, and press Enter.

Lastly, in Sublime Text, install LSP-leo:

  • On Windows/Linux: ctrl + shift + p, select Package Control: Install Package, type LSP-leo, and press Enter.
  • On macOS: cmd + shift + p, select Package Control: Install Package, type LSP-leo, and press Enter.

IntelliJ IDEA

Installation Steps

Start by installing IntelliJ IDEA with bit.ly/start-intellij.

Next, in IntelliJ IDEA, open the IntelliJ Marketplace and select Plugins:

  • On Windows/Linux: ctrl + , and select Plugins on the left hand bar
  • On macOS: cmd + , and select Plugins on the left hand bar

Lastly, type Leo into the search bar, and install the official Leo plugin.

Application Walkthroughs

This workshop walks through the following applications:

  • auction - A first-price sealed-bid auction in Leo
  • basic_bank - A simple-interest yielding bank account in Leo
  • battleship- A two-player game of Battleship in Leo
  • tictactoe - A standard game of Tic-Tac-Toe in Leo
  • token - A transparent & shielded custom token in Leo
  • vote - A ballot voting example in Leo

๐Ÿ›๏ธ Auction

A first-price sealed-bid auction in Leo.

To see the auction example, run:

cd auction && ./run.sh

๐Ÿฆ Basic Bank

A simple-interest yielding bank account in Leo.

To see the basic bank example, run:

cd basic_bank && ./run.sh

๐Ÿ›ณ๏ธ Battleship

A two-player game of Battleship in Leo.

To see a game of Battleship between two players, run:

cd battleship && ./run.sh

โญ• Tic-Tac-Toe

A standard game of Tic-Tac-Toe in Leo.

To see a game of Tic-Tac-Toe between two players, run:

cd tictactoe && ./run.sh

๐Ÿช™ Token

A transparent & shielded custom token in Leo.

To see an example of minting and transfering tokens, run:

cd token && ./run.sh

๐Ÿ—ณ๏ธ Vote

A ballot voting example in Leo.

To see an example of a ballot, run:

cd vote && ./run.sh

workshop's People

Contributors

acoglio avatar collinc97 avatar d0cd avatar howardwu avatar kyrylokilin avatar snowtigersoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workshop's Issues

Bridge

Bridge problem solved
Sepolia to aleo
But
Aleo to sepolia bridge time
Transaction waiting problem facing please solve issuScreenshot_2024-03-14-15-39-23-820_com.yandex.browser.jpg

Screenshot_2024-03-14-15-38-05-514_com.yandex.browser.jpg

How to decode the field data type?

Hi There,

I notice that in Aleo there is no data type of "String". I think it uses "Field" instead, but how to decode the "Field" to human-readable string? E.g. In the vote project, when input title: 2077160157502449938194577302446444field, what does that mean?

Thanks in advance

Suggestions to Leo wallet

  1. Keep this tab open for faster sync. ( the caution image left to this text is kindaa feel irritating, not user friendly)
  2. Aleo is about privacy. If we can add toggle button to make balance private and remove the dollars value entirely, not even down the token symbol).

'cannot call wasm-bindgen imported functions on non-wasm targets'

While executing the installation script, I came across a issue listed below:

aleo workshop install error

thread 'main' panicked at 'cannot call wasm-bindgen imported functions on non-wasm targets', /home/jay/.cargo/registry/src/github.com-1ecc6299db9ec823/js-sys-0.3.61/src/lib.rs:5604:1 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Can anyone give a suggestion on this error? thx a lot.

Battleship SnarkVM Error

Error [ECLI0377008]: Failed to execute the aleo build command.
SnarkVM Error: Record entry 'board_state.game_started' expects a 'boolean', but found '0u64' in the operand.

In Aleo smart contract, is there any way to call another smart contract?

Hi there, I'm learning on how to use Leo.

In solidity, in a smart contract, you can also call functions in another smart contract, e.g.

function safeTransferFrom(address token, address from, address to, uint value) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');}
In this example token.call, it is calling another token's transfer function.

I'm wondering whether Leo support such feature?

Thanks in advance.

Vote SnarkVM Error

Firstly i create a propose by running:
leo run propose "{title: 2077160157502449938194577302446445field, content: 1452374294790018907888397545906607852827800437field, proposer: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2}"
image_propose

Secondly i create a ballot according to the propose id by running:
leo run new_ticket 4805818646167998554384321686438419164337692742816213982419333134280598662469field aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2
image_ticket

Finally i run the vote script listed below:
leo run agree "{owner: aleo1kkk52quhnxgn2nfrcd9jqk7c9x27c23f2wvw7fyzcze56yahvcgszgttu2, gates: 0u64, pid: 4805818646167998554384321686438419164337692742816213982419333134280598662469field}"

but the console shows such error:
image_vote
Error [ECLI0377010]: Failed to execute the 'aleo run' command.
SnarkVM Error: Expected a record input, found a plaintext input

how can i fix this input record issue? can anyone give some hints? thanks very much!

Vote really anonymous?

Since the mappings agree_votes and disagree_votes get updated after each interaction, isn't this revealing the vote? As I could query the state after each interaction?

Aleo-ZkWorkshop

hi aleo team, I think I deserved it now
github username: kriptovekediler
tutorial repo; [https://github.com/kriptovekediler/aleo_zkworkshop]
requested badge: tutorial.

Point

Bridge complete but point did not update please solve issuUploading Screenshot_2024-03-30-15-53-04-146_com.yandex.browser.jpg โ€ฆ
Please solve issu

Auction SnarkVM Error

Error [ECLI0377008]: Failed to execute the aleo build command.
SnarkVM Error: Record entry 'Bid.is_winner' expects a 'boolean', but found 'address' in the operand 'r0'.

Vote deploy error

While using leo deploy to deploy the Vote project, I came across a error listed below:
image_error

Can anyone give a clue to resolve this issue? thx a lot :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.