To setup and start the project do the following:
-
Get the project.
-
Run command npm install to install the project dependencies.
-
Run command npm start in the root directory to start the project. You can also start it using node app.js.
- To submit a validation request send a POST request to the following URL:
http://localhost:8000/requestValidation
request body should contain a wallet address:
{ "address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL" }
- To validate the request send a POST request to the following URL:
http://localhost:8000/message-signature/validate
request body should contain the wallet address and the signature:
{
"address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"signature":"H8K4+1MvyJo9tcr2YN2KejwvX1oqneyCH+fsUL1z1WBdWmswB9bijeFfOfMqK68kQ5RO6ZxhomoXQG3fkLaBl+Q="
}
- To store star data into the blockchain send a POST request to the following URL:
http://localhost:8000/block
request body should contain an address with star information
{
"address": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"star": {
"dec": "68° 52' 56.9",
"ra": "16h 29m 1.0s",
"story": "Found star using https://www.google.com/sky/"
}
}
-
To get a start block by its hash send a GET request to the following URL:
http://localhost:8000/stars/hash/startHash
where starHash in the above url is the hash of the block which contains the star data. -
To get star blocks by wallet address send a GET request to the following URL:
http://localhost:8000/stars/address/walletAddress
where walletAddress in the above url is the address of wallet which associated to stars. -
To get a star block using block height, make a GET request to the following URL:
http://localhost:8000/block/height
where height in the above url is a positive integer.