GithubHelp home page GithubHelp logo

eriksonjaguiar / convector-oracle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from worldsibu/convector-oracle

0.0 1.0 0.0 374 KB

An example of the flow required to get oracles up and running with Hyperledger Fabric through Convector

License: Apache License 2.0

TypeScript 89.82% JavaScript 10.18%

convector-oracle's Introduction

Conv-Oracle

Conv-Oracle is an example on how to handle oracles within Hyperledger Fabric with Convector.

Pre requisites

  • First meet Hyperledger Fabric pre-requisites.
  • Configure a mock API in https://www.mockable.io.
    • Make sure it is of type POST and the path is bankapi.
    • Copy the whole url in the field path of mockable.io and add it in a .env file in ./packages/conv-oracle/src/.env with the content EXTERNAL_URL=<full-url>.

Start the project

npm install

# Start a blockchain network locally
npm run env:restart

# Install the smart contract
npm run cc:start

# Start the oracle daemon [ignore npx if you don't use it]
npx lerna run start --scope conv-oracle --stream

See it in action!

# If you don't have hurley go and get it! npm i -g @worldsibu/hurley
hurl invoke carinsurance carinsurance_create "1" "volk" "1199"

This will trigger the transaction in the blockchain - send an event to the oracle daemon - fetch the API - call the __callback() and finish the transaction with external data.

Want to see the logs of everything happening?

# Hook to the container running the smart contract
docker logs -f dev-peer0.org1.hurley.lab-carinsurance-2

How does it work?

Diagram

What do to next?

convector-oracle's People

Contributors

walmon avatar

Watchers

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