This services enables users to register stars on a private blockchain.
To setup the notary service complete the following:
-
Clone or download the repository: https://github.com/chrisfranz/private-blockchain-notary-service-project-4.git
-
Run command npm install to install the project dependencies.
-
From the root directory, run command node app.js in the terminal to start server. Access the server at the following address:
http://localhost:8000/
Send a POST
request to endpoint http://localhost:8000/requestValidation
The request body should contain the following JSON data:
{ "address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL" }
Take the address
and message
from the response and generate a signature in your bitcoin wallet. Send a POST
request with the address
and signature
in step 3.
Send a POST
request to endpoint http://localhost:8000/message-signature/validate
The request body should contain the following JSON data:
{
"address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"signature":"H8K4+1MvyJo9tcr2YN2KejwvX1oqneyCH+fsUL1z1WBdWmswB9bijeFfOfMqK68kQ5RO6ZxhomoXQG3fkLaBl+Q="
}
If you were successful in receiving validation in step 3, you may now save your star data to the blockchain. Send a POST
request to http://localhost:8000/block
with the following JSON schema:
{
"address": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"star": {
"dec": "68° 52' 56.9",
"ra": "16h 29m 1.0s",
"story": "Found star using https://www.google.com/sky/"
}
}
Look up your star on the blockchain with the following GET
requests
Hash http://localhost:8000/stars/hash[HASH]
Address http://localhost:8000/stars/address[ADDRESS]
Block http://localhost:8000/block/[HEIGHT]