Giter Site home page Giter Site logo

Comments (17)

kimyd avatar kimyd commented on August 23, 2024 1

This is how I tested ..(I made my code be simple)

  function updateData() payable public onlyOwner {
    if(oraclize_getPrice("URL") > address(this).balance ){
      emit LogFailNewOracleQuery("Not sufficient oracle funds balance nor not approved time");
    } else {
      string memory url1 = "here is a url for GET post";
      string memory url2 = "here is another url for GET post";
      string memory url2 = "here is another url for GET post";
      bytes32 queryId;

      queryId = oraclize_query("URL", url1);      
      queryId = oraclize_query("URL", url2);      
      queryId = oraclize_query("URL", url3);      

    }
  }  

Every time, I call the function ,updateData, I am able to get correct resutl from url1, url2 query, but I cannot get from url3 query. I got error message like
ERROR callback tx error, contract myid: 0x6808ddb2331e29c8fe2112a839c0b49058aea9af9090723112a69b6c440c1bd9
I didn't try on testnet nor mainnet.

from ethereum-bridge.

D-Nice avatar D-Nice commented on August 23, 2024 1

@kimyd That general question is slightly OT for this issue, for further general inquiries I would forward you to our gitter channel: https://gitter.im/oraclize/ethereum-api

You'll normally get responses pretty quickly there, for European/Americas working times.

In regards to your question, that is true, only if every query is the same "URL" datasource, and just uses the default gas limit, and the queries use the same gas price. So if there's no custom gas price changes between queries, and they are the same datasource with same callback gas limit, that will work yes.

If you use multiple different datasources, then you will have to sum the getprice for them e.g. oraclize_getPrice("URL") + oraclize_getPrice("computation")

or if they have different callbacks gas limits:
oraclize_getPrice("URL") + oraclize_getPrice("computation", 250000)

and in the case of changing gas Price for different calls:

oraclize_setCustomGasPrice(10 gwei)
sum = oraclize_getPrice("URL")
oraclize_setCustomGasPrice(3 gwei)
sum += oraclize_getPrice("computation")

Note the above are meant to be examples hence not syntactically correct for solidity, but should still serve as useful cues.

from ethereum-bridge.

marcogiglio avatar marcogiglio commented on August 23, 2024

I will update the issue (and then close it) with the resolution found in the Gitter channel: the error was resolved by removing the OAR = OraclizeAddrResolverI(..), which with the last versions of the bridge is not necessary anymore.

from ethereum-bridge.

okwme avatar okwme commented on August 23, 2024

unfortunately the error has started again, even with the OAR line removed : (

from ethereum-bridge.

okwme avatar okwme commented on August 23, 2024

this time around the first attempt at triggering the __callback gives this warning:

[2017-10-13T16:34:21.828Z] WARN log with contract myid: 0x90663b48e2817a9fcd90a1b8746127fe861132029a588f971011cafcfeeb9924 was triggered, but it was already seen before, skipping event...

the next attempt gives the previous error

from ethereum-bridge.

DmitryPasenko avatar DmitryPasenko commented on August 23, 2024

Hi, have you found a solution to that?

from ethereum-bridge.

dpurhar27 avatar dpurhar27 commented on August 23, 2024

Just ran into this

from ethereum-bridge.

kimyd avatar kimyd commented on August 23, 2024

I have same issue when I trying to call oraclize_query 3 times in a function. It seems that I can only call oraclize_query 2 times inside one function. Or am I doing something wrong?

from ethereum-bridge.

D-Nice avatar D-Nice commented on August 23, 2024

kimyd do you have some example code you can share

from ethereum-bridge.

UIxUX avatar UIxUX commented on August 23, 2024

@kimyd Same error here! When making 3 queries from a single function.

from ethereum-bridge.

D-Nice avatar D-Nice commented on August 23, 2024

Just tested, and 3 queries in single function work just fine. I do see some general errors in @kimyd posted code. Also, ensure you are using solc v0.4.20 or earlier, some of the new solc appears to break compatibility.


contract KrakenPriceTicker is usingOraclize {

    string public r1;
    string public r2;
    string public r3;

    event newOraclizeQuery(string description);
    event newKrakenPriceTicker(string price);

    bytes32 public x1;
    bytes32 public x2;
    bytes32 public x3;

    function KrakenPriceTicker() {
        oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
        //update();
    }

    function __callback(bytes32 myid, string result, bytes proof) {
        if (msg.sender != oraclize_cbAddress()) throw;
        if (myid == x1) r1 = result;
        if (myid == x2) r2 = result;
        if (myid == x3) r3 = result;
        newKrakenPriceTicker(result);
        //update();
    }

    function update() payable {
        if (oraclize_getPrice("URL") > this.balance) {
            newOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
        } else {
            newOraclizeQuery("Oraclize query was sent, standing by for the answer..");
            x1 = oraclize_query(0, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
            x2 = oraclize_query(0, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHUSD).result.XETHZUSD.c.0");
            x3 = oraclize_query(0, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=XBTUSD).result.XXBTZUSD.c.0");
        }
    }

}

from ethereum-bridge.

kimyd avatar kimyd commented on August 23, 2024

@D-Nice I just simplify my original code, it is almost same as the code you just posted. But I didn't put 0 parameter in oraclize_query, do I have to? and I am using truffle v4.1.5 , it seems it includes compiler v.0.4.21, not 0.4.20. I would be very helpful if you can check on v.0.4.21.
Thank you.

from ethereum-bridge.

D-Nice avatar D-Nice commented on August 23, 2024

You will want to revert to an earlier truffle for now, that uses solc 0.4.19 or earlier. I believe Truffle v 4.13 and earlier uses appropriate solc.

EDIT: @kimyd In regards to the 0 parameter for timestamp, it should not be necessary for you. I just did a quick copy paste of the KrakenPriceTicker example, and then changed the 60s delay to 0s. 0 is default, and hence can be omitted.

from ethereum-bridge.

thomasvds avatar thomasvds commented on August 23, 2024

Had the same issue with 4.20. For now I flush all files in the ethereum-bridge/database/tingodb folder as per this SO post and it works fine.

from ethereum-bridge.

D-Nice avatar D-Nice commented on August 23, 2024

@thomasvds If that SO post worked, then a likely workaround for you is adding the --dev flag upon start, which is recommended to be used when doing truffle tests.

from ethereum-bridge.

kimyd avatar kimyd commented on August 23, 2024

@D-Nice I have related question, oraclize_getPrice("URL") is an expected needed gas for single query? then Do I have to multiply it by 3 if I want to execute 3 queries? Because I do not want to revert in the middle of queries.

from ethereum-bridge.

1165695282 avatar 1165695282 commented on August 23, 2024

I have the same question. And i didn't have 3 queries but only 1, and i was failed with this error.Before callback tx error i had HTTP query error too.https://github.com/oraclize/ethereum-bridge/issues/48

from ethereum-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.