Code Monkey home page Code Monkey logo

unchained's Introduction

Introduction

ShapeShift ShapeShift ShapeShift CircleCI

Unchained is a multi-blockchain backend interface with three main goals:

  1. Provide a common interface to multiple blockchains
  2. Provide additional information not always accessible from the node directly
  3. Provide realtime updates about blockchain transactions (pending and confirmed)

Table Of Contents

Helpful Docs

Project Structure

  • packages - shared internal packages across coinstacks
  • coinstacks/common - common coinstack logic to reduce duplication
  • coinstacks/{coin} - coin specific logic
  • **/pulumi - pulumi infrastructure logic for deployment

Coin Stack Components

  • Blockchain Full Node - coin specific daemon providing historical blockchain data (ie. bitcoind, geth, etc)
  • Indexer - indexes transaction and balance history by address (if not provided by the node directly)
  • Ingester - ingests blockchain data providing:
    • websocket notification of any newly confirmed or pending transactions
    • stream of historical transaction history
    • additional parsing logic not provided by the indexer or node
  • Common API - a REST API that provides necessary data to a client in a common format across all blockchains

Coin Stack Architecture

Dependencies

Notes

  • The ethereum coinstack is used in all examples. If you wish to run a different coinstack, just replace ethereum with the coinstack name you wish to run
  • All paths are relative to the root unchained directory (ex. unchained/{path})
  • All pulumi commands should be run in a pulumi/ directory (ex. pulumi/, coinstacks/ethereum/pulumi/)

Initial Setup

  • Install Node.js LTS
    • (Optional) use nvm to automatically install the node version specified in .nvmrc
      nvm use
  • Install Yarn
    npm install --global yarn
  • Install dependencies and build:
    yarn && yarn build

Local Networking

We use traefik as a reverse-proxy to expose all of our docker containers. Traefik is exposed at port 80. Traefik Dashboard is exposed at port 8080

Traefik routes requests based on host name. which includes the coinstack name. For Example:

  • api.bitcoin.localhost
  • mongo.bitcoin.localhost
  • rabbit-admin.bitcoin.localhost

Docker-Compose Local Dev Instructions

Lightweight local development environment

Prerequisites

  • Install docker-compose
  • Copy sample env file:
    cp coinstacks/ethereum/sample.env coinstacks/ethereum/.env
  • Fill out any missing environment variables

Running

  • To start up the reverse proxy and hot reloading for files run from the root of the project

    docker-compose up
  • To spin up a coinstack:

    • API only:
      cd coinstacks/ethereum && docker-compose up api
    • API + Ingester (more resource intensive):
      cd coinstacks/ethereum && docker-compose up
  • To completely tear down the coinstack (including docker volumes):

    cd coinstacks/ethereum && docker-compose down -v

Kubernetes Local Dev Instructions

Mirrors production kubernetes environment as closely as possible


unchained's People

Contributors

0xdef1cafe avatar cjthompson avatar con5cience avatar elmutt avatar kaladinlight avatar mvpratt avatar notatooyou avatar pastaghost avatar phewitt avatar samortaylor avatar sterl avatar theoboldfrazier avatar

Watchers

 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.