This is my project submission for IS303 Architectural Analysis. The goal of the project was to explore concurrent programming in Java. This is a toy project for educational purposes and simplifies real-world cryptocurrency mining software.
The project contains 4 main batch scripts
- compile.bat (compiles all files)
- run.bat (runs both compile.bat then run_server.bat)
- run_server.bat (runs the server with certain arguments)
- run_client.bat (runs the client with certain arguments)
Takes in 3 arguments
- port number
- Number of MokBlocks to mine (can be any number you want, it's just the target limit for the mining activity)
- Difficulty of mining (don't set this above 8 - 10 as it may take too long to mine the blocks)
Takes in 2 arguments
- hostname of server
- port number of server
- Open a powershell/cmd window in the project directory for the server
- Run
run.bat
(compiles all files and starts the server) - Open as many powershell/cmd windows for as many clients as you want
- Run
run_client.bat
for every client window - Wait until all blocks have been mined
If it takes too long to mine blocks then you may want to lower the difficulty
. The difficulty
refers to how long it takes to find a hash that satisfies the mining requirement that is the hash needs to start with difficulty number of zeroes.