0

I am following the "Chainlink Hackathon | Building and using External Adapters" video tutorial (Oct 2021) and have done the following:

  • a local docker node running
  • successfully run ATestnetConsumer example(My oracle address, node address works properly),as shown below:node operator
  • a localhost api(it is ok and test by webhook mod and I could visit it in my docker node),as shown in the picture:docker call host api

below are my docker node configureations:

ROOT=/chainlink
LOG_LEVEL=debug
ETH_CHAIN_ID=42
MIN_OUTGOING_CONFIRMATIONS=2
LINK_CONTRACT_ADDRESS=0xa36085F69e2889c224210F603D836748e7dC0088
CHAINLINK_TLS_PORT=0
SECURE_COOKIES=false
GAS_UPDATER_ENABLED=true
ALLOW_ORIGINS=*
ETH_URL=wss://eth-kovan.alchemyapi.io/v2/xxx
DATABASE_URL=postgresql://postgres:password@host.docker.internal:5432/chainlink?sslmode=disable
DATABASE_TIMEOUT=0
FEATURE_WEBHOOK_V2=true

below are my consumer contract:

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

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

contract APIConsumer is ChainlinkClient {
    using Chainlink for Chainlink.Request;
  
    uint256 public games;
    
    address private oracle;
    bytes32 private jobId;
    uint256 private fee;
    
    constructor() {
        setPublicChainlinkToken();
        oracle = 0xc44B409E5aB50328b53F24593AB93Df3d75d57F1;
        jobId = "43e82218600d444c8d7557448760a7b7";
        fee = 0.1 * 10 ** 18; // (Varies by network and job)
    }
    
    function requestGamesData() public returns (bytes32 requestId) 
    {
        Chainlink.Request memory request = buildChainlinkRequest(jobId, address(this), this.fulfill.selector);  
        request.add("playerId", "90026231");
        return sendChainlinkRequestTo(oracle, request, fee);
    }
    
    function fulfill(bytes32 _requestId, uint256 _games) public recordChainlinkFulfillment(_requestId)
    {
        games = _games;
    }
}

But when I call requestGamesData function in my consumer contract, contract is successfully called but no runs come into my jobs, There seems to something dont mentioned in the video https://www.youtube.com/watch?v=DJ-EYU-7f0U, could anyone help me?

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.