Unchained is a multi-blockchain backend interface with three main goals:
- Provide a common interface to multiple blockchains
- Provide additional information not always accessible from the node directly
- Provide realtime updates about blockchain transactions (pending and confirmed)
- Helpful Docs
- Project Structure
- Coin Stack Components
- Dependencies
- Notes
- Initial Setup
- Ports
- Docker-Compose Local Dev Instructions
- Kubernetes Local Dev Instructions
packages- shared internal packages across coinstackscoinstacks/common- common coinstack logic to reduce duplicationcoinstacks/{coin}- coin specific logic**/pulumi- pulumi infrastructure logic for deployment
- 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
- The ethereum coinstack is used in all examples. If you wish to run a different coinstack, just replace
ethereumwith the coinstack name you wish to run - All paths are relative to the root unchained directory (ex.
unchained/{path}) - All
pulumicommands should be run in apulumi/directory (ex.pulumi/,coinstacks/ethereum/pulumi/)
- Install Node.js LTS
- (Optional) use nvm to automatically install the node version specified in
.nvmrcnvm use
- (Optional) use nvm to automatically install the node version specified in
- Install Yarn
npm install --global yarn
- Install dependencies and build:
yarn && yarn build
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.localhostmongo.bitcoin.localhostrabbit-admin.bitcoin.localhost
- Install docker-compose
- Copy sample env file:
cp coinstacks/ethereum/sample.env coinstacks/ethereum/.env
- Fill out any missing environment variables
-
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
- API only:
-
To completely tear down the coinstack (including docker volumes):
cd coinstacks/ethereum && docker-compose down -v
