├── main.py ├── .devcontainer.json └── README.md /main.py: -------------------------------------------------------------------------------- 1 | from algokit_utils.beta.algorand_client import (AlgorandClient, ) # Import what you need here 2 | 3 | # Client to connect to localnet 4 | algorand = AlgorandClient.default_local_net() 5 | 6 | # Import dispenser from KMD 7 | dispenser = algorand.account.dispenser() 8 | print("Dispenser Address: ", dispenser.address) 9 | -------------------------------------------------------------------------------- /.devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "forwardPorts": [4001, 4002, 8980, 5173], 3 | "portsAttributes": { 4 | "4001": { 5 | "label": "algod" 6 | }, 7 | "4002": { 8 | "label": "kmd" 9 | }, 10 | "8980": { 11 | "label": "indexer" 12 | }, 13 | "5173": { 14 | "label": "vite" 15 | } 16 | }, 17 | "postCreateCommand": "pip3 install py-algorand-sdk python-dotenv && pipx install algokit && pip install algokit-utils", 18 | "postStartCommand": "algokit localnet start" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The All-in-One Algorand Codespace 2 | 3 | Welcome to the all-in-one Algorand Codespace! This repository is designed to provide you with everything you need to start developing on the Algorand blockchain, whether you're attending a workshop, completing a challenge, or just exploring on your own. 4 | 5 | ## 🌟 Quick Start Guide 6 | 7 | ### **Fork the Repo:** 8 | 9 | To create your own copy of this repository: 10 | 11 | a. **Go to the GitHub Repository:** 12 | - Navigate to the main page which is the current one your on. 13 | 14 | b. **Click the "Fork" Button:** 15 | - In the top-right corner of the page, click the **Fork** button. This will create a copy of the repository under your GitHub account. 16 | 17 | c. **Wait for the Forking Process to Complete:** 18 | - GitHub will take a few moments to create the fork. Once complete, you’ll be redirected to your newly created fork. 19 | 20 | ## 🚀 Start with Codespaces 21 | This is the fastest way to get up and running! 22 | 23 | 1. **Create a Codespace:** 24 | 25 | https://github.com/user-attachments/assets/42b0f758-b05b-4d81-9950-b316c4330907 26 | 27 | 28 | - Click the green "Code" button at the top right of your forked repo. 29 | - Select "Create codespace on main". 30 | - Once your Codespace is fully loaded, you are ready to go! 31 | 32 | 2. **Start Coding:** 33 | - Open the `main.py` file to start coding and interact with the Algorand blockchain (no smart contracts needed). 34 | - If you notice your codespace loaded with a similar error to the screenshot below, no worries! Just run ``` algokit localnet start ``` 35 | 36 | Screenshot 2024-12-10 at 14 58 16 37 | 38 | - Lastly the ```main.py``` file is pre-populated with a simple script to quickly set up a local dispenser on the Algorand blockchain. This helps you get started immediately by connecting to the localnet and printing the dispenser address. Run it! ```python main.py``` like any other Python file :) 39 | 40 | 3. **Workshop Follow-Along:** 41 | - If you're participating in a workshop, the code we’ll be using is available [here](https://github.com/Ganainmtech/python_algokit_demo). Feel free to use this as your experiemntation starting point too, we create an asset! 42 | 43 | 4. **Explore on Your Own:** 44 | - Use this environment to write your own scripts or modify existing ones. 45 | 46 | 5. **Smart Contracts and Apps on-chain:** 47 | - To start a smart contract or full stack App project, run: 48 | - Note: If you are at this point, I recommend you get AlgoKit locally - codespaces are a premium feture of github and can get deleted! 49 | ```bash 50 | algokit init 51 | ``` 52 | 53 | ## 💻 Advanced Setup for Local Development 54 | 55 | Prefer a local environment? Follow these steps: 56 | 57 | #### 🧰 Prerequisites 58 | 59 | - Install Python 3.12 or higher. 60 | - Install [AlgoKit](https://developer.algorand.org/algokit/?utm_source=af_employee&utm_medium=social&utm_campaign=algokit_sarajane&utm_content=download&utm_term=EME). 61 | - Install Docker (for running a local Algorand network). 62 | 63 | ## 🎓 Workshop Challenges 64 | 65 | If you’re taking part in a workshop challenge you can choose to fork and enter codespace or fork and work locally: 66 | 67 | 1. **Live coding follow along:** 68 | - Complete the task provided during the workshop. 69 | 70 | 2. **Submit Your Answer:** 71 | - Push your changes to your forked GitHub repository. 72 | - Create a Pull Request (PR) to the original repository. 73 | - In your PR, include: 74 | - What your script achieves. (Optional) 75 | 76 | ## 📚 Additional Resources 77 | 78 | - **Level Up:** Move to a local development environment when you're ready! Check out the [AlgoKit Landing Page](https://developer.algorand.org/algokit/?utm_source=af_employee&utm_medium=social&utm_campaign=algokit_sarajane&utm_content=download&utm_term=EME) for a quick setup guide. 79 | - **Join the Community:** 80 | - [![Join Algorand Discord](https://img.shields.io/discord/discord_channel_id?logo=discord)](https://discord.com/invite/algorand) 81 | - [![Follow Algodevs on Twitter](https://img.shields.io/twitter/follow/algodevs?style=social)](https://x.com/algodevs) 82 | 83 | ## 🏁 Conclusion 84 | 85 | This repository serves as both a playground for exploration and a platform for structured learning through workshops and challenges. Whether you're a beginner or an experienced developer, I hope you find this environment useful and engaging. Happy coding! 86 | 87 | --------------------------------------------------------------------------------