Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 12 02:08
    emilianobonassi removed as member
  • Nov 12 02:08
    emilianobonassi added as member
  • Sep 12 09:12
    riccardopersiani unassigned #88
  • Jul 23 21:52

    D-Nice on master

    chore(ci): improve pipeline Merge pull request #97 from pro… (compare)

  • Jul 23 21:51
    D-Nice closed #97
  • Jul 23 21:51
    D-Nice commented #97
  • Jul 23 21:51
    D-Nice assigned #97
  • Jul 23 21:51
    D-Nice opened #97
  • Jul 23 21:44

    D-Nice on ci-streamline

    chore(ci): improve pipeline (compare)

  • Jul 23 20:01

    D-Nice on ci-streamline

    chore(ci): improve pipeline (compare)

  • Jul 23 19:37

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:37

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:35

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:35

    D-Nice on ci-streamline

    tmp ci test (compare)

  • Jul 23 19:34

    D-Nice on ci-streamline

    (compare)

  • Jul 23 19:33

    D-Nice on ci

    (compare)

  • Jul 23 17:39

    D-Nice on api-symlink

    (compare)

  • Jul 23 17:39

    D-Nice on master

    fix: broken api symlink Merge pull request #96 from pro… (compare)

  • Jul 23 17:39
    D-Nice closed #96
  • Jul 23 16:32

    D-Nice on ci

    (compare)

Oraclize Support
@oraclize-support
@0xc0de4c0ffee - that is super strange. We are still unable to achieve your HTTPS woes too, all is well from our tests! Are you content with HTTP for the time being?
0xc0de4c0ffee
@0xc0de4c0ffee
Now it's working on all browsers, both http& https.. had to hard reload on remix.
I wasn't getting this MaxListenersExceededWarningyesterday.
Thank you again,
On total this was good random thing, now I've ethereum bridge over ganache for testing..
SAI PRASHANTH VUPPALA
@its-VSP

Hi , i would like to send my api key with headers in following function(taken from oraclizeAPI.sol):

function oraclize_query(string memory _datasource, string[4] memory _args, uint _gasLimit) oraclizeAPI internal returns (bytes32 _id) {
        string[] memory dynargs = new string[](4);
        dynargs[0] = _args[0];
        dynargs[1] = _args[1];
        dynargs[2] = _args[2];
        dynargs[3] = _args[3];
        return oraclize_query(_datasource, dynargs, _gasLimit);
    }

Please take a moment and answer my queries are as follows:

  1. What i have to pass as _args[0], assuming _args[1] is GET/POST , _args[2] is end-point and _args[3] is headers.
  2. And also please lemme know the way i'm sending the below headers string is correct or not
'headers': {'content-type': 'json','api_key':'12D3KooWKSCBHqn42BckRwqQNRfLN64f9yH1SwnxNMzgrjQgV7Nm'}
Oraclize Support
@oraclize-support

@its-VSP - in order for you to post custom headers & post requests in your Provable query, you're going to have to leverage the computation datasource. The easiest way to get started on that is to look at our example for sending custom URL headers here: https://github.com/provable-things/ethereum-examples/tree/master/solidity/computation-datasource/url-requests

That example, combined with our documentation regarding the computation datasource should see you be able to complete your query.

@oxc0de4c0ffee - glad it's working for you now! Ganache and the bridge is our preferred way of developing too - easier than using an online IDE!
SAI PRASHANTH VUPPALA
@its-VSP
@oraclize-support
i already explored above link. There in example _query is CID,
so what need to be sent in my case.
Can i send empty string("") ?
Oraclize Support
@oraclize-support

@its-VIP - What do you mean by "There in example +query is CID" ?

As for your empty string question - why? There are overloaded version of the oraclize_query that accept fewer parameters if you require?

SAI PRASHANTH VUPPALA
@its-VSP

@oraclize-support , I'm referring to example in the link you provided.,

request("QmdKK319Veha83h6AYgQqhx9YRsJ9MJE7y33oCXyZ4MqHE",
                "GET",
                "http://httpbin.org/basic-auth/myuser/secretpass",
                "{'auth': ('myuser','secretpass'), 'headers': {'content-type': 'json'}}"
                );

above function is making use of overloaded version of oraclize_query with string array of length 4 as a last parameter
would like to know why some CID is passed in index 0

Oraclize Support
@oraclize-support
@its-VSP - ahh, understood. That first parameter is an IPFS hash, that points to where the computation archive is stored on the IPFS system. The documentation on the computation datasource here goes through that: https://docs.provable.xyz/#data-sources-computation
SAI PRASHANTH VUPPALA
@its-VSP

Yes, So i guess that field is not mandatory
And i can just send method,end-point and headers as string array of length 3.,which may look like ```
provable_query(60,"computation",[
"GET",
"<end-point>",
"{'headers': {'content-type': 'json','api_key':'12D3KooWKSCBHqn42BckRwqQNRfLN64f9yH1SwnxNMzgrjQgV7Nm'}}"
])

```
Please lemme know if it works , thanks in advance

Oraclize Support
@oraclize-support
@its-VSP - it's very much mandatroy - it tells the service where to find your computation archive! So the above won't work unless you provide the Provable query with an IPFS hash.
SAI PRASHANTH VUPPALA
@its-VSP
I have gone through the docs once again and was little confused. Had couple of questions
  1. So what need to be there inside achieve.zip/dockerfile.
  2. Is this the only way to send custom headers?
  3. I'm just wondering will below code automatically sends our custom headers
    request("json(QmdKK319Veha83h6AYgQqhx9YRsJ9MJE7y33oCXyZ4MqHE).headers",
                 "GET",
                 "http://httpbin.org/headers",
                 "{'headers': {'content-type': 'json'}}"
     );
Oraclize Support
@oraclize-support
@its-VSP - yes that's the only way to send custom headers. As for what needs to be in the archive (which you upload to IPFS): You need a docker file that provides the environment for the script you want to run, plus also the script that you want to run. In that script you can do absolutely anything you like, hence why we call it the computation datasource - it's very power and flexible.
SAI PRASHANTH VUPPALA
@its-VSP
Okay thank you @oraclize-support , will go ahead with computation data source
Oraclize Support
@oraclize-support
@its-VSP - as you get more familiar with it you may find yourself being able to do even more than you'd originally planned since it's so powerful! Let us know if you get stuck with anything else!
marcoaureliosequeira
@marcoaureliosequeira
Hello!! I'm using Ganache and I need interact with an external API in my smart contract. Now I'm testing the DieselPrice. So, I can't do the call, I don't see logs of result.
Someone to help me?
image.png
image.png
this is my smart contract. I see this log: "Provable query was sent, standing by for the answer...", but I don't see another
Could this be because of the price associated with each transaction?
Oraclize Support
@oraclize-support

Hello @marcoaureliosequeria - since you're using Ganache you must be working locally, which means you need to be using the ethereum-bridge tool in order to create the link to the Provable service from your private ganache chain. Whilst we don't have any examples using Ganache specifically, we do have examples showing you how to use our service locally in a Truffle environment, which will likely be of great help to you! You can find the Truffle DieselPrice example here: https://github.com/provable-things/ethereum-examples/tree/master/solidity/truffle-examples/diesel-price

If you follow the README you'll see how the ethereum-bridge fits in and thus be able to run your own queries locally too!

SAI PRASHANTH VUPPALA
@its-VSP

@oraclize-support , please guide me in how i can use computation in my particular context ie., sending the custom headers.
My observations and questions :
headers are not static , as you know api_key is meant for authorise the developer.

Dockerfile is there to package our script and make environment, so i would like to know what would be the script i should write there (in sending custom headers)?

If executing the request is the script i should write, how i can send the custom headers from smart contract to that particular script.

Oraclize Support
@oraclize-support

@its-VSP - via the computation datasource you can do _anything._ So you can write whatever script you want in whatever langauge you want (just provided the correct environment for that language via the docker container).

The url-requests example given is python to make url-requests with custom headers, so that example is a great fit for you to see how to do it. The gist of it is that you send whatever params you want for your script from the smart-contract in solidity (so you API token for example). With the compuation datasource you then end up with those params inside your docker container for your script to work with, at which point you can do anything!

So you'd likely want to make your requests from that script using your custom headers that got passed in from solidity, then martial the response, parse our the bits you want, then print that as the final line in your script. That is then what will be returned to your smart-contract!

SAI PRASHANTH VUPPALA
@its-VSP
@oraclize-support , I understood the fact why computation data source is powerful as it can do literally anything. I completely got , how this gonna work and I'm in love with this computation datasource. Thanks for making a time and write about this.
Oraclize Support
@oraclize-support
@its-VSP - if you look closely at the url-request example you will see how the arguments are passed. Look at the arguments sent via solidity (that you copy and pasted here) and then look at how those variables are accessed again in the python script inside the docker to see how you can get hold of yours. They get passed to your compuation as environment variables ! Also, you can pass more of fewer variables if need be - whatever you need!
SAI PRASHANTH VUPPALA
@its-VSP
Yes yes i realised the same and that's why i edited it to normal(without the question).
have another question but i don't know whether it is applicable or not.
Is there a way i can add my achieve.zip in private ipfs and pass that CID along with url that is hosting that private IPFS to oraclize_query
Oraclize Support
@oraclize-support
@its-VSP - unfortunately no - the compuation datasource looks to the public IPFS for archives.
*computation
SAI PRASHANTH VUPPALA
@its-VSP
Cool thanks @oraclize-support
Oraclize Support
@oraclize-support
@its-VSP it is theoretically possible for you to share us the archive in private and to commit to its sha256 hash instead, but this is not commonly used, if you are interested please reach out to us via email ( info@provable.xyz )
SAI PRASHANTH VUPPALA
@its-VSP

@oraclize-support , i have tried computation datasource but didn't got response back.

Apart from that i have copy pasted the same source-code that is there in streamr for which i got the response and CID : QmWFV2UrcUFMFk5R4iTZdusTRsvqohFwHjyXNH1Yu9v3Nm but when i have added the same zip folder myself i got Qmbx5tPsyeoykCBLqAbLpLPNgm7957NTUrYchmfdzHTnhuback and used in contract, the callback is never getting called(got to know after tracking the tx in etherscan)

how to debug what went wrong?

Oraclize Support
@oraclize-support
Hello @its-VSP, sorry for the delayed answer: apparently you got a callback for the streamr example, here it is https://app.provable.xyz/home/check_query?id=eth_kovan_65dbbf0269e7046581e51508077111462d0da78a177cb1329fe523401836de45
Do you have any query reference relative to the url-request sample?
Marcelo Morgado
@marcelomorgado
Hello @oraclize-support is the ropsten service offline? I'm not getting calls from almost a day now. Thanks!
Oraclize Support
@oraclize-support
Hello @marcelomorgado, apologize for the delay in the response. Thanks for letting us know, we have just restarted the service.
Marcelo Morgado
@marcelomorgado
Thanks @oraclize-support !
Marcelo Morgado
@marcelomorgado
A question here @oraclize-support , what my team should do to avoid this kind of issue? We had same issue about a month ago, there is another testnet that we can use that has a more stable service? Thanks!
SAI PRASHANTH VUPPALA
@its-VSP
@oraclize-support ., if you observe the above link you provided for checking query., there is no result returned.
Oraclize Support
@oraclize-support
@marcelomorgado our oracle service is available on Rinkeby, Kovan and Goerli testnets as well.
SAI PRASHANTH VUPPALA
@its-VSP

@oraclize-support , wondering why same computation archieve of streamr that was used in example with different CID is not working or returning any response.

is that the delay/time-out in pulling the content of CID(that
was added by me) by provable servers.

Oraclize Support
@oraclize-support
@its-VSP - we are looking into it
Marcelo Morgado
@marcelomorgado
@marcelomorgado our oracle service is available on Rinkeby, Kovan and Goerli testnets as well.
Thanks for the response @oraclize-support . There is one of these which has less incident (maybe because is used more than the ropsten)?
Oraclize Support
@oraclize-support
@marcelomorgado, the service is the same on every testnet, so we recommend to stay on Ropsten since it is the same format of the mainnet.
Oraclize Support
@oraclize-support
@marcelomorgado actually the service on Goerli is currently better suited for long-running testnet applications: in general we don't guarantee high availability for any testnet as that's a free service where we run experimental code (for more stable integrations running on networks different than mainnets please reach out to us in private), but Goerli runs a "staging" setup which is more stable than the testing one being run on other testnets.
Oraclize Support
@oraclize-support
@its-VSP have you tried running the computation datasource with the origina multihash? That one looks to work correctly from our tests, while yours looks incorrect as you have included inside the zip archive the "littlechange/" folder instead than its content: note that the computation datasource will expect as entrypoint a Dockerfile inside the root of the archive and not anywhere else (your zip archive contains it at "littlechange/Dockerfile" instead than at "/Dockerfile"). Please let us know if this is more clear now - if you still cannot get it working we would be happy to help further!
SAI PRASHANTH VUPPALA
@its-VSP
@oraclize-support . it's working.
My bad! it was clearly mentioned Dockerfile should be root of archive but i had made it in overlook.
Thank you very much for you and your team for debugging.
Oraclize Support
@oraclize-support
@its-VSP no problem, happy to help and glad we have figured it out!
Loki-sama
@loki-sama
@oraclize-support Hello, can you tell me if the following use case is viable for Oraclize? I want a smart contract that starts an API call to a private API. When Oraclize calls the API, that would start an internal process that takes time (hours). So the response that should be included in the call back to the contract would be only available after that process. Can Oraclize wait for the process and handle such a scenario? How would it be done?
SAI PRASHANTH VUPPALA
@its-VSP
@loki-sama
i'm already working on this, we can achieve this using computation data source of provable.
Checkout examples that are using computation datasource
SAI PRASHANTH VUPPALA
@its-VSP

@oraclize-support , i have got a hands on with computation data-source

but when i made the external-api call dynamic ...

_callback had failed due to out of gas but i had sent ~1ether to contract

but the query had returned a hex string when did ascii conversion got a weird encoded string.

If you don't mind , can you help me in debugging this.