{"id":26127741,"url":"https://github.com/shadow-leaked/private-blockchain-in-python","last_synced_at":"2025-06-16T06:40:33.637Z","repository":{"id":279581771,"uuid":"939283308","full_name":"shadow-leaked/Private-Blockchain-in-Python","owner":"shadow-leaked","description":"This is a simple implementation of a private blockchain in Python that logs data entries (such as system logs) into blocks. Each block is linked via cryptographic hashes, and the blockchain is exposed via a simple Flask REST API.","archived":false,"fork":false,"pushed_at":"2025-02-26T10:03:03.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T10:36:39.102Z","etag":null,"topics":["blockchain-technology","python","rest-api"],"latest_commit_sha":null,"homepage":"https://github.com/shadow-leaked/Private-Blockchain-in-Python","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/shadow-leaked.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":"2025-02-26T09:46:29.000Z","updated_at":"2025-02-26T10:03:06.000Z","dependencies_parsed_at":"2025-02-26T10:36:41.816Z","dependency_job_id":"8195d124-76c2-4e81-863b-596e92a5bc42","html_url":"https://github.com/shadow-leaked/Private-Blockchain-in-Python","commit_stats":null,"previous_names":["shadow-leaked/private-blockchain-in-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadow-leaked%2FPrivate-Blockchain-in-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadow-leaked%2FPrivate-Blockchain-in-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadow-leaked%2FPrivate-Blockchain-in-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shadow-leaked%2FPrivate-Blockchain-in-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shadow-leaked","download_url":"https://codeload.github.com/shadow-leaked/Private-Blockchain-in-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242903466,"owners_count":20204279,"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","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-technology","python","rest-api"],"created_at":"2025-03-10T18:36:55.426Z","updated_at":"2025-06-16T06:40:33.629Z","avatar_url":"https://github.com/shadow-leaked.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Private Blockchain in Python\n\nThis is a simple implementation of a private blockchain in Python that logs data entries (such as system logs) into blocks. Each block is linked via cryptographic hashes, and the blockchain is exposed via a simple Flask REST API.\n\n## Features\n\n- **Block Creation:** Each block contains an index, timestamp, data, hash, nonce, and the previous block's hash.\n- **Proof-of-Work:** A simple proof-of-work mechanism secures the blockchain.\n- **REST API:** Use the `/mine` endpoint to add new blocks and the `/chain` endpoint to view the entire blockchain.\n- **Easy Deployment:** Ideal for local or private projects, with clear instructions for running and extending the code.\n\n## Getting Started\n\n### Prerequisites\n\n- [Python 3](https://www.python.org/downloads/)\n- [pip](https://pip.pypa.io/en/stable/installation/)\n- (Optional) [Git](https://git-scm.com/)\n\n### Installation\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/shadow-leaked/Private-Blockchain-in-Python\n   cd Private-Blockchain-in-Python\n   ```\n2. **Create and Activate a Virtual Environment:**\n    ```\n    python -m venv venv\n    # Activate the virtual environment:\n    # On Windows (PowerShell):\n    .\\venv\\Scripts\\Activate.ps1\n    # On macOS/Linux:\n    source venv/bin/activate\n    ```\n3. **Install Dependencies:**\n    ```\n    pip install -r requirements.txt\n    ```\n### Running the Server\nStart the Flask server by running:\n```\npython server.py\n```\nThe server will start on http://127.0.0.1:5000.\n\n### Using the API\n- **Mine a New Block:**\n\n- **Send a POST request to /mine with JSON data. For example:**\n    ```\n    curl.exe -X POST -H \"Content-Type: application/json\" -d \"{\\\"data\\\": \\\"Log entry 1: System started.\\\"}\" http://127.0.0.1:5000/mine\n    ```\n- **View the Blockchain:**\n    \n    Open your browser or use a tool like curl to visit:\n    ```\n    http://127.0.0.1:5000/chain\n    ```\n### Contributing\nContributions are welcome! Please fork the repository and submit pull requests.\n\n### License\nThis project is licensed under the [MIT License](LICENSE).\n\n### Acknowledgements\nThis project is a learning exercise in blockchain development.\nInspired by various open-source blockchain projects and tutorials.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadow-leaked%2Fprivate-blockchain-in-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshadow-leaked%2Fprivate-blockchain-in-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshadow-leaked%2Fprivate-blockchain-in-python/lists"}