From 9f50849f049f4d05ca4965cdf2df2dcc1c17733e Mon Sep 17 00:00:00 2001 From: br4e Date: Sat, 29 Jun 2024 12:27:57 -0700 Subject: [PATCH 1/2] Update existing-consumers.mdx --- pages/devs/existing-consumers.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/devs/existing-consumers.mdx b/pages/devs/existing-consumers.mdx index 7f55c61..cc0e9a2 100644 --- a/pages/devs/existing-consumers.mdx +++ b/pages/devs/existing-consumers.mdx @@ -5,7 +5,7 @@ ## Consumer Contract Deployments You can find the deployed consumer contracts by looking at the latest saved deployments in the repository: -- [Sepolia](https://sepolia.etherscan.io/address/0x08f305A3449F51BFd79D7582A1630304664B1474#code) +- [Sepolia](https://sepolia.etherscan.io/address/0x8E45fbef38DaC54e32AfB27AC8cBab30E6818ce6#code) - [Arbitrum One](https://arbiscan.io/address/0x6032f0862A2c36D0390c348EeCc2ACcDccDa785a#code) ## Deploying to additional chains From 0349b4700079fde34d1959e582cf1aceb18993b5 Mon Sep 17 00:00:00 2001 From: br4e Date: Sat, 29 Jun 2024 12:27:59 -0700 Subject: [PATCH 2/2] Update walkthrough-use-topic-inference.mdx --- .../devs/walkthrough-use-topic-inference.mdx | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/pages/devs/walkthrough-use-topic-inference.mdx b/pages/devs/walkthrough-use-topic-inference.mdx index f59845e..b1b3aff 100644 --- a/pages/devs/walkthrough-use-topic-inference.mdx +++ b/pages/devs/walkthrough-use-topic-inference.mdx @@ -33,7 +33,32 @@ Follow these instructions to bring the most recent inference data on-chain for a ## Step by Step Guide: 1. Create an Upshot API key by [creating an account](https://developer.upshot.xyz/signup). -2. [Call the Consumer Inference API](./offchain-query-existing-workers#yuga-index-levels-id2) using the `topicId` found in the [deployed topics list](./existing-topics) and the correct chainId. For example, if you use sepolia, you would provide `ethereum-11155111`. +2. Call the Consumer Inference API using the `topicId` found in the [deployed topics list](./existing-topics) and the correct chainId. For example, if you use sepolia, you would provide `ethereum-11155111`. + +```shell +curl -X 'GET' --url 'https://api.upshot.xyz/v2/allora/consumer/?allora_topic_id=' -H 'accept: application/json' -H 'x-api-key: ' +``` + +Here is an example response: +```json +{ + "request_id": "409de397-99f8-4911-91ed-74e6fe748115", + "status": true, + "data": { + "signature": "0x8165fff89ca07fadff3f4e27b200bd3eae2132055aa8f0a224832446505c0662033b3038c9694000af60d4e9fbf8504cd9729b9841db286f45070a9c92f2531d1c", + "inference_data": { + "network_inference": "61022689135670660000000", + "confidence_interval_percentiles": [], + "confidence_interval_values": [], + "topic_id": "11", + "timestamp": 1719688595, + "extra_data": "0x" + } + } +} +``` + + 3. Construct a call to the Allora Consumer contract on the chain of your choice (options listed under [deployments](./existing-consumers)) using the returned `signature` and `network-inference` as follows: ## Creating the Transaction: @@ -41,7 +66,7 @@ Follow these instructions to bring the most recent inference data on-chain for a Note you be doing something more like `callProtocolFunctionWithAlloraTopicInference` in the example above, so you would want to construct your call to that contract in a similar way to the following: ```typescript -await alloraConsumer.verifyData({ +await alloraConsumer.verifyNetworkInference({ signature: signature, networkInference: { networkInference: networkInference,