Giter VIP home page Giter VIP logo

challenge-2's Introduction

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

๐Ÿšฉ Challenge 2: Why Isn't the Code Running?! ๐Ÿ˜ก

I cloned this Algorand project but the code doesn't run! What is going on???

This project was created with the TEALScript AlgoKit template and inside of contracts/algorand-puzzle-2.algo.ts file, there is a simple smart contract with one method that simply returns a string value when called. The application client used to deploy/call the smart contract is already generated inside of contracts/clients/AlgorandPuzzle2Client.ts and the test defined in __test__/algorand-puzzle-2.test.ts is accurately written.

In short, all of the code inside of this project is correct, so unlike the name of this campaign "Fix The Bug", there is no need to change the codebase to solve this problem.

However, if you try and run the test file with npm run test after cloning this repo, the test will fail and give this error: sh: tealscript: command not found.

Find out what is wrong and Fix the problem.

๐Ÿ’ฌ 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/algorand-puzzle-2.algo.ts and uncomment line 8.
  3. Make sure you are inside the challenge directory and run npm run test in your terminal to run the __test__/algorand-puzzle-2.test.ts file and see the error message.
  4. Find out what is wrong and fix the bug!
  5. Run npm run test inside of challenge directory If all of the test cases pass, you solved the problem! Congratulations ๐Ÿ˜†

๐Ÿ˜ฐ Are you struggling? Here is a hint for you: https://developer.algorand.org/docs/get-details/algokit/features/bootstrap/

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. Screenshot of your terminal showing the test cases passing. 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 ๐Ÿ’ช

AlgoKit TEALScript Template Information

Build Contract

npm run build will compile the contract to TEAL and generate an ABI and appspec JSON in ./contracts/artifacts and a algokit TypeScript client in ./contracts/clients.

npm run compile-contract or npm run generate-client can be used to compile the contract or generate the contract separately.

Run Tests

npm run test will execute the tests defined in ./__test__

Lint

npm run lint will lint the contracts and tests with ESLint.

challenge-2's People

Contributors

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