Git Product home page Git Product logo

oracles's Introduction

oracles-v2

Summary

Oracle client written in bash that utilizes secure scuttlebutt for offchain message passing along with signed price data to validate identity and authenticity on-chain.

Design Goals

Goals of this new architecture are:

  1. Scalability
  2. Reduce costs by minimizing number of ethereum transactions and operations performed on-chain.
  3. Increase reliability during periods of network congestion
  4. Reduce latency to react to price changes
  5. Make it easy to on-board price feeds for new collateral types
  6. Make it easy to on-board new Oracles

Architecture

Currently two main modules:

[Feed] Each Feed runs a Feed client which pulls prices through Setzer, signs them with an ethereum private key, and broadcasts them as a message to the secure scuttlebutt network.

[Relayer] The relayer monitors the gossiped messages, checks for liveness, and homogenizes the pricing data and signatures into a single ethereum transaction.

[Live Kovan Oracles]

  BATUSD = 0xAb7366b12C982ca2DE162F35571b4d21E38a16FB
  BTCUSD = 0xf8A9Faa25186B14EbF02e7Cd16e39152b85aEEcd
  ETHUSD = 0x0E30F0FC91FDbc4594b1e2E5d64E6F1f94cAB23D

[Live Mainnet Oracles]

  BATUSD = 0x18B4633D6E39870f398597f3c1bA8c4A41294966
  BTCUSD = 0xe0F30cb149fAADC7247E953746Be9BbBB6B5751f
  ETHUSD = 0x64DE91F5A373Cd4c28de3600cB34C7C6cE410C85

Query Oracle Contracts

Query Oracle price Offchain

rawStorage=$(seth storage <ORACLE_CONTRACT> 0x1)
seth --from-wei $(seth --to-dec ${rawStorage:34:32})

Query Oracle Price Onchain

seth --from-wei $(seth --to-dec $(seth call <ORACLE_CONTRACT> "read()(uint256)"))

This will require the address you are submitting the query from to be whitelisted in the Oracle smart contract. To get whitelisted on a Kovan Oracle please send an email to [email protected]. To get whitelisted on a Mainnet Oracle please submit a proposal in the Oracle section of the Maker Forum forum.makerdao.com Your proposal will need to be ratified by MKR Governance to be enacted. Details of the proposal format can be found inside the Forum.

Installation Instructions

*Currently Maker Internal only https://docs.google.com/document/d/1onYu0_1j3fDtInay85hie92O_-zptGkGFgI0OePI86c/edit?usp=sharing

If you run into any problems with the installation instructions please contact @Nik on chat.makerdao.com

Install with Nix

Add dapptools build caches:

nix run nixpkgs.cachix -c cachix use dapp

Get the Scuttlbot private network keys (caps) from an admin and put it in a file (e.g. called secret-ssb-caps.json). The file should have the JSON format: { "shs": "<BASE64>", "sign": "<BASE64>" }.

Then run the following to make the omnia, ssb-server and install-omnia commands available in your user environment:

nix-env -i -f https://github.com/makerdao/oracles-v2/tarball/master \
  --arg ssb-caps ./secret-ssb-caps.json

You can use the install-omnia command to install Omnia as a systemd service, update your /etc/omnia.conf and migrate a Scuttlbot secret.

install-omnia help

A one-liner for installing an Omnia feed as a systemd service:

nix run -f https://github.com/makerdao/oracles-v2/tarball/master \
  --arg ssb-caps ./secret-ssb-caps.json \
  -c install-omnia feed

It is also possible to set the whole Scuttlebot config by using --arg ssb-config ssb-config.json instead of ssb-caps. Make sure you set the caps property in your ssb-config.json instead.

More details about the Scuttlebot config.

Development

To build from inside this repo, clone and run:

nix-build --arg ssb-caps ./secret-ssb-caps.json

You can then run omnia from ./result/bin/omnia.

To get a development environment with all dependencies run:

nix-shell --arg ssb-caps ./secret-ssb-caps.json
cd omnia
./omnia.sh

Now you can start editing the omnia scripts and run them directly.

Update dependencies

To update NodeJS dependencies edit the nix/node-packages.json file and run:

nix-shell
updateNodePackages

oracles's People

Contributors

icetan avatar michaelelliot avatar zdumitru avatar

Watchers

James Cloos avatar  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.