Secure Digital Assets on a Private Blockchain.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Download and install Node.js
Clone project
$ git clone https://github.com/dgravvanis/private-blockchain-notary-service.git
Install project dependencies
$ npm install
The project’s API service is configured to run on port 8000. The default URL is using localhost for connectivity (http://localhost:8000).
Start the server
$ node app.js
- URL
- Payload
{
"address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL"
}
- Response
{
"walletAddress": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"requestTimeStamp": "1544451269",
"message": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL:1544451269:starRegistry",
"validationWindow": 300
}
- URL
- Payload
{
"address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"signature":"H8K4+1MvyJo9tcr2YN2KejwvX1oqneyCH+fsUL1z1WBdWmswB9bijeFfOfMqK68kQ5RO6ZxhomoXQG3fkLaBl+Q="
}
- Response
{
"registerStar": true,
"status": {
"address": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"requestTimeStamp": "1544454641",
"message": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL:1544454641:starRegistry",
"validationWindow": 193,
"messageSignature": true
}
}
Web API POST endpoint with JSON response that submits the Star information to be saved in the Blockchain.
- URL
- Payload
{
"address": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"star": {
"dec": "68° 52' 56.9",
"ra": "16h 29m 1.0s",
"story": "Found star using https://www.google.com/sky/"
}
}
- Response
{
"hash": "8098c1d7f44f4513ba1e7e8ba9965e013520e3652e2db5a7d88e51d7b99c3cc8",
"height": 1,
"body": {
"address": "19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL",
"star": {
"ra": "16h 29m 1.0s",
"dec": "68° 52' 56.9",
"story": "466f756e642073746172207573696e672068747470733a2f2f7777772e676f6f676c652e636f6d2f736b792f"
}
},
"time": "1544455399",
"previousBlockHash": "639f8e4c4519759f489fc7da607054f50b212b7d8171e7717df244da2f7f2394"
}
- URL
-
HASH: The hash of the block
-
Response
{
"hash": "a59e9e399bc17c2db32a7a87379a8012f2c8e08dd661d7c0a6a4845d4f3ffb9f",
"height": 1,
"body": {
"address": "142BDCeSGbXjWKaAnYXbMpZ6sbrSAo3DpZ",
"star": {
"ra": "16h 29m 1.0s",
"dec": "-26° 29' 24.9",
"story": "466f756e642073746172207573696e672068747470733a2f2f7777772e676f6f676c652e636f6d2f736b792f",
"storyDecoded": "Found star using https://www.google.com/sky/"
}
},
"time": "1532296234",
"previousBlockHash": "49cce61ec3e6ae664514d5fa5722d86069cf981318fc303750ce66032d0acff3"
}
- URL
-
ADDRESS: Bitcoin address
-
Response
[
{
"hash": "a59e9e399bc17c2db32a7a87379a8012f2c8e08dd661d7c0a6a4845d4f3ffb9f",
"height": 1,
"body": {
"address": "142BDCeSGbXjWKaAnYXbMpZ6sbrSAo3DpZ",
"star": {
"ra": "16h 29m 1.0s",
"dec": "-26° 29' 24.9",
"story": "466f756e642073746172207573696e672068747470733a2f2f7777772e676f6f676c652e636f6d2f736b792f",
"storyDecoded": "Found star using https://www.google.com/sky/"
}
},
"time": "1532296234",
"previousBlockHash": "49cce61ec3e6ae664514d5fa5722d86069cf981318fc303750ce66032d0acff3"
},
{
"hash": "6ef99fc533b9725bf194c18bdf79065d64a971fa41b25f098ff4dff29ee531d0",
"height": 2,
"body": {
"address": "142BDCeSGbXjWKaAnYXbMpZ6sbrSAo3DpZ",
"star": {
"ra": "17h 22m 13.1s",
"dec": "-27° 14' 8.2",
"story": "466f756e642073746172207573696e672068747470733a2f2f7777772e676f6f676c652e636f6d2f736b792f",
"storyDecoded": "Found star using https://www.google.com/sky/"
}
},
"time": "1532330848",
"previousBlockHash": "a59e9e399bc17c2db32a7a87379a8012f2c8e08dd661d7c0a6a4845d4f3ffb9f"
}
]
- URL
-
HEIGHT: Height of the block
-
Response
{
"hash": "a59e9e399bc17c2db32a7a87379a8012f2c8e08dd661d7c0a6a4845d4f3ffb9f",
"height": 1,
"body": {
"address": "142BDCeSGbXjWKaAnYXbMpZ6sbrSAo3DpZ",
"star": {
"ra": "16h 29m 1.0s",
"dec": "-26° 29' 24.9",
"story": "466f756e642073746172207573696e672068747470733a2f2f7777772e676f6f676c652e636f6d2f736b792f",
"storyDecoded": "Found star using https://www.google.com/sky/"
}
},
"time": "1532296234",
"previousBlockHash": "49cce61ec3e6ae664514d5fa5722d86069cf981318fc303750ce66032d0acff3"
}
- Node.js
- Hapi - Server Framework
- level - LevelDB wrapper for Node.js
- hex2ascii - Convert hex to ascii in JavaScript
- crypto-js - JavaScript library of crypto standards
- bitcoinjs-lib - A javascript Bitcoin library for node.js
- bitcoinjs-message - Sing/Verify a Bitcoin message
- Gravvanis Dimitris
This project is licensed under the MIT License.