Pull (or also known as Request Based Oracle) oracle model enables the creation of requests for asset prices on a source blockchain. These requests are sent through a mailbox on the current chain and ultimately delivered to the DIA chain, which retrieves and delivers the required price data.
OracleRequestRecipient
contract , where the price data is fetched from the Oracle Metadata Contract.
Spectra Interoperability
repository to your local machine and switching to the deploy
branch:
cd contracts
folder, and export your wallet’s private key in your terminal as follows:
sendMessage.mjs
script will trigger a request
transaction to fetch the latest price of ETH/USD from DIA lasernet. To run the script:
--network
flag (e.g. --network sepolia
).
Once the price update takes place on the destination chain, which you can track from the hyperlane explorer, you can check the txn logs for the ReceivedMessage
event on the pull oracle contract or call the updates
function.