Giter Club home page Giter Club logo

ttp-oracle's Introduction

Solana TTP Oracle

Motivation/Roadmap

Solana Hackathon Project Description

Mithraic Oracle is the basis of a “built for Solana” oracle. The project is starting out as a simple Trusted Third Party (TTP) oracle. In the base form of the protocol, a Solana program developer can easily make various HTTP(S) requests and receive responses from a trusted server as a callback to their program. The TTP architecture was chosen for its simplicity due to the short time span of the hackathon. While the protocol is simple in its infancy, it’s built in such a way to be the foundation of a more ambitious decentralized oracle system built specifically for the Solana ecosystem. We’re excited about this project because it unlocks more applications on top of Solana such as a CLOB prediction market built on Serum.

Getting Started

Install Solana 1.4.4 tool suite

see https://docs.solana.com/cli/install-solana-cli-tools

sh -c "$(curl -sSfL https://release.solana.com/v1.4.4/install)"

Install deps

yarn install

Build all Solana programs

yarn build

Run local net

yarn localnet:up

Deploy programs

yarn deploy:local

Run Oracle server in dev environment

This will export all necessary environment variables, build, and run the oracle server.

yarn setup-server

Send Sample requests using the Example Client Program

ORACLE_ID will be generated during the server setup. Copy/paste it as the first argument

--loop (or any second argument) can be used to send requests at a .5s interval

yarn send-test [ORACLE_ID] [--loop]

Listen to program logs to see incoming price data

docker logs solana-localnet -f | grep -E "Program log"

Testing

Run JS integration tests

yarn test

Run rust unit tests

yarn test:programs [PROGRAM_NAME]

ttp-oracle's People

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.