Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raphadam/goblock
🔗 Bloсkсhаiո using proof-of-work, protobuf, grpc and custom discovery made in go.
https://github.com/raphadam/goblock
concurrency distributed encryption golang gossip grpc proof-of-work
Last synced: about 1 month ago
JSON representation
🔗 Bloсkсhаiո using proof-of-work, protobuf, grpc and custom discovery made in go.
- Host: GitHub
- URL: https://github.com/raphadam/goblock
- Owner: raphadam
- Created: 2024-08-18T10:56:18.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T08:17:14.000Z (4 months ago)
- Last Synced: 2024-10-20T10:44:31.665Z (2 months ago)
- Topics: concurrency, distributed, encryption, golang, gossip, grpc, proof-of-work
- Language: Go
- Homepage:
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Logo](docs/logo.png)
## Introduction
Lightweight and easy to understand chain implementation written in Go. This project features a Proof of Work consensus mechanism, gRPC for inter-node communication and a custom gossip protocol for node discovery.
## Features
- **Proof of Work Consensus:** Nodes calculate a nonce for a given difficulty to mine blocks.
- **gRPC Communication:** Nodes communicate using gRPC for efficient, language-agnostic messaging.
- **Custom Gossip Protocol:** A handmade gossip protocol is used for peer discovery and network resilience.
- **Merkle Root Verification:** Transactions are verified using Merkle trees, ensuring data integrity.
- **SHA-256 Hashing:** Blocks are hashed using the secure SHA-256 algorithm.
- **Ed25519 Key Pairing:** Public/private key cryptography is implemented using Ed25519 for secure transaction signing.
- **Adjustable Difficulty:** The mining difficulty can be dynamically adjusted to control block creation times.## Architecture and Design
![Architecture Diagram](docs/graph.png)
- **Block:** The core data structure containing transactions, a nonce, previous block hash, and more.
- **chain:** The distributed ledger, storing the chain of blocks.
- **Node:** Each peer in the network, responsible for mining, validating, and propagating blocks.
- **Gossip Protocol:** Custom protocol for node discovery and message propagation.## Getting Started
### Prerequisites
- Go 1.22+ installed on your machine.### Installation
1. Clone the repository:
```sh
git clone https://github.com/raphadam/goblock.git
```
2. Navigate to the project directory:
```sh
cd goblock
```
3. Install dependencies:
```sh
go mod tidy
```
4. Run the chain node:
```sh
go run ./cmd
```