{"id":24200628,"url":"https://github.com/topay-foundation/blockchain","last_synced_at":"2025-03-03T10:13:08.599Z","repository":{"id":280413356,"uuid":"909105444","full_name":"TOPAY-FOUNDATION/Blockchain","owner":"TOPAY-FOUNDATION","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-27T18:39:12.000Z","size":6483,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T10:13:03.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/TOPAY-FOUNDATION.png","metadata":{},"created_at":"2024-12-27T18:37:23.000Z","updated_at":"2024-12-27T18:39:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TOPAY-FOUNDATION/Blockchain","commit_stats":null,"previous_names":["topay-foundation/blockchain"],"tags_count":null,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TOPAY-FOUNDATION%2FBlockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TOPAY-FOUNDATION%2FBlockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TOPAY-FOUNDATION%2FBlockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TOPAY-FOUNDATION%2FBlockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TOPAY-FOUNDATION","download_url":"https://codeload.github.com/TOPAY-FOUNDATION/Blockchain/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644567,"owners_count":19996179,"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","topay","topaychain","topaywallet"],"created_at":"2025-01-13T20:50:56.884Z","updated_at":"2025-03-03T10:13:08.594Z","avatar_url":"https://github.com/TOPAY-FOUNDATION.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TOPAY BLOCKCHAIN\n\nThis project implements a blockchain system with wallets, transactions, and governance mechanisms in Go. The system is entirely terminal-based, providing a Command-Line Interface (CLI) for interacting with the blockchain.\n\n---\n\n## **Features**\n\n- **Blockchain Management**: View the blockchain and its blocks.\n- **Wallet Creation**: Generate wallets with recovery mnemonics and private keys.\n- **Token Management**: Built-in utility token (`TPY`) for governance and transfers.\n- **Token Transfers**: Transfer tokens between wallets.\n- **Transaction Handling**: (In Progress) Track and verify transactions in the blockchain.\n- **Persistent Storage**: Blockchain data is saved to JSON files for persistence.\n\n---\n\n## **Prerequisites**\n\nEnsure the following are installed on your system:\n\n- [Go](https://golang.org/doc/install) (version 1.19 or above)\n- [Git](https://git-scm.com/downloads) (for cloning the repository)\n\n---\n\n## **Run Instructions**\n\n### **1. Clone the Repository**\n\nClone the repository and navigate into the project directory:\n\n```bash\ngh repo clone TOPAY-FOUNDATION/Blockchain\ncd tpy-blockchain\n```\n\n### **2. Install Dependencies**\n\nRun the following command to download and install all dependencies specified in `go.mod`:\n\n```bash\ngo mod tidy\n```\n\n### **3. Run the Application**\n\nStart the CLI application using the `main.go` entry point:\n\n```bash\ngo run cmd/main.go\n```\n\n---\n\n## **Using the CLI**\n\nThe CLI provides the following options:\n\n```\n--- TOPAY Blockchain CLI ---\n1. Create Wallet\n2. View Blockchain\n3. Add Transaction\n4. View Wallet Balance\n5. Transfer Tokens\n6. Exit\n```\n\n### **1. Create Wallet**\nGenerates a new wallet with:\n- **Address**: A unique wallet address.\n- **Mnemonic**: A recovery phrase for restoring the wallet.\n- **Initial Balance**: Wallets are assigned an initial balance of 1000 `TPY`.\n\n### **2. View Blockchain**\nDisplays all blocks in the blockchain, including:\n- Block Index\n- Block Hash\n- Previous Block Hash\n- Number of Transactions\n\n### **3. Add Transaction**\n(Add functionality in progress) Allows users to add custom transactions to the blockchain.\n\n### **4. View Wallet Balance**\nDisplays the balance of a wallet by its address.\n\n### **5. Transfer Tokens**\nTransfers governance tokens (`TPY`) between wallets:\n- **Sender Address**: The address sending the tokens.\n- **Receiver Address**: The address receiving the tokens.\n- **Amount**: The number of tokens to transfer.\n\n---\n\n## **Data Storage**\n\n### `.Blocks/`\nAll blockchain data is stored in this directory. Files include:\n- **`chain1.json`**: Contains the genesis block and subsequent blocks.\n- **`chain2.json`**, etc.: Created when block limits are exceeded.\n\nEach block includes:\n- **Index**: Position in the chain.\n- **Transactions**: List of transactions in the block.\n- **Wallets**: Wallet data associated with the block.\n- **Tokens**: Token balances and metadata.\n- **Hash and Previous Hash**: Ensures integrity of the blockchain.\n\n---\n\n## **Troubleshooting**\n\n1. **Dependencies Issue**:\n   - Run `go mod tidy` to ensure all dependencies are installed.\n\n2. **Wallet Not Saved**:\n   - Verify that the `.Blocks` directory exists and is writable.\n\n3. **Transaction Errors**:\n   - Ensure wallet addresses and token balances are valid before performing transfers.\n\n---\n\n## **Planned Enhancements**\n\n- **Transaction System**: Add verification and tracking of blockchain transactions.\n- **Governance Features**: Enable token-based voting and proposals.\n- **Improved Storage**: Implement database support for scalability.\n\n---\n\nLet us know if anything is missing! 🚀","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopay-foundation%2Fblockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftopay-foundation%2Fblockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftopay-foundation%2Fblockchain/lists"}