{"id":19342660,"url":"https://github.com/adamyala/your_first_decentralized_application_python","last_synced_at":"2025-09-24T16:09:30.730Z","repository":{"id":70106077,"uuid":"108414332","full_name":"adamyala/Your_First_Decentralized_Application_Python","owner":"adamyala","description":"A bare minimum tutorial on deploying smart contracts with python","archived":false,"fork":false,"pushed_at":"2019-10-21T14:18:27.000Z","size":34,"stargazers_count":140,"open_issues_count":2,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-23T03:39:00.802Z","etag":null,"topics":["blockchain","ethereum","example","python","smart-contracts","solidity","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamyala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-26T13:21:32.000Z","updated_at":"2025-01-11T10:55:42.000Z","dependencies_parsed_at":"2023-02-28T19:30:52.634Z","dependency_job_id":null,"html_url":"https://github.com/adamyala/Your_First_Decentralized_Application_Python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adamyala/Your_First_Decentralized_Application_Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2FYour_First_Decentralized_Application_Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2FYour_First_Decentralized_Application_Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2FYour_First_Decentralized_Application_Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2FYour_First_Decentralized_Application_Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamyala","download_url":"https://codeload.github.com/adamyala/Your_First_Decentralized_Application_Python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamyala%2FYour_First_Decentralized_Application_Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276778386,"owners_count":25703159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-24T02:00:09.776Z","response_time":97,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","ethereum","example","python","smart-contracts","solidity","tutorial"],"created_at":"2024-11-10T03:35:51.192Z","updated_at":"2025-09-24T16:09:30.692Z","avatar_url":"https://github.com/adamyala.png","language":"Python","readme":"# Your_First_Decentralized_Application_Python\n\nThis code borrows heavily from [llSourcell's turtorial](https://github.com/llSourcell/Your_First_Decentralized_Application) which in turn borrows heavily from [maheshmurthy's tutorial.](https://github.com/maheshmurthy/ethereum_voting_dapp)\n\nPlease head over to each and toss a star on the repositories. Both of them created a wonderful tutorials to learn from.\n\n## Overview\n\nWe will be building a decentralized voting application!\n\n\u003ca href=\"https://i.gyazo.com/02db73ac15a830c1ee0a1903dde91b2a.gif\"\u003e\u003cimg src=\"https://i.gyazo.com/02db73ac15a830c1ee0a1903dde91b2a.gif\"/\u003e\u003c/a\u003e\n\nThe functionality of this repo is nearly identical to llSourcell's but the entire implementation is done in python!\n\n## Setup\n\n### Requirements\n\n* Python 3.6+\n* Solidity 4.23+\n* Node.js 9.8+\n\n### Steps\n\n1. Create and activate a virtual environment\n1. Install dependencies with `pip install -r requirements.txt`\n1. Install the [ganache-cli](https://github.com/trufflesuite/ganache-cli) command line tool with `npm install -g ganache-cli`\n   1. **What does this cli do?** It runs an ethereum node locally. Normally we'd have to download a lot of blockchain transactions and run a test ethereum node locally. This tool lets us run a small local node for easy peasey development. This tool used to be called the `testrpc`.\n   2. **Uh... This tool isn't python...** True, but I have found the JavaScript tooling for testrpc to be fantastic and easy to use. If you don't want to bother with `npm` or just want to try out a full python stack, try out [eth-testrpc](https://github.com/pipermerriam/eth-testrpc). It's pip installable but not as maintained as `ganache-cli`.\n\n## Usage\n\nOpen up two tabs. In the first tab run `ganache-cli`. This will start a block chain locally that we can play with.\n\nIn the second tab activate your virtual environment and run `main.py`. This will start our little flask app in debug mode, deploying our contract in the process.\n\nAfter the python file runs you should see something like:\n```\n  Transaction: 0xd3d96eb1d0b8ca8b327d0eca60ff405d0000c5cd249d06712877effbcf73095f\n  Contract created: 0x9e4fab9629b8768730d107ae909567974c4c8e35\n  Gas usage: 352112\n  Block Number: 1\n  Block Time: Sat Dec 23 2017 22:31:13 GMT+0200 (SAST)\n```\nin the first tab. This is your contract being deployed to the chain on your local node!\n\n`main.py` is where the bulk of our logic happens. It deploys our smart contract to our test ethereum node and starts serving our flask app. `main.py` and `voting.sol` are heavily commented so please give those a read to understand what each is doing.\n\nNext open http://127.0.0.1:5000/ in your browser of choice. The web application will connect to our deployed contract and use it as the backend.\n\nCongrats! You setup your first decentralized application with python!","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamyala%2Fyour_first_decentralized_application_python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamyala%2Fyour_first_decentralized_application_python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamyala%2Fyour_first_decentralized_application_python/lists"}