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 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.
As a first step please clone .env.tpl
file into .env
and fill with values:
ADDRESS
- address of the server's account, from which it sends the results of request to the smart contractsPRIVATE_KEY
- private key of the server's accountORACLE_ADDRESS
- address of theOracle
smart contractDATABASE_URL
- URL with port for MongoDB connectionDATABASE_NAME
- MongoDB database nameNODE_URL
- URL for the WebSocket provider to blockchain network
Requirements:
Node.js >= 7.6
- async/await support
Dev environment:
- Run
npm install
to install dependencies. - Run
npm run ganache
to start a test blockchain. - Deploy necessary smart contracts from
oracle-sm
repository:cd oracle-sm/ && truffle migrate --network development
. - Update the
.env
file if necessary. - Start the server by running
npm start
.
- Run:
make local
(single command build) - Build:
make build-local
- Clean:
make clean-local
- Run:
make
(single command build) - Build:
make build
- Clean:
make clean
Attention! Check if variables in .env
file are correct.