SimpleChainJS is a minimal blockchain built in Node.js, designed for learning and certification projects. It demonstrates the fundamental principles of blockchain: blocks, proof-of-work, transactions, and exposes a simple REST API.
- Add new transactions
- Mine blocks (Proof of Work)
- View the full blockchain
- Simple REST API with Express.js
- Node.js >= 14
- npm
npm install
node simplechain.js
The server will start on http://localhost:3000/
GET /chain
- Get the entire blockchainPOST /transactions/new
- Add a new transactionGET /mine
- Mine a new block
- Add a transaction:
curl -X POST -H "Content-Type: application/json" \
-d '{"sender":"alice","recipient":"bob","amount":10}' \
http://localhost:3000/transactions/new
- Mine a block:
curl http://localhost:3000/mine
- View the chain:
curl http://localhost:3000/chain