/hyperledger-typescript-boilerplate

This is a boilerplate that interacts between Hyperledger Fabric Peers and a front end.

Primary LanguageTypeScriptMIT LicenseMIT

Build Status

This is a starter template that interacts between Hyperledger Fabric Peers and a front end. Currently, this boilerplate provides the following features:

  • Connects out of the box with the fabcar sample network
  • Express backend built with typescript using Nest
  • Restful routing to connect a custom frontend
  • Automatic OpenAPI (Swagger) generation
  • Fabric Client and Fabric Ca CLient abstraction (https://martinfowler.com/bliki/CQRS.html)
  • Frontend chain transaction notifications using Pusher
  • Solves Hyperledger concurrency issues by using a FIFO AWS SQS queue.
  • Example Authentication using Auth0
  • Automatic attribute based access crontrol using auth0

Installation

In order for this application to run properly and handle invokes concurrently, you should have set up an account on AWS to be able to use the AWS SQS Service. During development, the SQS Queue can be bypassed using an environment variable: BYPASS_QUEUE=1 A Pusher account is also required if you want to make use of transaction event handling in a frontend. Auth0 will require Auth0 credentials.

Be sure to have an up to date node.js configuration:

    "engines": {
        "node": "^8.9",
        "npm": "^5.6"
    }

Install dependencies

npm i

Starting the app

npm start

E2E Tests using Jest (wip)

npm test

Work in progress and future plans:

  • Further Refactoring of the Hyperledger Fabric Client & Ca SDK abstraction layer using Typescript (WIP)
  • Proper E2E Testing using Jest, supertest and Jasmine (WIP)
  • Proper Error Handling and integration of 3rd party logging service
  • Websocket integration to replace pusher
  • Proper CQ resposibility separation
  • Static page generator using pug
  • Makefile generator to choose between static pages or headless api.

Feel free to contribute or make suggestions.

Get in touch

Interested in starting your own blockchain project, but don’t know how? Do you need help starting your token sale or having one audited? Get in touch https://theledger.be