As a student of the Udacity Nanodegree program, I am starting my journey as a Blockchain Developer, this project allows me to demonstrate that I am familiarized with the fundamentals concepts of a Blockchain platform. Concepts like: - Block - Blockchain - Wallet - Blockchain Identity - Proof of Existance
In this project I will have a boilerplate code with a REST Api already setup to expose some of the functionalities I will implement in my private blockchain.
- Some of the libraries or npm modules you will use are:
- "bitcoinjs-lib": "^4.0.3",
- "bitcoinjs-message": "^2.0.0",
- "body-parser": "^1.18.3",
- "crypto-js": "^3.1.9-1",
- "express": "^4.16.4",
- "hex2ascii": "0.0.3",
- "morgan": "^1.9.1"
Using POSTMAN and debug code using VSCode.
- Run your application using the command
node app.js
You should see in your terminal a message indicating that the server is listening in port 8000:
Server Listening for port: 8000
-
To make sure your application is working fine and it creates the Genesis Block you can use POSTMAN to request the Genesis block:
This command is probably outdated so I used instead
Message in Postman:
{ "hash": "a6bab81e354dd7d0894f7f2647b5fb1dd5b95cbd5648ecc21880e5534cea1df2", "height": 0, "body": "7b2264617461223a2247656e6573697320426c6f636b227d", "time": "1629140281", "previousBlockHash": null }
-
Make your first request of ownership sending your wallet address:
-
Sign the message with your Wallet:
In order to post signature , I generate legacy address as default wallet in electrum is sigwit. I followed instructions from this blog: https://bitcointalk.org/index.php?topic=5338687.0
Message in Postman:
{ "address":"1BnBZxjZS8FuvAmYryhNv9pjNrywuLCemn" }
-
Message in postman:
{ "address":"1BnBZxjZS8FuvAmYryhNv9pjNrywuLCemn", "signature":"IGSRH8PzJRpom3YU03klzZ4soF5bvt/hHeDKNjmnGQ+fA4Q1nRMigDZdfDjvYUs52dpvRg1PoXUBodmg3Mgg5u0=", "message":"1BnBZxjZS8FuvAmYryhNv9pjNrywuLCemn:1629140445:startRegistr", "star": { "dec": "68° 52' 56.9", "ra": "16h 29m 1.0s", "story": "Testing the story 2" } }
-
Message in postman:
[ { "owner": "1BnBZxjZS8FuvAmYryhNv9pjNrywuLCemn", "data": { "dec": "68° 52' 56.9", "ra": "16h 29m 1.0s", "story": "Testing the story 2" } } ]