Comments (17)
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.
@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.
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.
unfortunately the error has started again, even with the OAR line removed : (
from ethereum-bridge.
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.
Hi, have you found a solution to that?
from ethereum-bridge.
Just ran into this
from ethereum-bridge.
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.
kimyd do you have some example code you can share
from ethereum-bridge.
@kimyd Same error here! When making 3 queries from a single function.
from ethereum-bridge.
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.
@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.
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.
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.
@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.
@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.
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)
- HTTP query create request error
- Ethereum bridge stops writing into tingodb after sometime HOT 21
- What is the behaviour of --dev? HOT 1
- Remove unused dependencies HOT 1
- oraclize examples not firing first free query HOT 1
- Why the callback in my private ethereum chain don't work? HOT 3
- oraclize report "exceeds block gas limit" HOT 2
- Possibility to force query execution before specified delay HOT 2
- Cannot read property 'node' of undefined HOT 5
- Cannot debug callback transaction in truffle HOT 1
- Error: Key not found in database HOT 11
- Error: More than one instance of bitcore-lib found. HOT 3
- Oracle does not receive the queries HOT 10
- gas errors when using bridge with private geth network HOT 19
- Alternative Private Chains HOT 6
- I can't use Ethereum-Bridge HOT 1
- The bridge returns a response only one time
- Wrong information message in ethereum-bridge on ubuntu HOT 1
- pls how can i link this function in my smart contract to the function in my web page HOT 1
- ERROR http query create request error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum-bridge.