GithubHelp home page GithubHelp logo

alexbyk / dummycoin Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 258 KB

DummyCoin is a simple blockchain client-server implementation written in TypeScript

Home Page: http://dummycoin.alexbyk.com

JavaScript 69.43% TypeScript 23.48% CSS 1.83% HTML 3.48% Shell 1.79%
rxjs angular typescript brotobuf grpc nodejs node docker job-interviews javascript js framework blockchain blockchain-technology blockchain-demo blockchain-demos docker-compose

dummycoin's Introduction

About DummyCoin

DummyCoin is my test task for the job interview. I made some changes to the original task. Because cutting-edge technologies require cutting-edge technologies πŸ˜ƒ

πŸ‘Š Api is based on GRPC protocol. Because it's way better than json and written once is ready for any language.

😍 Typescript instead of Javascript. Because it’s superior.

πŸ‘Œ RxJS for simple and convenient state management and as a communication layer of abstraction between frontend and grpc api

πŸ’₯ Proof-of-work improved. User should calculate a nounce that will lead to hash containing 0 in the beginning (constant complexity for simplicity). This is a way better (also original task has an intenger overflow problem)

😎 Blockchain itself is implemented as a separate library

πŸ‘€ Blockhain can use any db/file/memory storage that satisfies IStore interface. Simple InMemory storage ships with this package

πŸ’ͺ This application also is a simple but awesome GRPC microframework. Writing new methods is a pleasure

πŸ˜€ The blockchain libdummy librarry does support consensus (pick the longest valid chain), but for demonstration purposes nodejs methods are missing

πŸ”₯ Awesome Angular 6 as a frontend framework and awesome micro as nodejs microframework

Demo

http://dummycoin.alexbyk.com

Running on the local machine

Install docker and docker-compose. Download docker-compose file and run it

wget -O docker-compose.yml https://raw.githubusercontent.com/alexbyk/dummycoin/master/docker-compose.yml
docker-compose down && docker-compose pull  && docker-compose up -d

See the content of the docker-compose.yml to find docker-hub images

Development

./run should be your first command after git clone

  • ./run - install node modules, build protos and run development servers on http://localhost:4200
  • ./run start - just run development servers
  • ./run test - test all
  • ./run --help - see other commands, (docker, docs generation...)

Structure

  • Each subproject contains Dockerfiles to build an image using ./run build-docker
  • Each subproject contains unit and functional tests. Run npm run test:watch for test-driven development

Nodejs

  • libdummy - blockchain reuseble library
  • micro - awesome grpc microframework + grpc tester, written for this app
  • _proto - autogenerated api files

Autogenerated NodeJs docs

Frontend (angular)

  • api-grpc - grpc based api client, written for this app, that translates grpc calls into RxJs.
  • state - easy ready/error/data states with RxJs.

Autogenerated Front docs

GRPC(Protobuf 3) api

We provide support for browsers using grpcwebproxy proxy server

Autogenerated API docs

Docker

By default, docker images use these ports

  • 9090 - angular frontend
  • 9091 - grpcwebproxy
  • 9092 - node grpc server
  • 9093 - documentation server

Author

https://alexbyk.com

dummycoin's People

Contributors

alexbyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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