The Blockchain Logger is a proof-of-concept prototype that securely captures Windows Event Logs and stores them on a private Ethereum blockchain to ensure tamper-proof, immutable and verifiable log storage.
Before running the implementation, the following will need to be installed:
- Node.js (https://nodejs.org)
- Ganache (https://trufflesuite.com/ganache/)
Once you have cloned or downloaded the repository, you can then install all the necessary dependencies by running:
npm install
Now that the repository is set up, and the dependencies installed, the batch file needs to be added to the task scheduler. To do this, Windows Powershell with administrator privileges must be used to run the following command:
schtasks /create /sc minute /mo 2 /tn "BlockchainLogMonitor" /tr "cmd /c "D:\Varsity Work\Honours\COS700\Implementation\runLogMonitor.bat"" /ru SYSTEM /rl HIGHEST
(Please replace the path name with the path to the runLogMonitor.bat file in the repository on your system)
Once running this command, you should be able to see the batch file in your task scheduler as shown here:

Please also ensure that the path In your runLogMonitor.bat file is the path to the repository on your machine:

Next, you will need to start Ganache and copy + paste the private key to the repository. Once you start Ganache, the following will be shown, you can click the quickstart button:
Then you will be shown the following screen:

You can click on any of the keys to capture a private key for that address, the private key will then be shown as such:

Copy this key, and paste it into your hardhat.config file in the repository, as shown below:

Before the first run, please remember to clear the last-log.json file as shown:

Remember to then save the files before running the following commands.
First, compile the implementation with the following code:
npx hardhat compile

Then run the following to deploy the code:
npx hardhat run scripts/deploy.js --network ganache

Then, ensure the scheduled task from earlier is enabled and running, you can run it for the first time from the task scheduler and then it should run automatically every 2 minutes from that point forward. This is done by selecting the task and clicking run on the right hand side:
You should then be able to see that logs have been added to the blockchain:

To view these logs on the server, you will need to run the following command to start the server:
npx hardhat run scripts/sever.js --network ganache

The server can then be opened on the browser:

On each refresh of the page, any new logs (if generated and captured in that time) will then be displayed as well.