Quick Start

Our data is accessible through the Chainlink decentralized oracle network. The table below gives the list of networks supported by our oracle and their corresponding details that you need to specify so as to get data from our oracle. You can visit the Chainlink documentation to learn more about working with their oracle network.

Shamba Oracle and Chain Ids

Network

ETH_CHAIN_ID

Mainnet Block Explorer for getting API key

Testnet Block Explorer for deployed contract

Avalanche Fuji

43113

https://snowtrace.io/myapikey

https://testnet.snowtrace.io/

Binance Testnet

97

https://bscscan.com/myapikey

https://testnet.bscscan.com/

Ethereum Goerli

5

https://etherscan.io/myapikey

https://goerli.etherscan.io/

Milkomeda-C1 Testnet

200101

https://explorer-devnet-cardano-evm.c1.milkomeda.com/api

https://explorer-devnet-cardano-evm.c1.milkomeda.com/

Moonbase Alpha

1287

https://moonscan.io/myapikey

https://moonbase.moonscan.io/

Optimism Goerli

420

https://optimistic.etherscan.io/myapikey

https://goerli-optimism.etherscan.io/

Polygon Mumbai

80001

https://polygonscan.com/myapikey

https://mumbai.polygonscan.com/

Requesting Data From The Oracle

Deploy your Oracle Facing Smart Contract and then fund the same with 1 test LINK corresponding to your deployed contract’s network, and then call the requestGeostatsData() or requestFireData() function with the required parameters as explained in this README.

NOTE: You can get the LINK addresses and their corresponding faucets from here.

Response Data for Geo-Statistics

Data returned is of type map having two corresponding fields as a string storing the value of cid and an integer storing the value of geostatistic result (which is getting the value from the API multiplied by 10**18. This multiplication is done to remove all decimals from the data being returned on-chain).

You can see the response by calling the getGeostatsData() and getLatestCid() functions.

Response Data for Fire-Analysis

Data returned is of type map having two corresponding fields as a string that is storing the cid and an array that is storing the values of fire detection in the sequence of property ids, like 1 (if the fire is detected) and 9 (if the fire is not detected). The reason behind having the values as 1 and 9 is because the by-default value in the solidity (smart contract) is 0, so if there’s no data in any index of the array, then it returns it as 0.

We’re getting the value of fire-detection from the API as true or false, so assigning a value of 1 if it returns true and 9 if it returns false.

You can see the response by calling the getFireData() and getLatestCid() functions.