EspeoBlockchain / gardener-server

Node.js server for Gardener open source oracle project
MIT License
29 stars 6 forks source link

Oracle server

CircleCI Coverage Status Documentation Status

This repository is a part of open source oracle project. Initially developed by Espeo Software. Contains off-chain server for processing requests from the Oracle contract.

Detailed documentation here: https://gardener.readthedocs.io

Table of contents:

Oracle theory

Oracle is a concept of getting information from outside of the blockchain to the smart contracts. Out of the box smart contracts cannot access anything outside of the blockchain network. That's were the oracle idea fits. The information exchange begins with the smart contract emitting an event describing the necessary information. A trusted off-chain server listening for such events parses it, gets data from a data source and passes it back to the smart contract.

Architecture

Oracle architecture sketch

Installation

As a first step please clone .env.tpl file into .env and fill with values:

Bare-metal

Requirements:

Dev environment:

  1. Run npm install to install dependencies.
  2. Run npm run ganache to start a test blockchain.
  3. Deploy necessary smart contracts from oracle-sm repository: cd oracle-sm/ && truffle migrate --network development.
  4. Update the .env file if necessary.
  5. Start the server by running npm start.

Using docker

Local environment with test blockchain (ganache)

  1. Run: make local (single command build)
  2. Build: make build-local
  3. Clean: make clean-local

Environment using public blockchain

  1. Run: make (single command build)
  2. Build: make build
  3. Clean: make clean

Attention! Check if variables in .env file are correct.