Final Year Project (MCS 2017-2018)
Project Title: Bitcoin Blockchain Application
Supervisor: Sir Khalid Jamal
Members: Riaz Ahmed, Ayesha Qureshi
- Install Node LTS 8.x.x (https://nodejs.org/en/download/)
- Install NPM (if you have installed node it comes with NPM)
- Install Application dependencies
npm install - A text editor (sublime preferred) (https://www.sublimetext.com/3)
- Postman (https://www.getpostman.com/downloads/)
Please follow the steps given below, do it in sequence.
Run 5 instances on different ports, all should be up and running
npm run node_1
npm run node_2
npm run node_3
npm run node_4
npm run node_5
Register all nodes together to make a decentralised network
URL: http://localhost:3001/register-and-broadcast-node
METHOD: POST
PAYLOAD:
{
"newNodeUrl": "http://localhost:3002"
}
{
"newNodeUrl": "http://localhost:3003"
}
{
"newNodeUrl": "http://localhost:3004"
}
{
"newNodeUrl": "http://localhost:3005"
}
Make a transaction on any node, it will be broadcasted to all other nodes as well
URL: http://localhost:3001/transaction/broadcast
METHOD: POST
PAYLOAD:
{
"amount": 600,
"sender": "JENSDHFAS7DF7SADFY72",
"recipient": "SALDFJALKSFDJ82YE"
}
Mine a new block on any node, and it will be broadcasted to all other nodes as well
URL: http://localhost:3001/transaction/mine
Consensus will validate the chain, to make it work shutdown any node let's say at port 3005 and make some transactions on any other node and start the server at port 3005 again and again register it with any other node. So blockchain at port 3005 does not contain the valid chain. In order to validate do the following:
URL: http://localhost:3005/consensus
You can see the transaction details for each block by using BlockHash, TransactionID, Address
URL: http://localhost:3005/block-explorer
