So, I was trying to follow the ChainLink's official docs for getting a large response as shown on their website however I deployed, funded with link, called the requestBytes() function , waited some minutes and the data field is still empty. There have been a lot of people complaining about the same issue but the answer for them was simply to follow the latest docs. Which I am. Is there still some step that I am missing ?
This is the contract code:
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/ChainlinkClient.sol";
// import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";
contract GenericLargeResponse is ChainlinkClient {
using Chainlink for Chainlink.Request;
bytes public data;
string public image_url;
constructor() {
setChainlinkToken(0xa36085F69e2889c224210F603D836748e7dC0088);
setChainlinkOracle(0x25C7ac1900de67605c0A1812109E960068B1C3d6);
}
function requestBytes() public
{
bytes32 specId = "b3b68ecd35464833a16613742640ae89";
uint256 payment = 100000000000000000;
Chainlink.Request memory req = buildChainlinkRequest(specId, address(this), this.fulfillBytes.selector);
req.add("get","https://ipfs.io/ipfs/QmZgsvrA1o1C8BGCrx6mHTqR1Ui1XqbCrtbMVrRLHtuPVD?filename=big-api-response.json");
req.add("path", "image");
sendOperatorRequest(req, payment);
}
event RequestFulfilled(
bytes32 indexed requestId,
bytes indexed data
);
function fulfillBytes(
bytes32 requestId,
bytes memory bytesData
)
public
recordChainlinkFulfillment(requestId)
{
emit RequestFulfilled(requestId, bytesData);
data = bytesData;
image_url = string(data);
}
}
Deployed on Kovan:https://kovan.etherscan.io/address/0x3B5fFfD84a0A36d3a66bCcF6de98B5dbaD102888.
The JSON file seems to be OK as well: https://ipfs.io/ipfs/QmZgsvrA1o1C8BGCrx6mHTqR1Ui1XqbCrtbMVrRLHtuPVD?filename=big-api-response.json
Best Answer
There was an issue with the large response job on the Kovan hosted node. Please try again with the following values: