This is a Personal Blockchain backend app made in NodeJS.
The proposal is to build a blockchain system running on the local network. One can run this app in his/her local machine and save data in the blockchain as a transaction. This will work only in a LAN.
- NodeJS version: 12.18.3
- MongoDB version: 4.4.5
- Install NodeJS on your local machine.
- Install MongoDB for Database access.
- Clone the repository with
git clone https://github.com/magic-kiri/Personal-Blockchian.git
command (for windows users) in the current directory. - In the project directory use
npm install
command to install all the dependecies.
- Run
monogo.exe
file fromMongoDB\Server\4.4\bin\
- Go to the project directory and run it using
node app.js
- For better usage, you can use a frontend web-app Personal Blockchain Frontend
- Make sure the subnet musk of the network is 255.255.255.0
- All devices running under the same router.
- Machines IP address should be between $.$.$.100 - $.$.$.120
The proposal was to build a blockchain system running on the local network. It communicates with other active hosts running same server on port: 4000. One can run this app in his/her local machine and log-In/sign-Up using API. After signing-In user can send a POST request to the server to save an Transaction. The server propagtes the transaction to all other active nodes in the network. Every active node in the network verifies the transaction with the help of digital signature and if it is valid then the server will insert the transaction in its own Transaction Pool .
For a certain period of time every active node in the network creates an block and share it to each other. After the time period every node gets the optimal block and they append it in thein blockchain. There is an Rotational Consensus Algorithm which help every node to select a block to add in the blockchain and maintains the ledger identical. If there are no transaction in the current block then the server discards the block.