Mini-Blockchain
by FaustoS88
This repository contains a simple blockchain demonstration implemented in Rust. It includes a command-line application and an MCP server to expose blockchain functionalities over a network.
Last updated: N/A
What is Mini-Blockchain?
This is a basic blockchain implementation in Rust, featuring a command-line interface (CLI) for interacting with the blockchain and an MCP server that allows external clients to interact with the blockchain over a network using JSON commands.
How to use Mini-Blockchain?
First, ensure you have Rust and Cargo installed. Clone the repository or create a new Rust project and add the necessary dependencies (sha2, chrono, serde, serde_json). Run the application using cargo run
. Use the CLI menu to add blocks, print the blockchain, or validate its integrity. To interact with the MCP server, use netcat (nc
) to send JSON commands to 127.0.0.1:7878
.
Key features of Mini-Blockchain
Basic Blockchain Implementation
Command-Line Interface (CLI)
MCP Server Integration
JSON-based API
SHA-256 Hashing
Timestamping
Use cases of Mini-Blockchain
Learning Blockchain Principles
Networked Tool Integration
Demonstration of Rust Capabilities
Building a simple distributed ledger
Experimenting with MCP server communication
FAQ from Mini-Blockchain
What is the purpose of the MCP server?
What is the purpose of the MCP server?
The MCP server allows external clients to interact with the blockchain using JSON commands over a network.
How do I add a block using the MCP server?
How do I add a block using the MCP server?
Send a JSON command like '{"command": "add_block", "data": "your data"}' to the server using netcat.
What is the genesis block?
What is the genesis block?
The genesis block is the first block in the blockchain, typically hardcoded with some initial data.
What hashing algorithm is used?
What hashing algorithm is used?
The SHA-256 hashing algorithm is used to secure the blockchain.
What are the prerequisites for running this application?
What are the prerequisites for running this application?
You need Rust and Cargo installed on your system.