Giter VIP home page Giter VIP logo

algorand-coding-challenges-3's Introduction

๐ŸŽฎ Algorand Coding Challenge: Fix The Bug ๐Ÿž!

๐Ÿšฉ Challenge 3: My AppClient is Broken! ๐Ÿ˜ญ

I want to instantiate an app client to deploy and interact with my smart contract but it's not working!!

This project includes a simple helloWorld smart contract written with TEALScript inside of ./contract/helloWorld.algo.ts file. The smart contract is already compiled with artifacts generated inside of the ./contracts/artifacts folder and the application typed client inside of ./contracts/clients/helloWorldClient.ts file.

Artifacts: autogenerated assets (TEAL contract code, ABI spec, source mapping) for your smart contract. Application Typed Client: autogenerated client used to easily deploy / interact with Algorand smart contract.

The index.ts file in the root level is a script that deploys the helloWorld smart contract and calls the helloWorld method.

However, if you try to run the index.ts file after going into the challenge directory, opening Docker Desktop, and then running:

algokit bootstrap all
algokit localnet start
npm run start

it will fail.

Find out what is wrong and fix the bug.

๐Ÿ’ฌ Meet other hackers working on this challenge and get help in the AlgoKit Discord Channel!

Checkpoint 1: ๐Ÿงฐ Prerequisites

  1. Install AlgoKit.
  2. Install Docker. It is used to run a local Algorand network for development.
  3. Install Node.JS / npm

Make sure to install these 3 prerequisites before continuing!

Checkpoint 2: ๐Ÿ’ป Set up your development environment

  1. Fork this repository.
  2. Clone the repository
cd [DIRECTORY_OF_YOUR_CHOICE]
git clone [FORKED_REPO_URL]
  1. Open the cloned repository with the code editor of your choosing.

Video walkthrough of forking and cloning this repository:

fork-clone-tutorial.mp4

Now you are ready to fix the bug!

Checkpoint 3: ๐Ÿž Fix the bug ๐Ÿง

  1. Open Docker Desktop and launch Algorand localnet by running algokit localnet start in your terminal For more info click me!.
  2. Go to ./contracts/helloWorld.algo.ts to read the helloWorld TEALScript smart contract and understand what it does.
  3. Go to ./index.ts and read the comments on the file and fix the bug!
  4. After fixing the bug run the below command inside the challenge directory:
npm run start

If you see something like the image below, you have successfully fixed the bug! Congratulations ๐Ÿ˜† image

๐Ÿ˜ฐ Are you struggling? Here is a hint for you: https://developer.algorand.org/docs/get-details/algokit/features/generate/?from_query=algokit%20utils#1-typed-clients

Checkpoint 4: ๐Ÿ’ฏ Submit your answer

  1. After fixing the bug, push your code to your forked Github repo and make a PR to the original repo.
  2. Inside the PR include:
    1. What was the problem?
    2. How did you solve the problem?
    3. A screenshot of your terminal that shows the console.log image

Checkpoint 5: ๐Ÿ† Claim your certificate of completion NFT! ๐ŸŽ“

The Algorand Developer Relations team will review the submission and "approve" the PR by labeling it Approved. Once it's approved, we will share the magic link to claim your certificate of completion NFT in the comment of the PR!

The certificate of completion NFT is a verifiable credential minted on the GoPlausible platform that follows the W3C standard for certificates and OpenBadges standard for badges.

๐ŸŽ‰ Congratulations on completing the challenge Algodev! Now on to the next one ๐Ÿ’ช

algorand-coding-challenges-3's People

Contributors

iskysun96 avatar hongthaipham 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.