This is a simple blockchain simulation program implemented in Rust. It allows you to simulate mining blocks and transactions in a blockchain.
- Block Mining: Mine blocks with proof-of-work mechanism using SHA-256 hashing algorithm.
- Transaction Simulation: Simulate transactions between imaginary traders.
- Visual Effects: Visual feedback during block mining.
- Ensure you have Rust installed on your system.
- Clone this repository.
- Navigate to the repository directory.
- Run the program using the command
cargo run
. - Follow the prompts to enter your miner name and observe the mining process.
- The program defines a
Block
structure representing a block in the blockchain. - It implements methods for block creation, hashing, and mining.
- A
Blockchain
structure manages a chain of blocks and provides methods for adding blocks. - The
main
function initializes the simulation, prompts the user for input, simulates transactions, and displays results.
- Upon running the program, the user is prompted to enter their miner name.
- The program simulates transactions between imaginary traders by mining blocks.
- Each block contains transaction data and is mined with proof-of-work.
- The simulation ends when all transactions are completed.
- Statistics such as total blocks added, total Bekcoin traded, and simulation end time are displayed.
- Author: Amir Bekhit (BEK BRACE)
This project is licensed under the MIT License.