SilentRhetoric / challenge-3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐ŸŽฎ 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 ๐Ÿ’ช

About


Languages

Language:TypeScript 100.0%