undeclared identifier
copied contract from link docs https://docs.chain.link/docs/jobs/types/direct-request/
import "https://github.com/smartcontractkit/chainlink/contracts/src/v0.6/ChainlinkClient.sol";
contract MyClient is ChainlinkClient {
function doRequest(uint256 _payment) public {
Chainlink.Request memory req = buildChainlinkRequest(specId, address(this), this.fulfill.selector);
req.add("fetchURL", "https://datafeed.xyz/eth");
req.add("jsonPath", "data,result");
sendChainlinkRequest(req, _payment);
}
function fulfill(bytes32 requestID, uint256 answer) public {
// ...
}
}
trying to make a simple http get request to my API/URL https://ljiigsoedk.execute-api.ca-central-1.amazonaws.com/default/wildfire..
but without modifying any code i get undeclared identifier Chainlink.Request memory req = buildChainlinkRequest(specId, address(this), this.fulfill.selector); with >>specID<< being pointed at by angry remix compiler
my nodes job is
type = "directrequest"
schemaVersion = 1
name = "example eth request event spec"
contractAddress = "0xCcbB32b820799DDCadCFeEE472B9804a1397005E"
maxTaskDuration = "0s"
observationSource = """
ds [type="http" method=GET url="https://ljiigsoedk.execute-api.ca-central-1.amazonaws.com/default/wildfire"]
ds_parse [type="jsonparse" path="FIRE_NUMBE"]
ds -> ds_parse
"""
externalJobID = "37ab8f92-090e-4d23-9b08-96495f96899f"
haven't made it that far yet, im guessing i am following the right steps for making this happen.. if not please let me know what i am doing wrong..
or is this blob what i should use for the job -.-
// First, we parse the request log and the CBOR payload inside of it
decode_log [type="ethabidecodelog"
data="$(jobRun.logData)"
topics="$(jobRun.logTopics)"
abi="SomeContractEvent(bytes32 requestID, bytes cborPayload)"]
decode_cbor [type="cborparse"
data="$(decode_log.cborPayload)"]
// Then, we use the decoded request parameters to make an HTTP fetch
fetch [type="http" method=GET url="$(decode_cbor.fetchURL)"]
parse [type="jsonparse" path="$(decode_cbor.jsonPath)" data="$(fetch)"]
// Finally, we send a response on-chain.
// Note that single-word responses automatically populate
// the requestId.
encode_response [type="ethabiencode"
abi="(uint256 data)"
data="{\\"data\\": $(parse) }"]
encode_tx [type="ethabiencode"
abi="fulfillOracleRequest(bytes32 requestId, uint256 payment, address callbackAddress, bytes4 callbackFunctionId, uint256 expiration, bytes32 data)"
data="{\\"requestId\\": $(decode_log.requestId), \\"payment\\": $(decode_log.payment), \\"callbackAddress\\": $(decode_log.callbackAddr), \\"callbackFunctionId\\": $(decode_log.callbackFunctionId), \\"expiration\\": $(decode_log.cancelExpiration), \\"data\\": $(encode_mwr)}"
]
submit_tx [type="ethtx" to="0x613a38AC1659769640aaE063C651F48E0250454C" data="$(encode_tx)"]
decode_log -> decode_cbor -> fetch -> parse -> encode_response -> encode_tx -> submit_tx