No description
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-02-11 21:24:36 +01:00
.gitignore ignore node_modules and chaindata folders 2018-12-22 17:44:19 +01:00
app.js feat: Add GET API endpoint 2018-12-22 17:44:59 +01:00
Block.js Add files 2018-12-16 17:46:05 +01:00
BlockChain.js Add files 2018-12-16 17:46:05 +01:00
BlockController.js feat: Don't add blocks without content 2018-12-22 17:59:23 +01:00
LevelSandbox.js Add files 2018-12-16 17:46:05 +01:00
LICENSE Update LICENSE 2024-02-11 21:24:36 +01:00
package-lock.json Add Hapi package 2018-12-22 17:44:33 +01:00
package.json Add Hapi package 2018-12-22 17:44:33 +01:00
README.md Update 2018-12-22 18:14:14 +01:00
simpleChain.js Add files 2018-12-16 17:46:05 +01:00

Private Blockchain Project

In this project I created a private blockchain.
I implemented the classes defining the data structure for the blocks and the chain.
In order to be able to persist my blochchain I used LevelDB.
Finally I implemented GET and POST API endpoints using the hapijs framework.

Getting Started

  1. Download or clone the repository
  2. Install project dependencies: npm install
  3. Start the web service: node app.js

API endpoints

The server runs locally by default on port 8000.
You may select a different one by updating the PORT parameter of the BlockAPI constructor in app.js.

  • /api/block/height: to retrieve a block by its height/index.
  • /api/block: to add a new block ("data=block's content")

Resources