1

I followed the official documentation for Chainlink fulfilment using kovan network. I run the below code

pragma solidity 0.6.6; import "@chainlink/contracts/src/v0.6/Oracle.sol";

[ get from official document ,https://remix.ethereum.org/#url=https://docs.chain.link/samples/NodeOperators/Oracle.sol

for node chainlink node job

    type = "directrequest"
schemaVersion = 1
name = "Get > Uint256"
# Optional External Job ID: Automatically generated if unspecified
# externalJobID = "b1d42cd5-4a3a-4200-b1f7-25a68e48aad8"
contractAddress = "YOUR_ORACLE_CONTRACT_ADDRESS"
maxTaskDuration = "0s"
observationSource = """
    decode_log   [type=ethabidecodelog
                  abi="OracleRequest(bytes32 indexed specId, address requester, bytes32 requestId, uint256 payment, address callbackAddr, bytes4 callbackFunctionId, uint256 cancelExpiration, uint256 dataVersion, bytes data)"
                  data="$(jobRun.logData)"
                  topics="$(jobRun.logTopics)"]

    decode_cbor  [type=cborparse data="$(decode_log.data)"]
    fetch        [type=http method=GET url="$(decode_cbor.get)"]
    parse        [type=jsonparse path="$(decode_cbor.path)" data="$(fetch)"]
    multiply     [type=multiply input="$(parse)" times=100]
    encode_data  [type=ethabiencode abi="(uint256 value)" data="{ \\"value\\": $(multiply) }"]
    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_data)}"
                 ]
    submit_tx    [type=ethtx to="YOUR_ORACLE_CONTRACT_ADDRESS" data="$(encode_tx)"]

    decode_log -> decode_cbor -> fetch -> parse -> multiply -> encode_data -> encode_tx -> enter code heresubmit_tx

"""

for consumer, use below code https://remix.ethereum.org/#url=https://docs.chain.link/samples/APIRequests/ATestnetConsumer.sol

error code snippets: errors in chain link node job

  • Did you swap out `YOUR_ORACLE_CONTRACT_ADDRESS` for your oracle address? – Patrick Collins Oct 28 '21 at 13:33
  • hi @PatrickCollins have edited the contract address before posted please find the below for the original version. "0xbf12C4159c5d03Df77e87c15CAA3c2bf41fAB443" – Ebin Thomas Oct 28 '21 at 13:40
  • Can you also add what the smart contract looks like? – Patrick Collins Oct 28 '21 at 22:51
  • @PatrickCollins please find the Oracle.sol code below https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.6/Oracle.sol testconsumer code : https://remix.ethereum.org/#url=https://docs.chain.link/samples/APIRequests/ATestnetConsumer.sol&optimize=false&runs=200&evmVersion=null&version=soljson-v0.8.7+commit.e28d00a7.js – Ebin Thomas Nov 02 '21 at 08:41
  • Hmm... looks ok. What version of the chainlink node is this? And what are you passing as input parameter to the function you're calling? – Patrick Collins Nov 02 '21 at 15:39

0 Answers0