Code Monkey home page Code Monkey logo

private-blockchain-notary-service-project-4's Introduction

Project 4: Private Blockchain Star Notary Service

This services enables users to register stars on a private blockchain.

Setup

To setup the notary service complete the following:

  1. Clone or download the repository: https://github.com/chrisfranz/private-blockchain-notary-service-project-4.git

  2. Run command npm install to install the project dependencies.

  3. 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/

Project Features

1. Request Validation

Send a POST request to endpoint http://localhost:8000/requestValidation

The request body should contain the following JSON data:

{ "address":"19xaiMqayaNrn3x7AjV5cU4Mk5f5prRVpL" }

2. Generate A Signature

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.

3. Validate Message Signature

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="
}

4. Save your star data on the blockchain

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/"
          }
}

5. Star Look-Up

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]

private-blockchain-notary-service-project-4's People

Contributors

chrisfranz avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.