lets imagine there are people who are interested in astronomy, so this is a test application that will allows people to register stars and making sure the application know who owned each star.
- This application will be created using Node.js and Javascript programming language. The architecture will use ES6 classes
- 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"
First thing first, we are going to download or clone our boilerplate code.
Then we need to install all the libraries and module dependencies, to do that: open a terminal and run the command npm install
At this point we are ready to run our project for first time, use the command: npm start
You can check in your terminal the the Express application is listening in the PORT 8000
To test your application I recommend you to use POSTMAN.
- Run your application using the command
npm start
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:
- Make your first request of ownership sending your wallet address:
- Sign the message with your Wallet:
- Submit your Star
- Retrieve Stars owned by me
- validate blockchain function before mutation which gives an empty errorLog Array
- mutate the blockchain: adds 2 blocks and then mutate the data to test the vlidateChain function
- validate blockchain function after mutation which gives an array of all the errors