Skip to main content
Bumped by Community user
Bumped by Community user
consumer error output added
Source Link
aug2uag
  • 85
  • 1
  • 8

ATestnetConsumer method RequestEthereumChange called with "0x2559c36Aee1dC9231d679D9b456265a46049dBfD", "5bdce20fe3ef4aa9b5e289e1b523ca7d" results in error:

status  false Transaction mined but execution failed
transaction hash    0xa5df1f36059f45b7b8f400166d0a2cd12654a4987e7129a0551e9fcb64b5fb9e
from    0x4de15D18F9dF69B52E249D5033458ecf4acc547d
to  ATestnetConsumer.requestEthereumChange(address,string) 0xE4492b62b2a1D27Fb694eD6AcAC05C4e5ee6E63A
gas 3000000 gas
transaction cost    2954345 gas 
hash    0xa5df1f36059f45b7b8f400166d0a2cd12654a4987e7129a0551e9fcb64b5fb9e
input   0x619...13764
decoded input   {
    "address _oracle": "0x2559c36Aee1dC9231d679D9b456265a46049dBfD",
    "string _jobId": "5bdce20fe3ef4aa9b5e289e1b523ca7d"
}
decoded output   - 
logs    []
val 0 wei

ATestnetConsumer method RequestEthereumChange called with "0x2559c36Aee1dC9231d679D9b456265a46049dBfD", "5bdce20fe3ef4aa9b5e289e1b523ca7d" results in error

ATestnetConsumer method RequestEthereumChange called with "0x2559c36Aee1dC9231d679D9b456265a46049dBfD", "5bdce20fe3ef4aa9b5e289e1b523ca7d" results in error:

status  false Transaction mined but execution failed
transaction hash    0xa5df1f36059f45b7b8f400166d0a2cd12654a4987e7129a0551e9fcb64b5fb9e
from    0x4de15D18F9dF69B52E249D5033458ecf4acc547d
to  ATestnetConsumer.requestEthereumChange(address,string) 0xE4492b62b2a1D27Fb694eD6AcAC05C4e5ee6E63A
gas 3000000 gas
transaction cost    2954345 gas 
hash    0xa5df1f36059f45b7b8f400166d0a2cd12654a4987e7129a0551e9fcb64b5fb9e
input   0x619...13764
decoded input   {
    "address _oracle": "0x2559c36Aee1dC9231d679D9b456265a46049dBfD",
    "string _jobId": "5bdce20fe3ef4aa9b5e289e1b523ca7d"
}
decoded output   - 
logs    []
val 0 wei

smart contract implementation details added
Source Link
aug2uag
  • 85
  • 1
  • 8

  1. Oracle.sol smart contract deployed at address 0x2559c36Aee1dC9231d679D9b456265a46049dBfD
  2. node wallet at address 0x58320a1e8377b6143614944b5418E71FEE35D7a8
  3. job id 5bdce20f-e3ef-4aa9-b5e2-89e1b523ca7d

sample contracts:

ATestnetConsumer method RequestEthereumChange called with "0x2559c36Aee1dC9231d679D9b456265a46049dBfD", "5bdce20fe3ef4aa9b5e289e1b523ca7d" results in error

APIConsumer method requestVolumeData results in error with following implementation:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";

/**
 * THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.
 * PLEASE DO NOT USE THIS CODE IN PRODUCTION.
 */
contract APIConsumer is ChainlinkClient {
    using Chainlink for Chainlink.Request;
  
    uint256 public volume;
    
    address private oracle;
    bytes32 private jobId;
    uint256 private fee;
    
    /**
     * Network: Kovan
     * Oracle: 0xc57B33452b4F7BB189bB5AfaE9cc4aBa1f7a4FD8 (Chainlink Devrel   
     * Node)
     * Job ID: d5270d1c311941d0b08bead21fea7747
     * Fee: 0.1 LINK
     */
    constructor() {
        setPublicChainlinkToken();
        oracle = 0x2559c36Aee1dC9231d679D9b456265a46049dBfD;
        jobId = "5bdce20fe3ef4aa9b5e289e1b523ca7d";
        fee = 0.1 * 10 ** 18; // (Varies by network and job)
    }
    
    /**
     * Create a Chainlink request to retrieve API response, find the target
     * data, then multiply by 1000000000000000000 (to remove decimal places from data).
     */
    function requestVolumeData() public returns (bytes32 requestId) 
    {
        Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
        
        // Set the URL to perform the GET request on
        request.add("get", "https://min-api.cryptocompare.com/data/pricemultifull?fsyms=ETH&tsyms=USD");
        
        // Set the path to find the desired data in the API response, where the response format is:
        // {"RAW":
        //   {"ETH":
        //    {"USD":
        //     {
        //      "VOLUME24HOUR": xxx.xxx,
        //     }
        //    }
        //   }
        //  }
        request.add("path", "RAW.ETH.USD.VOLUME24HOUR");
        
        // Multiply the result by 1000000000000000000 to remove decimals
        int timesAmount = 10**18;
        request.addInt("times", timesAmount);
        
        // Sends the request
        return sendChainlinkRequestTo(oracle, request, fee);
    }
    
    /**
     * Receive the response in the form of uint256
     */ 
    function fulfill(bytes32 _requestId, uint256 _volume) public recordChainlinkFulfillment(_requestId)
    {
        volume = _volume;
    }

    // function withdrawLink() external {} - Implement a withdraw function to avoid locking your LINK in the contract
}

  1. Oracle.sol smart contract deployed at address 0x2559c36Aee1dC9231d679D9b456265a46049dBfD
  2. node wallet at address 0x58320a1e8377b6143614944b5418E71FEE35D7a8
  3. job id 5bdce20f-e3ef-4aa9-b5e2-89e1b523ca7d

sample contracts:

ATestnetConsumer method RequestEthereumChange called with "0x2559c36Aee1dC9231d679D9b456265a46049dBfD", "5bdce20fe3ef4aa9b5e289e1b523ca7d" results in error

APIConsumer method requestVolumeData results in error with following implementation:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

import "@chainlink/contracts/src/v0.8/ChainlinkClient.sol";

/**
 * THIS IS AN EXAMPLE CONTRACT WHICH USES HARDCODED VALUES FOR CLARITY.
 * PLEASE DO NOT USE THIS CODE IN PRODUCTION.
 */
contract APIConsumer is ChainlinkClient {
    using Chainlink for Chainlink.Request;
  
    uint256 public volume;
    
    address private oracle;
    bytes32 private jobId;
    uint256 private fee;
    
    /**
     * Network: Kovan
     * Oracle: 0xc57B33452b4F7BB189bB5AfaE9cc4aBa1f7a4FD8 (Chainlink Devrel   
     * Node)
     * Job ID: d5270d1c311941d0b08bead21fea7747
     * Fee: 0.1 LINK
     */
    constructor() {
        setPublicChainlinkToken();
        oracle = 0x2559c36Aee1dC9231d679D9b456265a46049dBfD;
        jobId = "5bdce20fe3ef4aa9b5e289e1b523ca7d";
        fee = 0.1 * 10 ** 18; // (Varies by network and job)
    }
    
    /**
     * Create a Chainlink request to retrieve API response, find the target
     * data, then multiply by 1000000000000000000 (to remove decimal places from data).
     */
    function requestVolumeData() public returns (bytes32 requestId) 
    {
        Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);
        
        // Set the URL to perform the GET request on
        request.add("get", "https://min-api.cryptocompare.com/data/pricemultifull?fsyms=ETH&tsyms=USD");
        
        // Set the path to find the desired data in the API response, where the response format is:
        // {"RAW":
        //   {"ETH":
        //    {"USD":
        //     {
        //      "VOLUME24HOUR": xxx.xxx,
        //     }
        //    }
        //   }
        //  }
        request.add("path", "RAW.ETH.USD.VOLUME24HOUR");
        
        // Multiply the result by 1000000000000000000 to remove decimals
        int timesAmount = 10**18;
        request.addInt("times", timesAmount);
        
        // Sends the request
        return sendChainlinkRequestTo(oracle, request, fee);
    }
    
    /**
     * Receive the response in the form of uint256
     */ 
    function fulfill(bytes32 _requestId, uint256 _volume) public recordChainlinkFulfillment(_requestId)
    {
        volume = _volume;
    }

    // function withdrawLink() external {} - Implement a withdraw function to avoid locking your LINK in the contract
}
Source Link
aug2uag
  • 85
  • 1
  • 8

Troubles interacting with Chainlink node on Kovan

I've been following instructions on running a local Chainlink node on Kovan. My environment is configured to Kovan through websockets via Infura and the node is both running and successfully accepts ETH and LINK transfers over Kovan: Chainlink node with ETH and LINK transfers over Kovan

The sample Oracle.sol contract was deployed on Kovan 0xa36085F69e2889c224210F603D836748e7dC0088 and the address of the node set with true value under setFulfillmentPermission: Oracle.sol deployment on Kovan

I created a sample job with toml that creates successfully and generates a public job id: job with public id

The job id above is "5bdce20f-e3ef-4aa9-b5e2-89e1b523ca7d" and I set this in my contract as "5bdce20fe3ef4aa9b5e289e1b523ca7d". No matter the implementation, I have not been able to identify any runs on my console and they fail each time. This includes two variations of sample contracts I have been unsuccessful to transmit the run: sample contract fail

Besides reverting to an earlier version to deploy a node that transacts jobs under v1, I don't know how to go about debugging and getting the local node to acknowledge a run. Looking for help. Please let me know if there's any specific info I can provide to help.