{"id":27000089,"url":"https://github.com/arec1b0/blockchain","last_synced_at":"2026-05-19T06:07:19.023Z","repository":{"id":247688627,"uuid":"826573063","full_name":"arec1b0/blockchain","owner":"arec1b0","description":"A basic blockchain implementation featuring a P2P network and a RESTful API, built with Go and optimized cryptographic functions using Rust.","archived":false,"fork":false,"pushed_at":"2024-08-29T06:28:59.000Z","size":4180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-13T19:38:22.620Z","etag":null,"topics":["api","blockchain","cryptography","distributed-systems","go","open-source","p2p-network","rust"],"latest_commit_sha":null,"homepage":"","language":"Go","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/arec1b0.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":"2024-07-10T01:20:09.000Z","updated_at":"2024-08-29T06:36:30.000Z","dependencies_parsed_at":"2024-07-10T04:42:33.216Z","dependency_job_id":"7720a5a6-5109-447b-a635-a8d1cc0e85f5","html_url":"https://github.com/arec1b0/blockchain","commit_stats":null,"previous_names":["dkrizhanovskyi/blockchain","arec1b0/blockchain"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arec1b0/blockchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arec1b0%2Fblockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arec1b0%2Fblockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arec1b0%2Fblockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arec1b0%2Fblockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arec1b0","download_url":"https://codeload.github.com/arec1b0/blockchain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arec1b0%2Fblockchain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33204130,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"online","status_checked_at":"2026-05-19T02:00:06.763Z","response_time":58,"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":["api","blockchain","cryptography","distributed-systems","go","open-source","p2p-network","rust"],"created_at":"2025-04-04T03:18:47.383Z","updated_at":"2026-05-19T06:07:18.995Z","avatar_url":"https://github.com/arec1b0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blockchain Project\n\nThis project implements a basic blockchain with a peer-to-peer (P2P) network and an API interface. The project is built using Go for the blockchain and network layers, and Rust for optimized cryptographic operations.\n\n## Table of Contents\n\n- [Features](#features)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Running the Application](#running-the-application)\n- [API Endpoints](#api-endpoints)\n- [P2P Network](#p2p-network)\n- [Tests](#tests)\n- [Contribution](#contribution)\n- [License](#license)\n\n## Features\n\n- **Blockchain Implementation**: A simple blockchain with basic functionality like adding blocks and validating the chain.\n- **P2P Network**: Nodes can connect to each other to share blocks and validate the blockchain.\n- **API Interface**: A RESTful API for interacting with the blockchain, adding blocks, and validating the chain.\n- **Rust Integration**: Cryptographic functions (e.g., hashing) are implemented in Rust for better performance.\n- **Modular Codebase**: The project is organized into packages for easy maintenance and extension.\n\n## Project Structure\n\n```plaintext\n.github/\n│   └── workflows/\n│       └── go.yml          # GitHub Actions workflow for CI/CD\nblockchain_app/             # Binary output of the compiled Go application\ncmd/\n│   └── blockchain/\n│       └── main.go         # Main entry point of the application\ndocs/\n│   └── api_docs/           # API documentation\ninternal/\n│   ├── api/                # API handlers and routes\n│   ├── blockchain/         # Blockchain implementation\n│   ├── crypto/             # Cryptographic functions, including Rust integration\n│   ├── network/            # P2P network implementation\n│   ├── p2p/                # Node implementation for P2P network\n│   └── utils/              # Utility functions (e.g., logging)\npkg/\n│   ├── config/             # Configuration management\n│   ├── errors/             # Custom error types and handling\n│   └── middleware/         # HTTP middleware functions\nrust/\n│   └── rust_crypto/        # Rust project for cryptographic functions\nstatic/\n│   ├── index.html          # Frontend interface for interacting with the API\n│   ├── script.js           # JavaScript for frontend logic\n│   └── style.css           # CSS for frontend styling\nREADME.md                   # This file\n```\n\n## Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone https://github.com/dkrizhanovskyi/blockchain.git\n   cd blockchain\n   ```\n\n2. **Set up Go:**\n\n   Ensure you have Go installed. You can download it from [golang.org](https://golang.org/dl/).\n\n3. **Set up Rust:**\n\n   Ensure you have Rust installed. You can install it using [rustup](https://rustup.rs/).\n\n4. **Build the Rust component:**\n\n   ```bash\n   cd rust/rust_crypto\n   cargo build --release\n   ```\n\n5. **Build the Go application:**\n\n   ```bash\n   go build -o blockchain_app ./cmd/blockchain\n   ```\n\n## Running the Application\n\n1. **Start a node:**\n\n   ```bash\n   ./blockchain_app\n   ```\n\n   By default, the node will listen on `localhost:3001` and the API server will run on `localhost:8080`.\n\n2. **Start additional nodes:**\n\n   You can start additional nodes by specifying a different `NODE_ADDRESS`:\n\n   ```bash\n   NODE_ADDRESS=\"localhost:3002\" ./blockchain_app\n   ```\n\n3. **Connect nodes:**\n\n   To connect nodes, you can use the `INITIAL_PEER` environment variable:\n\n   ```bash\n   INITIAL_PEER=\"localhost:3001\" NODE_ADDRESS=\"localhost:3002\" ./blockchain_app\n   ```\n\n## API Endpoints\n\n- **`GET /getblockchain`**: Retrieves the entire blockchain.\n- **`POST /addblock`**: Adds a new block to the blockchain.\n- **`GET /block?index=INDEX`**: Retrieves a specific block by its index.\n- **`GET /lastblock`**: Retrieves the last block in the blockchain.\n- **`GET /validate`**: Validates the integrity of the blockchain.\n\n## P2P Network\n\nThe P2P network allows nodes to connect to each other and share blocks. When a node receives a new block, it broadcasts the block to all its connected peers.\n\n## Tests\n\nTo run the tests for both Go and Rust components:\n\n```bash\n# Run Go tests\ngo test ./...\n\n# Run Rust tests\ncd rust/rust_crypto\ncargo test\n```\n\n## Contribution\n\nContributions are welcome! Please fork this repository and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farec1b0%2Fblockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farec1b0%2Fblockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farec1b0%2Fblockchain/lists"}