ZapProject
Search…
Creating Oracle
We created many tools to help creating Oracle as simple as possible. This section will walk you through creating your Oracle and endpoint through examples of each tool
This example uses zap-oracle-template that utilizes zapjs packages, for using zapjs packages to create oracle from scratch, check out section {link ZAPJS packages tutorial here}
Set up oracle dir
1
$ git clone https://github.com/zapproject/zap-oracle-template.git
2
$ cd zap-oracle-template
3
$ yarn
Copied!

Layout :

  1. 1.
    Config : data about your wallet , ethereum node and your provider's pubkey and title
  2. 2.
    Schema : Your oracle's endpoint list with their params and pre-defined query/response schema
  3. 3.
    Oracle : Template for Create/Manage flow
  4. 4.
    Responder : Stub callback function when receive query event and return result
If your address doesnt have oracle initiated, a new oracle and endpoint will be created when you run yarn start

RUNNING ORACLE

Change config.ts with your oracle's information and Implement respond method
1
yarn start
Copied!

Congrats, you have successfully created an oracle and start listening to query as well as providing responses to subscribers

Last modified 2yr ago
Copy link