Oracle

Oracle module allows you to manage the feed on IRIS Hub

Available Commands

NameDescription
createCreate a new feed, the feed will be in "paused" state
startStart a feed in "paused" state
pausePause a feed in "running" state
editModify the feed information and update service invocation parameters by feed creator
feedQuery the feed definition
feedsQuery a group of feed definition
valueQuery the feed result

iris tx oracle create

This command is used to create a new feed, the feed will be in "paused" state.

iris tx oracle create [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--feed-namestringYesThe unique identifier of the feed.
--descriptionstringThe description of the feed.
--latest-historyuint64YesThe maximum Number of the latest history values to be saved for the Feed, range [1, 100].
--service-namestringYesThe name of the service to be invoked by the feed.
--inputstringYesThe input argument (JSON) used to invoke the service.
--providers[]stringYesThe list of service provider addresses.
--service-fee-capstringYesOnly providers charging a fee lower than the cap will be invoked.
--timeoutint64The maximum number of blocks to wait for a response since a request is sent, beyond which the request will be ignored.
--frequencyuint64The invocation frequency of sending repeated requests.
--thresholduint161The minimum number of responses needed for aggregation, range [1, Length(providers)].
--aggregate-funcstringYesThe name of predefined function for processing the service responses, e.g. avg, max, min etc.
--value-json-pathstringYesThe field name or path of Service response result used to retrieve the value property of aggregate-func from response results.

Create a new feed

iris tx oracle create \
    --feed-name="test-feed" \
    --latest-history=10 \
    --service-name="test-service" \
    --input=<request-data> \
    --providers=<provide1_address>,<provider2_address> \
    --service-fee-cap=1iris \
    --timeout=2 \
    --frequency=10 \
    --total=10 \
    --threshold=1 \
    --aggregate-func="avg" \
    --value-json-path="high" \
    --chain-id=irishub \
    --from=node0 \
    --fees=0.3iris

iris tx oracle start

This command is used to start a feed in "paused" state

iris tx oracle start [feed-name] [flags]

Start a "paused" feed

iris tx oracle start test-feed --chain-id=irishub --from=node0 --fees=0.3iris

iris tx oracle pause

This command is used to pause a feed in "running" state

iris tx oracle pause [feed-name] [flags]

Pause a "running" feed

iris tx oracle pause test-feed --chain-id=irishub --from=node0 --fees=0.3iris

iris tx oracle edit

This command is used to edit an existing feed on IRIS Hub.

iris tx oracle edit [feed-name] [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--feed-namestringYesThe unique identifier of the feed.
--descriptionstringThe description of the feed.
--latest-historyuint64YesThe maximum Number of the latest history values to be saved for the Feed, range [1, 100].
--providers[]stringYesThe list of service provider addresses.
--service-fee-capstringYesOnly providers charging a fee lower than the cap will be invoked.
--timeoutint64The maximum number of blocks to wait for a response since a request is sent, beyond which the request will be ignored.
--frequencyuint64The invocation frequency of sending repeated requests.
--thresholduint161The minimum number of responses needed for aggregation, range [1, Length(providers)].

Edit an existed feed

iris tx oracle edit test-feed --chain-id=irishub --from=node0 --fees=0.3iris --latest-history=5

iris query oracle feed

This command is used to query a feed

iris query oracle feed [feed-name] [flags]

Query an existed feed

iris query oracle feed test-feed

iris query oracle feeds

This command is used to query a group of feed

iris query oracle feeds [flags]

Flags:

Name, shorthandTypeRequiredDefaultDescription
--statestringthe state of the feed, e.g. paused, running.

Query a group of feed

iris query oracle feeds --state=running

iris query oracle value

This command is used to query the result of a specified feed

iris query oracle value test-feed