Overview of the information flow during an oracle request.
The system of getting data on-chain requires several components to work together to achieve the result. Hence it is reasonable to break it down to pieces.
The information flow during an oracle request
The flow of information starts at the Requester smart contract where the user initiates the on-chain credit request. There is a
requestCredScore()function that will be called to initiate this request.
Chainlink Oracle has an event listener that will be triggered once the
requestCredScore()function has been called and it will start to process the request.
It will contact the Alchemy API to get the wallet address of the request initatior and pass it as a parameter to our Cred API to get the Cred score for it.
After the Cred score is returned to the Chainlink Oracle, it will then parse it, encode it and send it in an on-chain transaction to the Requester smart contract where it is stored in the
requestCredScore()variable. The score is then accessible to everything on-chain from that variable.