I will try to ask a question based on the use case.
Assume I only use 1 oracle (ignoring the fact decentralization of chainlink oracles) to execute GET call to an API
which returns bool information (GET > bool) for 0.01 LINK.
This is happening with the following line of code. See the documentation for more information.
function checkProof(string memory JobLocation, int customerId) public {
Chainlink.Request memory req = buildChainlinkRequest(stringToBytes32(JOBID), address(this), this.fulfill.selector);
req.add("get",JobLocation);
req.add("path", "proof");
bytes32 requestId = sendChainlinkRequestTo(ORACLE_ADDRESS, req, ORACLE_PAYMENT);
requestMapping[requestId] = customers[customerId].id;
}
Which calls the following function once the API GET result is ready.
function fulfill(bytes32 _requestId, bool _isProofCorrect) public recordChainlinkFulfillment(_requestId){
int value = requestMapping[_requestId];
customers[value]._proof = _isProofCorrect;
}
When as an EOA I trigger this function checkProof
, this triggers chainlink oracle (Please stop if I am wrong).
Since calling the checkProof
function is state changing function (non-pure), it will need to be mined to include in the next block. Each miner executed the transaction (which is calling the API).
Does every miner pay the LINK for the oracle service? or only the miner node (winner miner) pays the LINK to the oracle?
Once the block mined, all the transactions of the block need to be executed.
Does each validator need to pay LINK to trigger the API GET call again to match the result?