This project is built on private blockchain that accepts string data as input through Express.js RESTful Web API.
- Node.js - Backend services.
- Express.js - Web application framework.
- crypto-js - SHA256 Algorithm.
- Postman - API development environment.
- levelDb - Database to persist data.
Install the required dependencies using npm package manager.
npm init --yes
npm install express --save
npm install crypto-js --save
npm install level --save
- Run the code using node.js.
node index.js - Using postman, make the GET and POST http requests.
http://localhost:8000/blockand the corresponding JSON body as{"body": "Testing block with test string data" }. After that you will get the corresponding output depending on your input.
http://localhost:8000/- Responds with all the endpoints available.http://localhost:8000/block/1(corresponding block height) - Output is a block which is given as a height in http request.http://localhost:8000/chain/- Responds with the entire blockchain.
RESTful-Web-API - Refer for endpoint documentation.
MIT © Manolingam