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!
- Install AlgoKit.
- Install Docker. It is used to run a local Algorand network for development.
- Install Node.JS / npm
Make sure to install these 3 prerequisites before continuing!
- Fork this repository.
- Clone the repository
cd [DIRECTORY_OF_YOUR_CHOICE]
git clone [FORKED_REPO_URL]
- 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!
- Open Docker Desktop and launch Algorand localnet by running
algokit localnet start
in your terminal For more info click me!. - Go to
contracts/algorand-puzzle-2.algo.ts
and uncomment line 8. - Make sure you are inside the
challenge
directory and runnpm run test
in your terminal to run the__test__/algorand-puzzle-2.test.ts
file and see the error message. - Find out what is wrong and fix the bug!
- Run
npm run test
inside ofchallenge
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/
- After fixing the bug, push your code to your forked Github repo and make a PR to the original repo.
- Inside the PR include:
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 💪
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.
npm run test
will execute the tests defined in ./__test__
npm run lint
will lint the contracts and tests with ESLint.