Giter VIP home page Giter VIP logo

blockchain's Introduction

Private blockchain with Express API

I have used javascript to develop the backend for a private blockchain and a front end API to interact with this blockchain. I chose express because of it's user acceptance by the corporate world.

Getting Started

You will need node.js in order to run this blockchain. In addition, I would recommend using postman to test the GET and POST requests. This project will use the PORT: http://localhost:8000/block

The blockchain is also persisted with leveldb. I have attached my .JSON file so the packages can be viewed.

Running the tests The functionality of the express API consists of the GET and POST Method.

The GET method will return the block details for the ID in the webaddress below:

http://localhost:8000/block/0

An example of this output would be:

{ "hash": "c97ec16c7412eaf326f7bb64a30a2cf8d363b1488289ddd3b9a3f511f380e789", "height": 0, "body": "Genesis Block", "time": "1536942119", "previousBlockHash": "" }

The POST function will post a new block to the blockchain by selecting POST in Postman to the following link:

http://localhost:8000/block/

An example of the outcome would be:

Block has been added to the chain!{"hash":"1350c7c5eadb7e5189771699a753887fbcce6f30580e2db6c1a2ded53c941d6f","height":15,"body":"Testing block with test string data","time":"1537363451","previousBlockHash":"753e6006bbd75297915873fac27ee0378cb25aff87e6f9825e6d8aef1f9853d2"}

Built With Node.js Express Level_DB Contributing

Versioning We use SemVer for versioning.

Authors David Havera

blockchain's People

Contributors

djhavera 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.