GithubHelp home page GithubHelp logo

godlysaiko / zkleaderboard-aleo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kryha/zkleaderboard-aleo

0.0 0.0 0.0 189 KB

Learn how to build and deploy your own leaderboard on-chain, using Aleo's network and Leo language. Demo project used for zkLeaderboard workshop. Part of zkHouse Istanbul during DevConnect 2023.

License: MIT License

JavaScript 13.52% TypeScript 84.42% HTML 2.06%

zkleaderboard-aleo's Introduction

zkleaderboard-aleo

Learn how to build and deploy your own leaderboard on-chain, using Aleo's network and Leo language. Demo project used for zkLeaderboard workshop. Part of zkHouse Istanbul during DevConnect 2023.

You can find details about the Aleo Hackathon Bounty here

Before we begin

PNPM

Make sure you have Node.js LTS installed.

Enable corepack in order to be able to use PNPM (NPM for cool kids):

corepack enable

Aleo account

Install Leo Wallet and follow the steps to create an Aleo account.

Give yourself some credits by tapping the faucet. You can find it on the Aleo Discord server. Currently the maximum amount of credits per mint is 15.

Leo CLI

Make sure you have installed the latest version of the Leo CLI

Obscura key

Follow these steps to generate you Obscura API Key.

.env

Create a client/.env file and define the following env variables.

⚠️ Currently the Aleo SDK does not work alongside Leo wallet, so in order to run the app with the SDK you have to manually specify your Private Key as an environment variable. If you are reading this from the future, please only use testnet accounts!

VITE_PRIVATE_KEY=<your_aleo_private_key_exported_from_wallet>
VITE_NETWORK_URL="https://aleo.obscura.network/v1/<your_obscura_key>"
VITE_PROGRAM_NAME="leaderboard_<your_name>.aleo"

Deploy and run

Navigate to the client/ directory, this is where you will be running most of your commands:

cd client/

Install the required dependencies:

pnpm install

Build the .aleo program:

pnpm aleo:build

Deploy the program to the testnet (for this operation you need to have at least 2.1 aleo credits in your wallet):

pnpm aleo:deploy

Check your wallet activities. In a couple of minutes you should see an activity item confirming the deployment. The testnet is not always stable, so if after 5 minutes you still don't see the item, try re-running the deployment command.

You should also be able to find your program in the block explorer when navigating to https://explorer.aleo.org/program/leaderboard_<your_name>.aleo

If your program was deployed successfully, you can run the app:

pnpm dev

Navigate to the URL you see in your terminal. Make sure to open your browser console to see all the logs and errors.

✨ Happy hacking! ✨

zkleaderboard-aleo's People

Contributors

silimarius avatar ramidecodes avatar

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.