Mini-Blockchain

Mini-Blockchain

3.2

This repository contains a simple blockchain demonstration implemented in Rust, integrating an MCP server to expose blockchain functionalities over a network.

The Blockchain CLI in Rust is a minimal command-line application that demonstrates core Rust principles through a basic blockchain implementation. Each block in the blockchain includes an index, timestamp, user-supplied data, previous hash, and current hash. The application features a menu-driven CLI that allows users to add new blocks, print the current blockchain, and validate the blockchain's integrity. The project also integrates an MCP server that runs concurrently with the CLI, enabling external clients to interact with the blockchain using JSON commands over a network.

Features

  • Basic blockchain implementation with essential block components.
  • Menu-driven CLI for user interaction.
  • Blockchain integrity validation.
  • Concurrent MCP server for network interaction.
  • JSON-based communication for MCP commands.

Usage with Different Platforms

mcp

bash
echo '{"command": "latest_block"}' | nc 127.0.0.1 7878

add_block

bash
echo '{"command": "add_block", "data": "sample transaction"}' | nc 127.0.0.1 7878