Subscription-Oracle Template
Help data provider creating subscription Oracle's Endpoint
Last updated
Was this helpful?
Help data provider creating subscription Oracle's Endpoint
Last updated
Was this helpful?
Subscription oracle template serves as bootstrap tool for data provider to setup and run their service in minutes.
Purpose : to provide a subscription service based on Zap oracle platform to manage subscriptions and distribute information through authenticated websocket connections.
This workflow has been provided in the template , following information explains how things works within source code
ORACLE
Oracle is registered and created an endpoint with curve set for a subscription service (not to be queried)
Node/Yarn installed
Modify with your custom information such as Mnemonic and optional custom URL for parity node ( default to infura)
Method needs to be implemented to get data from database or other source and emit data to authenticated connections,
USER
This template also includes bootstrap for user to use their Ethereum address to authenticate and connect to receive data from this type of subscription Oracle's endpoint.
User approve -> bond -> subscribe to Oracle's endpoint
yarn
Create priv_config.ts
based on config.ts
template with oracle's information
In src/server.ts
modify method getData
to get custom data of your own. This data will be broadcasted to users
yarn server
In src/user.ts
modify signature, address and endpoint
yarn user