This directory contains the Allora Labs consumer contract in Solidity that can be deployed to any EVM chain. It also consists of some example scripts to verify the functions of the smart contract.
Run command
git clone https://github.com/sukanyaparashar/allora-consumer.git
cd allora-consumeryarn
npm install
forge build
source .envRename .env.example file in the root project folder to .env and add the credentials accordingly.
- Verify network data -
forge script ./script/VerifyDataExample.s.sol:VerifyNetworkInferenceDataExample --rpc-url $rpcUrl --broadcast --skip-simulation -vvvv- Retrieve the topic value -
forge script ./script/RetrieveTopicValue.s.sol:RetrieveTopicValue --rpc-url $rpcUrl --broadcast --skip-simulation -vvvv- Verify network data -
ts-node script/verifyDataExample.ts- Retrieve the topic value -
ts-node script/retrieveTopicValue.tsNOTE: The scripts are using the already deployed consumer contract on Neon EVM Devnet with address 0xB8D2EaB5961084a95B901131b55051425e614581
-
Get the API Key here
-
Query the already existing inference data from chain's API endpoint. For example -
curl -X 'GET' \
--url 'https://api.allora.network/v2/allora/consumer/<chainId>?allora_topic_id=<topicId>' \
-H 'accept: application/json' \
-H 'x-api-key: <apiKey>'- Replace the inference data fields in the script with the new data from the previous step.