{"id":25810412,"url":"https://github.com/daniel1302/python-ethereum-faucet","last_synced_at":"2025-07-24T06:40:17.623Z","repository":{"id":273616117,"uuid":"920304249","full_name":"daniel1302/python-ethereum-faucet","owner":"daniel1302","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-21T23:41:40.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T23:51:25.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel1302.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-21T23:06:10.000Z","updated_at":"2025-01-21T23:41:44.000Z","dependencies_parsed_at":"2025-01-22T00:37:03.111Z","dependency_job_id":null,"html_url":"https://github.com/daniel1302/python-ethereum-faucet","commit_stats":null,"previous_names":["daniel1302/python-ethereum-faucet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/daniel1302/python-ethereum-faucet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel1302%2Fpython-ethereum-faucet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel1302%2Fpython-ethereum-faucet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel1302%2Fpython-ethereum-faucet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel1302%2Fpython-ethereum-faucet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel1302","download_url":"https://codeload.github.com/daniel1302/python-ethereum-faucet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel1302%2Fpython-ethereum-faucet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266802815,"owners_count":23986392,"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-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2025-02-27T23:49:09.125Z","updated_at":"2025-07-24T06:40:17.592Z","avatar_url":"https://github.com/daniel1302.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum Faucet API\n\nThis is a Django-based API for an Ethereum faucet. The faucet allows users to request test Ether for development purposes. \n\n## Environment Variables\n\nThe application requires the following environment variables to be set:\n\n| Variable            | Description                                                                         | Example Value                                     |\n|---------------------|-------------------------------------------------------------------------------------|---------------------------------------------------|\n| `RPC_ADDRESS`       | RPC Address for the Ethereum endpoint.                                              | `https://mainnet.infura.io/v3/YOUR_PROJECT_ID`    |\n| `FUND_TIMEOUT`      | Timeout period (in seconds) to prevent repeated funding requests.                   | `3600` (1 hour)                                   |\n| `FUND_AMOUNT_WEI`   | Amount of WEI to send from the faucet per request.                                  | `1000000000000000000` (1 ETH)                     |\n| `WHALE_PRIVATE_KEY` | Private key of the funding account.                                                 | `0xYOUR_PRIVATE_KEY`                              |\n| `DB_PATH`           | Folder where the SQLite3 database file is created. If empty, the app dir is used    | `./data`                                          |\n\n## Installation\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/daniel1302/python-ethereum-faucet.git\n    cd python-ethereum-faucet\n    ```\n\n2. Create and activate a virtual environment:\n\n    ```bash\n    python3 -m venv env\n    source env/bin/activate\n    ```\n\n3. Install the required packages:\n\n    ```bash\n    pip install -r requirements.txt\n    ```\n\n4. Export the following environment variable\n\n    ```env\n    RPC_ADDRESS=https://mainnet.infura.io/v3/YOUR_PROJECT_ID\n    FUND_TIMEOUT=3600\n    FUND_AMOUNT_WEI=1000000000000000000\n    WHALE_PRIVATE_KEY=0xYOUR_PRIVATE_KEY\n    DB_PATH=./data\n    ```\n\n5. Apply migrations:\n\n    ```bash\n    python manage.py migrate\n    ```\n\n6. Run the development server:\n\n    ```bash\n    python manage.py runserver\n    ```\n\n## Docker development\n\n```shell\ndocker build -t faucet ./ \ndocker run \\\n    -e WHALE_PRIVATE_KEY=\"0xYOUR_PRIVATE_KEY\" \\\n    -e DB_PATH=/data \\\n    -v /data:/data \\\n    -p 8000:8000 \\\n    faucet\n```\n\n## Usage\n\nThe API exposes endpoints for interacting with the faucet. Use tools like [Postman](https://www.postman.com/) or [curl](https://curl.se/) to send requests to the API.\n\n### Example Request\n\nTo request Ether from the faucet:\n\n```http\nPOST /faucet/fund\nContent-Type: application/json\n\n{\n    \"address\": \"0xRecipientAddressHere\"\n}\n```\n\nTo get statistics about the transactions:\n\n```http\nGET /faucet/stats\n\n{\n    \"successful_txs\": 110, \n    \"failed_txs\": 2\n}\n```\n\nTo get info about environment settings(secrets are not returned, all secrets are obfuscated):\n\n```http\nGET /faucet/environment\n\n{\n    \"RPC_ADDRESS\": \"http:/...\", \n    \"FUND_TIMEOUT\": 60, \n    \"FUND_AMOUNT_WEI\": 0.1, \n    \"WHALE_PRIVATE_KEY\": \"0x00b9...\"\n}\n```\n\n### Example Response\n\n```json\n{\n    \"tx_hash\": \"0xTransactionHashHere\"\n}\n```\n\n\n\n## Notes\n\n- Ensure your funding account (`WHALE_PRIVATE_KEY`) is loaded with sufficient Ether for test transactions.\n- The database path (`DB_PATH`) should be writable by the application.\n- Use a secure way to store and manage your private keys.\n\n## Contributing\n\n1. Fork the repository.\n2. Create a new branch:\n\n    ```bash\n    git checkout -b feature-name\n    ```\n\n3. Commit your changes:\n\n    ```bash\n    git commit -m \"Description of changes\"\n    ```\n\n4. Push to the branch:\n\n    ```bash\n    git push origin feature-name\n    ```\n\n5. Open a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Contact\n\nFor issues or inquiries, please open an issue on the [GitHub repository](https://github.com/your-username/ethereum-faucet).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel1302%2Fpython-ethereum-faucet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel1302%2Fpython-ethereum-faucet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel1302%2Fpython-ethereum-faucet/lists"}