No description
- JavaScript 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| app.js | ||
| Block.js | ||
| BlockChain.js | ||
| BlockController.js | ||
| LevelSandbox.js | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| simpleChain.js | ||
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
- Download or clone the repository
- Install project dependencies:
npm install - 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
- Starter code
- LevelDB to persist the data
- Node.js
- hapijs framework to build API web service
- crypto-js for SHA256 cryptographic function
- Understanding usage of async/await instead of regular promises: