Git Product home page Git Product logo

hns-stake's Introduction

HNS Stake

Project Structure

Client

React App, Typescript, Tailwind CSS

Server

NodeJS, Typescript, express, Sequelize.

Main folders

src
├── db
   ├── connect.ts
   ├── seed.ts         // useful for dev environment
   └── migrations      // database versioning
├── middleware          // API common intercetors
├── models
├── queue
   ├── producer.ts     // monitors hsd and populate the queue
   ├── queue.ts        // define queues used by multiple processes
   ├── rest.ts         // /queue endpoint (dev only)
   └── types.ts        // TS definitions used by queue
├── resolvers           // graphQL resolvers
├── service
   ├── apolloServer.ts // graphQL server
   └── hsd.ts          // `hsd` functions
├── types               // some Typescript definitions
└── server.ts           // entrypoint

Running locally

This repo contains 2 projects: client and server. You'll need to install their dependencies:

cd client
yarn install

cd ../server
yarn install

Then, you need to run both project. You can have 2 terminal windows and run yarn start in each folder. For convenience, there's a PM2 script, so we can run yarn start once at the root folder.

Docker

There are multiple yarn scripts that helps to bootstrap an local environment:

  • docker:db:start for the main Postgres database
  • docker:redis:start for the queue database
  • docker:hsd:start starts hsd on regtest

TDB: migration script

Queue

websocket.ts is a webscoket client connected to hsd. For each mempool or new block, this script will add their respective data in queues

hns-stake's People

Contributors

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