Native blockchain implementation in JavaScript.
- Connect two or more peers in seperate terminal sessions.
First, peer 1
(npm run peer1
):
./node_modules/.bin/cross-env PEER_PORT=6001 HTTP_PORT=3001 node index.js
and peer 2
or (npm run peer2
):
./node_modules/.bin/cross-env PEER_PORT=6002 HTTP_PORT=3002 PEERS=6001 node index.js
Use curl below to simply execute or just run (npm run mine
)
curl --data '{"content" : "Add some data here"}' -H "Content-Type: application/json" http://localhost:3001/mine
or you can use Postman to execute POST
requests and mine for blocks.
Run the unit tests by executing the following command:
npm run test
Tests will run using AVA and validate the blockchain technology code to see if it's broken through Q&A scenarios.
Additionally, you can run npm run lint
to check to see if the code is ESLint compliant.