updateOracle
The updateOracle
method serves to refresh an existing oracle with the latest data fetched from the linked API. This ensures that the oracle maintains up-to-date information, enhancing its reliability and usefulness for downstream applications.
Usage
As an example, we will utilize the CoinGecko public API oracle, which provides the Ethereum price in USD: CoinGecko Ethereum API.
Return value example
These are the possible events iExec may send to the subscriber:
message | sent | additional entries |
---|---|---|
ENSURE_PARAMS | once | |
ENSURE_PARAMS_SUCCESS | once | paramSet: Object cid: String |
FETCH_APP_ORDER | once | |
FETCH_APP_ORDER_SUCCESS | once | order: Object |
FETCH_DATASET_ORDER | once if using dataset | |
FETCH_DATASET_ORDER_SUCCESS | once if using dataset | order: Object |
FETCH_WORKERPOOL_ORDER | once | |
FETCH_WORKERPOOL_ORDER_SUCCESS | once | order: Object |
REQUEST_ORDER_SIGNATURE_SIGN_REQUEST | once | order: Object |
REQUEST_ORDER_SIGNATURE_SUCCESS | once | order: Object |
MATCH_ORDERS_SIGN_TX_REQUEST | once | apporder: Object datasetorder: Object workerpoolorder: Object requestorder: Object |
MATCH_ORDERS_SUCCESS | once | dealid: String txHash: String |
TASK_UPDATED | once per task update | dealid: String taskid: String status: 'UNSET' | 'ACTIVE' | 'REVEALING' | 'COMPLETED' | 'TIMEOUT' | 'FAILED' |
TASK_COMPLETED | once | dealid: String taskid: String status: String |
Parameters
cid
Content ID of the Oracle that needs to be updated.
targetBlockchains (optional)
Array of target blockchain IDs where the oracle is deployed. 137 for polygon, 134 for iExec.
Last updated