Create an Oracle
Last updated
Last updated
To set up an oracle:
Go to the network details page by clicking on the network name from the network tab.
On the left menu, select the 'Oracles' option.
Click on Create Oracle to begin the process of creating a workflow in three simple steps.
Add the name of the Oracle.
Select the channel where the Oracle should be deployed.
Select the organisation that will own the Oracle.
Select the type of URL and enter the source URL.
Select the type of param between Query, Path, Body, and None.
Select authentication type for the source URL between basic, custom or none
If authentication type is basic, enter the username and password
If authentication type is custom, enter custom key value pair(s)
If authentication type is none, no authentication is required to use the source URL
Enter custom header (optional). Click on "Add New" to add key-value pairs as custom headers.
Adding a scheduler is an optional step. You can add a scheduler at a later stage. An oracle can have multiple schedulers.
Enter the cron expression
minutes-
Allowed value: 0-59
Allowed special characters: , - * /
Example:
10 for 10th minute of an hour,
Ranges: 1-10 for first 10 minutes of an hour,
List: 1-10, 30 for first 10 minutes and 30th minute of an hour,
Steps values: 0-59/2 for every 30 minutes
Unrestricted: * for all possible values
hours-
Allowed value: 0-23
Allowed special characters: , - / *
days (month)-
Allowed value: 0-31
Allowed special characters: , - / *
months-
Allowed value: 0-11
Allowed special characters: , - / *
day(week)-
Allowed value: 0-7
Allowed special characters: , - / *
Enter the oracle scheduler name
Based on the param type of the oracle, user should define the arguments
if the param type is 'path' : provide one key-value
if the param type is query: provide multiple key-values
if the param type is body: use an input box to enter JSON, XML, etc.
if the param type is none: no arguments needed
Select from the list of deployed apps of the channel where the oracle is defined. The selected app will consume the data. If the selected app is a custom chaincode, define the callback function name.
Review entered details and deploy the oracle.