Skip to content

chrisgitiota/unchained

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Coin Stack Components

  • Node - coin specific node daemon providing historical blockchain data (ex. bitcoind, geth, etc)
  • Indexer - optional service that indexes transaction and balance history by address, or any other applicable information, if not provided by the node directly
  • Ingester (TO BE REMOVED) - 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
  • API - provides a base set of functionality via REST and WebSocket that can be extended with coin specific logic

Architecture Diagrams

With Ingester (TO BE REMOVED)


No Indexer With Indexer

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 project directory (ex. unchained/[go|node]/{path})
  • All pulumi commands should be run in a pulumi/ directory (ex. pulumi/, coinstacks/ethereum/pulumi/)

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

Setup

  • Each language subdirectory has setup requirements before running a coinstack locally
    • Go - unchained/go
    • Node - unchained/node

Docker-Compose Local Dev Instructions

Lightweight local development environment


Prerequisites

Running

  • Commands should be run from the language subdirectory (ex. unchained/go, unchained/node)

  • Start the reverse proxy and any common service (ex. hot reloading)

    docker-compose up -d

    Note: -d runs the containers in daemon (background) mode. If you want to see logs, -d can be omitted.

  • Start a coinstack:

    cd coinstacks/ethereum && docker-compose up
    • If only developing on the API:

      cd coinstacks/ethereum && docker-compose up api
  • Visit http://api.ethereum.localhost/docs to view the OpenAPI documentation for the API

  • Tear down a coinstack (including docker volumes):

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

Common Issues

  • If you are running Docker Desktop and see any SIGKILL errors, increase your resource limits in the Resources Tab

Kubernetes Local Dev Instructions

Mirrors production kubernetes environment as closely as possible


About

Unchained is a multi-blockchain backend interface

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 79.2%
  • Go 13.3%
  • JavaScript 5.2%
  • Shell 0.9%
  • HTML 0.6%
  • Makefile 0.4%
  • Dockerfile 0.4%