Giter Site home page Giter Site logo

provable-things / ethereum-bridge Goto Github PK

View Code? Open in Web Editor NEW
204.0 18.0 93.0 976 KB

Independent bridge to link any Ethereum network with the Provable engine

License: GNU Affero General Public License v3.0

JavaScript 91.88% Shell 0.21% Batchfile 0.12% Solidity 7.80%

ethereum-bridge's Introduction

Description

This tool enables any non-public blockchain instance to interact with the Oraclize service.

Please note that at this point this tool is still experimental and subject to change without notice.

Requirements

  • node version >= 5.0.0 (& npm)

Note

(on Ubuntu)

run sudo apt-get install build-essential -y

You should run the following commands from within the ethereum-bridge folder.

Install

via git

git clone https://github.com/oraclize/ethereum-bridge.git
cd ethereum-bridge
npm install

via npm

npm install -g ethereum-bridge

How to use

You have 2 options:

  • active mode (deploy and query contracts using one account on your main node) [DEFAULT]
  • broadcast mode (deploy and query contracts using a local account (the node will be used only to broadcast the txs))

After you have correctly deployed the address resolver and the connector on your blockchain you can load the previous instance using the --oar flag (with the latest oar address generated) or using --instance latest

if you are not using the deterministic OAR you also need to update your contract constructor with the new address resolver generated

see also optional flags

Active mode

ethereum-bridge -H localhost:8545 -a 1

(deploy contracts using the account 1 found on the localhost:8545 node)

Broadcast mode

Generate a new local address:

ethereum-bridge -H localhost:8545 --broadcast --new

(generate a new address locally and deploy contracts (txs broadcasted to localhost:8545 node))

or if you already have one or more account in your keys.json file:

ethereum-bridge -H localhost:8545 --broadcast -a 0

(load the first account in your keys.json file (index n.0) and deploy contracts (txs broadcasted to localhost:8545 node))

Add a custom address resolver

Add OAR = OraclizeAddrResolverI(EnterYourOarCustomAddress); to your contract constructor, example:

Where EnterYourOarCustomAddress is the address resolver generated when you have run the script

contract test() {
    ...

    function test() {
      // this is the constructor
      OAR = OraclizeAddrResolverI(0xf0f20d1a90c618163d762f9f09baa003a60adeff);
    }

    ...
}

Note: The address chosen will be used to deploy all the Oraclize contracts, make sure to not deploy contracts that use Oraclize on the same address.

How to update the bridge

If a new version is detected you can run npm run update to automatically donwload and install the latest version from github.

Optional flags

  • optional:
    • --broadcast --new : generate a new local address (private key automatically saved in ./config/instance/keys.json), and deploy contracts using the new address
    • --broadcast : enable offline tx signing (your node will be used to broadcast the raw transaction) the broadcast mode will load your local keys.json file
    • -a : change the default account used to deploy and call the transactions (account index and hex address are allowed) i.e:
      • -a 0 : use account 0 on localhost:8545
      • -a 0x123456 --broadcast : load and use account 0x123456 (public-key) in your keys.json file (broadcast mode)
      • -a 0 --broadcast : use account at index n. 0 in your keys.json file (broadcast mode)
    • --instance : load a previous configuration file (filename) you can also use 'latest' to load the latest confiuration file, i.e. --instance oracle_instance_1483441110.json or --instance latest
    • --from --to : load and process logs starting --from (fromBlock) and --to (toBlock) ('latest' is not allowed) i.e. --from 27384 --to 27387
    • --oar : to specify the OAR address already deployed i.e. --oar 0xEnterYourOarCustomAddress
    • -H : change the default node (localhost:8545)
    • -p : change the default PORT (8545) on localhost
    • --url : change the default node with an url (http://localhost:8545)
    • --key : change the default key path (./config/instance/keys.json) i.e. --key /home/user/keys.json
    • --gas : change the default gas limit (3000000) used to deploy contracts
    • --resume : resume all skipped queries
    • --skip : skip all pending queries
    • --dev : skip contract myid check and pending queries (useful for local testing)
    • --disable-deterministic-oar : Deploy the address resolver (OAR) with your main account (note: you need to update your contract with the new generated address)
    • --price-usd : set the USD base price
    • --price-update-interval : set the baseprice update interval time (in seconds), ETH price will be fetched from the Oraclize HTTP API
    • --random-ds-update-interval : set the random ds hash list update interval time (in seconds)
    • --disable-price : skip datasource pricing and base price connector update (only on new instances)
    • --disable-reorg : disable re-org block listen
    • --update-ds : update datasource pricing only (pricing (if found) will be loaded from your local instance file, otherwise will be fetched from the remote oraclize API)
    • --loglevel : change the default log level (available: 'error', 'warn', 'info', 'verbose', 'debug', 'stats') default: 'info'
    • --non-interactive : disable the interactive mode
    • --no-hints : disable logs hints
    • --gasprice : set custom gas price

ethereum-bridge's People

Contributors

anudit avatar bertani avatar d-nice avatar gskapka avatar idrabenia avatar marcogiglio avatar nepalbitcoin avatar nya1 avatar riccardopersiani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ethereum-bridge's Issues

What does this do?

Hey, this is a great tool, thank you!

Not an issue per se, but it would be helpful to have a better sense of what the various parts of this repo are doing.

FWIW, I've got it up and running, and importing data to a private chain, but still have a few questions.

For this purpose, we have a simple contract called ExchangeRate that inherits usingOraclize and calls oraclize_query from the ExchangeRate.update method.

  • What is the server doing when I send a payment to ExchangeRate.update?
  • What is a "callback address"?
  • What is the "connector"?

Thanks for your help.

Out of Gas

Is there any way I can not run out of gas

Callback tx error after oraclize query

Hey guys, after sending the query to oraclize, when its calling __callback function, it instead runs into this error. It's been working fine for awhile, and its just started happening. I'm using Truffle and Ganache. There is a closed version of this question but I tried the suggested solution of removing 'OAR = "..."' from the contract and it didn't stop this error. Thanks for any help!

[2017-10-13T14:36:20.749Z] INFO sending __callback tx... { "contract_myid": "0x8e23b2147e8db2173336116c3f4fe2951e7a2b0c419fc21acb71c4f763f85c42", "contract_address": "0xbd31352798e53c1133c1ccf762a822e1da0a3948" } [2017-10-13T14:36:20.796Z] ERROR callback tx error, contract myid: 0x8e23b2147e8db2173336116c3f4fe2951e7a2b0c419fc21acb71c4f763f85c42

Why the callback in my private ethereum chain don't work?

OS: ubuntu 16.04
client: geth
I used the bridge on my private chain but it don't work, with no response to my contract calls. Here is the recent bridge.log record :

{"level":"debug","message":"checking invalid __callback transactions","timestamp":"2018-05-24T09:37:01.726Z"}
[]
{"level":"debug","message":"reorg block target: 229","timestamp":"2018-05-24T09:37:02.451Z"}
{"level":"debug","message":"reorg block target: 229","timestamp":"2018-05-24T09:37:32.533Z"}
{"message":"reorgListen error","stack":"Error: Invalid JSON RPC response: undefined\n    at Object.InvalidResponse (/usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/errors.js:38:16)\n    at HttpProvider.send (/usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/httpprovider.js:91:22)\n    at RequestManager.send (/usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:58:32)\n    at Eth.get [as blockNumber] (/usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/property.js:107:62)\n    at Timeout._onTimeout (/usr/local/lib/node_modules/ethereum-bridge/bridge.js:801:50)\n    at ontimeout (timers.js:466:11)\n    at tryOnTimeout (timers.js:304:5)\n    at Timer.listOnTimeout (timers.js:267:5)","level":"error","timestamp":"2018-05-24T09:37:32.608Z"}
{"level":"warn","message":"JSON RPC error, trying to re-connect every 30 seconds","timestamp":"2018-05-24T09:37:32.608Z"}

I has set the OAR bridge recommed, but there was no callback.
Can someone point out the problem?

Creation of OAR in ethereum-bridge

I notice from multiple users about using

OAR = OraclizeAddrResolverI(resolve_addr); //add this line if you are using Oraclize in private chain environment

and to generate the resolve_addr

If you are currently using private chain, you need to use the Ethereum-Bridge API to generate a OAR, which is a log listener listens to the oraclize query from private chain and connect to oraclize serivice. The following list the steps of using Ethereum-Bridge:

  • Download the repository of Ethereum-Bridge by using git clone https://github.com/oraclize/ethereum-bridge, and execute npm install in the nodejs folder.
  • Unlock certain account (in this example we will use acoounts[0]) by using geth --unclock 0, and execute node plugin -H localhost:8545 -a 0. (make sure the account you unlock matches the account input to plugin.js)
  • Once you execute plugin.js, it will generate OAR for you to place in the constructor of your contract. After compiling it, you need to deploy it using any accounts except for the account you just unlocked.

I see that there is no plugin.js any more. All this must be outdated. How do I generate OAR to use with my private blockchain?

no response in console

hi guys,
thanks for creating this tool.

have a weird issue where i'm able to compile and migrate/deploy to truffle develop locally, but not getting any response in the console for ethereum-bridge.

please help.
best,
vamsi

Cannot debug callback transaction in truffle

Our callback transactions are getting failed on test environment. To debug the failed transaction when using truffle debug, its not working and giving following error.

Gathering transaction data...

redux-saga error: uncaught at session.saga
at session.saga 
 at recordInstance 
 TypeError: Cannot destructure property `context` of 'undefined' or 'null'.
    at Object.addInstance (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:4537:20)
    at addInstance.next (<anonymous>)
    at recordInstance (/usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-debugger/dist/debugger.js:3459:1)
    at recordInstance.next (<anonymous>)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:311:1)
    at currCb (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:388:1)
    at runSelectEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:699:1)
    at runEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:435:1)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:315:1)
    at proc (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:270:1)
    at resolveIterator (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:456:1)
    at runCallEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:517:1)
    at runEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:435:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:644:1
    at Array.forEach (<anonymous>)
    at runAllEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:643:1)
    at runEffect (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:435:1)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:315:1)
    at currCb (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:388:1)
    at checkEffectEnd (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:612:1)
    at chCbAtKey (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:627:1)
    at Object.currCb [as cb] (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:388:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:358:1
    at Array.forEach (<anonymous>)
    at end (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:357:1)
    at Object.task.cont (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:99:1)
    at next (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:321:1)
    at currCb (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:388:1)
    at takeCb (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/proc.js:466:1)
    at Object.put (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:73:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:161:1
    at Array.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:182:1)
    at Object.emit (/usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/channel.js:26:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/~/redux-saga/es/internal/middleware.js:67:1

How to debug callback transactions initiated by ethereum-bridge ?

HTTP query error& callback tx error

Hi,guys!when i run my contract which mainly do some compute off-chain with oraclize on localhost, and return the compute result to the chain, the error message feedback.Any one help me!!!!Thanks for your help!
[2018-04-26T13:48:12.434Z] ERROR HTTP query error [ "ConnectionError" ] [2018-04-26T13:48:12.436Z] INFO sending __callback tx... { "contract_myid": "0xab3bf2627a4d39f1c15806d47a8cf89c48a0ea0628e323ff4b12e94760b2d26c", "contract_address": "0x9ccf301b2bd8d42e6240418bc9ae1f9472ffcb68" } [2018-04-26T13:48:12.495Z] ERROR callback tx error, contract myid: 0xab3bf2627a4d39f1c15806d47a8cf89c48a0ea0628e323ff4b12e94760b2d26c { "message": "VM Exception while processing transaction: revert", "stack": [ "Error: VM Exception while processing transaction: revert", " at Object.InvalidResponse (/home/zyx/ethereum-bridge-master/node_modules/web3/lib/web3/errors.js:38:16)", " at /home/zyx/ethereum-bridge-master/node_modules/web3/lib/web3/requestmanager.js:86:36", " at XMLHttpRequest.request.onreadystatechange (/home/zyx/ethereum-bridge-master/node_modules/web3/lib/web3/httpprovider.js:118:13)", " at XMLHttpRequestEventTarget.dispatchEvent (/home/zyx/ethereum-bridge-master/node_modules/xhr2/lib/xhr2.js:64:18)", " at XMLHttpRequest._setReadyState (/home/zyx/ethereum-bridge-master/node_modules/xhr2/lib/xhr2.js:354:12)", " at XMLHttpRequest._onHttpResponseEnd (/home/zyx/ethereum-bridge-master/node_modules/xhr2/lib/xhr2.js:509:12)", " at IncomingMessage.<anonymous> (/home/zyx/ethereum-bridge-master/node_modules/xhr2/lib/xhr2.js:469:24)", " at emitNone (events.js:91:20)", " at IncomingMessage.emit (events.js:185:7)", " at endReadableNT (_stream_readable.js:974:12)", " at _combinedTickCallback (internal/process/next_tick.js:80:11)", " at process._tickCallback (internal/process/next_tick.js:104:9)" ] }

Alternative Private Chains

That's what I saw on Oraclize:
image
I have trouble in using ethereum-bridge with Oraclize in my private network building by geth.
Does that means Oraclize is not supported in private network by geth, only supported in truffle and testrpc even if I am using ethereum-bridge?

oraclize examples not firing first free query

Some users have reported the Oraclize ethereum-examples contracts not firing the first free query, especially those with the query call in their constructor. The culprit here most likely is the fact that you are using account 0 for the ethereum-bridge as the callback address, and also account 0 with truffle for deploying the contract's you are testing. The easiest way around this is to start the ethereum-bridge with an "exclusive" account, especially one that will not deploy any contracts reliant on Oraclize.

With the standard ganache/testrpc start procedure, where it provides 10 accounts, the easiest way is to run the bridge like ethereum-bridge --dev -a 9 and any other additional flags you may need.

Oracle does not receive the queries

I have a private network with a few nodes and I have installed ethereum-bridge to deploy an Oracle.

One of my blockchain nodes is used by ethereum-bridge to deploy the oracle. The node is started with the command
geth.exe --identity "7" --datadir "D:\Blockchain\1" --networkid 4999 --rpc --rpcport 47000 --rpcapi "db,eth,net,web3,shh,personal" --rpccorsdomain "*" --port 30800 --nodiscover --shh --ipcdisable console

while ethereum-bridge:

ethereum-bridge -H localhost:47000 -a 0

These are the logs on the ethereum-bridge console

[2019-02-21T09:45:14.820Z] INFO you are running ethereum-bridge - version: 0.6.1
[2019-02-21T09:45:14.821Z] INFO saving logs to: ./bridge.log
[2019-02-21T09:45:14.822Z] INFO using active mode
[2019-02-21T09:45:14.823Z] INFO Connecting to eth node http://localhost:47000
[2019-02-21T09:45:16.101Z] INFO connected to node type Geth/7/v1.8.21-stable-9dc5d1a9/windows-amd64/go1.11.4
[2019-02-21T09:45:16.588Z] WARN Using 0x8668dc605fe8d721dbb96378fd8155c621bea37d to query contracts on your blockchain, make sure it is unlocked and do not use the same address to deploy your contracts
[2019-02-21T09:45:16.711Z] INFO deploying the oraclize connector contract...
[2019-02-21T09:45:26.998Z] INFO connector deployed to: 0x251deddf98aca280a252d9e5f7b1b246bc3f66f7
[2019-02-21T09:45:27.119Z] WARN deterministic OAR disabled/not available, please update your contract with the new custom address generated
[2019-02-21T09:45:27.120Z] INFO deploying the address resolver contract...
[2019-02-21T09:45:37.534Z] INFO address resolver (OAR) deployed to: 0xb69156280a1461003a079387c2b5b827b3f0fc53
[2019-02-21T09:45:37.535Z] INFO updating connector pricing...
[2019-02-21T09:45:47.861Z] INFO successfully deployed all contracts
[2019-02-21T09:45:47.871Z] INFO instance configuration file saved to D:\GitHub\ethereum-bridge\config\instance\oracle_instance_20190221T094547.json

Please add this line to your contract constructor:

OAR = OraclizeAddrResolverI(0xB69156280a1461003a079387c2B5B827B3f0fc53);

[2019-02-21T09:45:47.996Z] INFO Listening @ 0x251deddf98aca280a252d9e5f7b1b246bc3f66f7 (Oraclize Connector)

(Ctrl+C to exit)

Then, using a different blockchain node I have deployed the following contract:

pragma solidity ^0.5.4;

import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";

contract WolframAlpha is usingOraclize {

    uint256 public beginningPastQuarter;
    uint256 public beginningCurrentQuarter;
    uint256 public payoutIntervalSeconds;
    
    event newOraclizeQuery(string description);
    event newTimestampMeasure(uint256 timestamp);

     constructor() public {
        payoutIntervalSeconds = 120;
        beginningPastQuarter = 0;
        beginningCurrentQuarter = 0;
        OAR = OraclizeAddrResolverI(0xB69156280a1461003a079387c2B5B827B3f0fc53);
    }
    
    function stringToUint(string memory s) internal pure returns (uint) {
        bytes memory b = bytes(s);
        uint result = 0;
        for (uint i = 0; i < b.length; i++) { 
            if (uint8(b[i]) >= 48 && uint8(b[i]) <= 57) {
                result = result * 10 + (uint8(b[i]) - 48); 
            }
        }
        return result; 
    }

    function __callback(bytes32 myid, string memory result) public {
        if (msg.sender != oraclize_cbAddress()) revert();
        
        uint256 t = stringToUint(result);
        if (t-beginningCurrentQuarter >= payoutIntervalSeconds){
            beginningPastQuarter = beginningCurrentQuarter;
            beginningCurrentQuarter = t;
        }
        
        emit newTimestampMeasure(t);
    }
    
    function getUTCTimestamp(uint256 delay) public payable {
        emit newOraclizeQuery("Oraclize query was sent, standing by for the answer..");
        oraclize_query(delay,"WolframAlpha", "Timestamp now");
    }
    
    function pay(address receiver) public payable{
        address(uint160(receiver)).send(msg.value);
    }
    
    function balance(address a) public returns(uint256 r){
        return a.balance;
    }
} 

After deploying the contract, I have sent some ether to it so it can pay for the calls to the Oracle.

Now if I try to use the oracle by calling contractInstance.getUTCTimestamp(0,{from:eth.accounts[0],value:2222222,gas:5000000}); the transaction is mined but nothing happens in the ethereum-bridge console.

If I inspect the transaction and its receipts I get:

{
  blockHash: "0x1c2d77b1e07d51894fdf0e2c3423d01538149d657b89e2568b5846d049452fda",
  blockNumber: 5799,
  contractAddress: null,
  cumulativeGasUsed: 5000000,
  from: "0xed2632f90f57dbbeb8e1d27277f4ef85a42851d2",
  gasUsed: 5000000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  root: "0x67de497db6efcd76b0f4aba9255cd7744430eb7aded05e86090952071c53e97a",
  to: "0x217e753369532055c55c3588774275b8a58d5cf4",
  transactionHash: "0x21fb0191b15e748f93e9884349f8066cd765c0948d8050d99ebe99d32eb9543b",
  transactionIndex: 0
}
{
  blockHash: "0x1c2d77b1e07d51894fdf0e2c3423d01538149d657b89e2568b5846d049452fda",
  blockNumber: 5799,
  from: "0xed2632f90f57dbbeb8e1d27277f4ef85a42851d2",
  gas: 5000000,
  gasPrice: 20000000000,
  hash: "0x21fb0191b15e748f93e9884349f8066cd765c0948d8050d99ebe99d32eb9543b",
  input: "0xa01569d70000000000000000000000000000000000000000000000000000000000000000",
  nonce: 1048,
  r: "0x782a4d75ca59f5f0646733653474c6a42e26001513996c86635be1394d23d1c2",
  s: "0x23a1346876b104f527e291f885bfb21fe406b17128a18ddb7167bdf8ce021555",
  to: "0x217e753369532055c55c3588774275b8a58d5cf4",
  transactionIndex: 0,
  v: "0x41",
  value: 2222222
}

It seems to me that the transaction is using all gas and that happens even if I increase the gas value. The weird thing is that if I test this contract in remix the total gas used is below 200000. What could be the problem?

npm install error - [email protected] install: `node-gyp rebuild`

OS: cat /etc/redhat-release
CentOS release 6.9 (Final)

node --version

v8.9.1

npm --version

5.5.1

python --version

Python 2.6.6

python2 --version

Python 2.7.14

python3 --version

Python 3.6.3

Installed the following:
yum groupinstall 'Development Tools'
yum install gmp-devel

yum install avahi-compat-libdns_sd avahi-compat-libdns_sd-devel

Still no luck!

screen shot 2017-11-14 at 2 18 54 pm

Ethereum bridge stops writing into tingodb after sometime

Hi,

I have setup ethereum-bridge on a private network running on Node js 6.14.1 on Ubuntu machine 16.04.3 LTS. One peculiar thing I see is that after sometime the Queries and callback files residing under tingodb stops getting updated. As a result all my Oraclize queries fail at ethereum-bridge node. If I clear the tingodb and re-install ethereum-bridge then the thing starts working but I can see for one HTTP request multiple callbacks coming, however I can still get the query response. But after a few Oraclize queries again the issue starts occurring. Why is this issue occurring and can this be avoided?

Thanks.

The bridge returns a response only one time

Hello,
I want to deploy locally a oracle contract that gives me the current timestamp but it works only one time, after this it does not call the query anymore.
The steps:

  1. ganache-cli -l 800000000 --allowUnlimitedContractSize
  2. ethereum-bridge -H localhost:8545 --broadcast -a 1 --dev --loglevel verbose
  3. I copy the line OAR = OracleAddrResolverI(0xX...X); in the ctor of the TimeMachine contract
  4. truffle migrate --reset

After this, the ganache console prints a infinite number of eth_getFilterChanges and that's a good thing, the call to the exposed public method returns one valid timestamp and the bridge prints this

[2020-01-27T08:41:14.230Z] INFO contract 0xcf903000689f8fd441a2f90ae797a4d4acc14cd0 __callback tx sent, transaction hash: 0x8f5b03fdb3b5c3968ad9f17c7a8aef06d9f18ce6c8ea5fef80fb45507178d668
{
    "myid": "0x5c2db0aca7e507a155675a93f2db0b9d69a1413cc793f80f0c94e6f209bb9cf2",
    "result": "1580114467",
    "proof": null,
    "proof_type": "0x00",
    "contract_address": "0xcf903000689f8fd441a2f90ae797a4d4acc14cd0",
    "gas_limit": 200000,
    "gas_price": null
}

After this, ganache continue to print filter changes but the bridge does not give me another timestamp, it sticks with the current one for the rost of it's life.

For the full context, see the contract bellow:

pragma solidity ^0.5.10;
import "./usingOraclize.sol";

contract TimeMachine is usingProvable {

    uint256 public timestamp;
    event LogConstructorInitiated(string nextStep);
    event LogPriceUpdated(string price);
    event LogNewProvableQuery(string description);

    constructor () public payable {
	OAR = OracleAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
        emit LogConstructorInitiated("Constructor was initiated. Call 'updateTime()' to send the Provable Query.");
	updateTime();
    }

    function pay() public payable {}

    function balance() public view returns(uint256)  {
        return address(this).balance;
    }

    function __callback(bytes32, string memory result) public {
        if (msg.sender != provable_cbAddress()) revert();
        timestamp = parseInt(result);
        emit LogPriceUpdated(result);
        updateTime();
    }

    function updateTime() public payable {
        if (provable_getPrice("URL") > address(this).balance) {
            emit LogNewProvableQuery("Provable query was NOT sent, please add some ETH to cover for the query fee");
        } else {
            emit LogNewProvableQuery("Provable query was sent, standing by for the answer..");
            provable_query("URL", "json(http://worldtimeapi.org/api/timezone/Europe/Bucharest).unixtime");
        }
    }
}

I'm doing something wrong or this is a bug?

TypeError: Web3 is not a constructor

git clone git clone https://github.com/oraclize/ethereum-bridge.git
cd ethereum-bridge
node bridge -H localhost:8545 -a 9 --dev --disable-price

I am getting error

/home/rahulb/ethereum-bridge/lib/bridge-util.js:8
const web3 = new Web3()
^

TypeError: Web3 is not a constructor
at Object. (/home/rahulb/ethereum-bridge/lib/bridge-util.js:8:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/rahulb/ethereum-bridge/bridge.js:6:18)
at Module._compile (module.js:570:32)

Error: More than one instance of bitcore-lib found.

During our local chain test, we find ethereum-bridge fail to build correctly (running on ubuntu 18.04 and build with "npm install"). It may be caused by some package dependencies change and it requires some fix.

When running "npm install", the output was:
npm WARN [email protected] requires a peer of bitcore-lib@^0.16.0 but none was installed.

When running "node bridge -H localhost:8545 -a 9 --dev", the output was:
/home/test/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12
throw new Error(message);
^

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
at Object.bitcore.versionGuard (/home/tmesis/code/ina/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12:11)
at Object. (/home/tmesis/code/ina/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:15:9)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/home/tmesis/code/ina/ethereum-bridge/node_modules/bitcore-mnemonic/lib/mnemonic.js:3:15)

oraclize report "exceeds block gas limit"

I run my ethereum private blockchain on the port 8100,and I unlock my accounts 0,and accounts 0 has 140 ether. I run the ethreum-bridge as follow:
sudo ethereum-bridge -H localhost:8100 -a 0
the console print as follows:
`Please wait...
[2018-05-31T03:00:26.610Z] INFO you are running ethereum-bridge - version: 0.6.0-beta.1
[2018-05-31T03:00:26.611Z] INFO saving logs to: ./bridge.log
[2018-05-31T03:00:26.611Z] INFO using active mode
[2018-05-31T03:00:26.611Z] INFO Connecting to eth node http://localhost:8100
[2018-05-31T03:00:28.258Z] INFO connected to node type Geth/v1.8.9-unstable-d6ed2f67/linux-amd64/go1.10.2
[2018-05-31T03:00:28.615Z] WARN Using 0xd7b4e8fc34f1e8727d9d1ded91b6981ed96e8422 to query contracts on your blockchain, make sure it is unlocked and do not use the same address to deploy your contracts
[2018-05-31T03:00:28.734Z] INFO deploying the oraclize connector contract...
Error: Error: exceeds block gas limit
at /usr/local/lib/node_modules/ethereum-bridge/bridge.js:615:20
at /usr/local/lib/node_modules/ethereum-bridge/node_modules/async/dist/async.js:473:16
at next (/usr/local/lib/node_modules/ethereum-bridge/node_modules/async/dist/async.js:5329:29)
at /usr/local/lib/node_modules/ethereum-bridge/node_modules/async/dist/async.js:969:16
at /usr/local/lib/node_modules/ethereum-bridge/lib/bridge-core.js:274:21
at Object.callback (/usr/local/lib/node_modules/ethereum-bridge/lib/bridge-tx-manager.js:66:21)
at /usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/method.js:142:25
at /usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:86:20
at XMLHttpRequest.request.onreadystatechange (/usr/local/lib/node_modules/ethereum-bridge/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/local/lib/node_modules/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/usr/local/lib/node_modules/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/local/lib/node_modules/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage. (/usr/local/lib/node_modules/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:469:24)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1090:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

Please wait...
Exiting...`
I don't know why I get these errors.Someone can help me?

Support for node 8

I am trying Oraclize with a private ethereum blockchain.

I downloaded the current version of ethereum-bridge and tried the active mode

node bridge -H localhost:8042 -a 1

I get the error

Not compatible with v8.0.0 of nodejs, please use v6.9.1 or a lower version

exiting...

Can the support for latest versions be provided?

Wrong information message in ethereum-bridge on ubuntu

After starting ethereum bridge on Ubuntu it will display message:
OAR = OraclizeAddrResolverI(0x1160BceeFDfc731C96244d96de946B9769d16E16);

This is wrong because it should be:
OAR = OracleAddrResolverI(0x1160BceeFDfc731C96244d96de946B9769d16E16);

Version:
INFO you are running ethereum-bridge - version: 0.6.2

v8.4.0 of nodejs

I am not able to downgrade my version of nodejs.
What are the issues with this package not running properly with v8.4.0 of nodejs?

Thank you,
Bruce

gas errors when using bridge with private geth network

I am using the ethereum-bridge to connect oraclize with my local private network,but it seems that it didn't work at all!!!
image
So,i am successfully building ethereum-bridge,this is my contract deployed on Remix
image
i can see that the oraclize_query never sends out at all!

What is the behaviour of --dev?

Ok, I had this headaching problem for almost 1 week without understanding why.
Here are simple queries (taken from 'http://app.oraclize.it/' test queries) I want to run with Oraclize

  event LogNewOraclizeQuery(string description);
  event LogResult(string price);

  function getResult() external payable {
    if (oraclize_getPrice("URL") > this.balance) {
      LogNewOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
    }
     else {
      LogNewOraclizeQuery("Oraclize query was sent, standing by for the answer..");
      oraclize_query("URL", "json(https://www.therocktrading.com/api/ticker/BTCEUR).result.0.last");
    }
  }

  function postData() external payable {
    if (oraclize_getPrice("URL") > this.balance) {
      LogNewOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
    }
     else {
      LogNewOraclizeQuery("Oraclize query was sent, standing by for the answer..");
      oraclize_query("URL", "json(https://api.postcodes.io/postcodes).status", '{"postcodes" : ["OX49 5NU", "M32 0JG", "NE30 1DP"]}');
    }
  }

  function __callback(bytes32 myid, string result) public {
      require(msg.sender == oraclize_cbAddress());
      LogResult(result);
  }

So I want to test this locally, I use the ethereum-bridge to deploy Oraclize.
The getResult result queries works everytime and I get my result. However, the postData never works. It just tries to do the query and eventually get timed out in my truffle test.

So I tried to do many many things to find out why it is not working and just some minutes ago I tried to run the ethereum bridge with the --dev prop and magically it works. HOW? I don't understand. And also, now that I get postData to work with --dev prop, the getResult stopped working and I get the same initial timeout issue unless I rerun the bridge without --dev.

What is going on? From the README.doc it says

--dev: skip contract myid check and pending queries (useful for local testing)

But what is this contract myid skip check and why does it matter in this case?

What config do I need to do both GET and POST request with Oraclize on the same eth-bridge?

not possible to run 2 queries in 1 TX

hey, thank you for this tool.
Unfortunately when I am trying to run 2 "oraclize_query" in 1 TX, it failed, but when I run only 1, after kick the second one it works...

Error: Key not found in database

My team at MarketProtocol are using the ethereum-bridge and while running our test suite which uses ethereum-bridge, ethereum-bridge crashes with the below error:

INFO checking HTTP query 46a77f493f30332fb9dced0aa7a6a96c9c2d314bcdc9d963f9675620a5bc71e0 status on Tue Dec 18 2018 17:36:34 GMT-0700 (MST)
Error: Key not found in database
    at Object.InvalidResponse (/home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/errors.js:38:16)
    at RequestManager.send (/home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:61:22)
    at Eth.send [as getBlock] (/home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/method.js:145:58)
    at parseLog (/home/pelsasser/ethereum-bridge/lib/bridge-log-manager.js:130:59)
    at /home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/filter.js:120:21
    at Array.forEach (<anonymous>)
    at /home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/filter.js:119:32
    at Array.forEach (<anonymous>)
    at Object.onMessage [as callback] (/home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/filter.js:117:22)
    at /home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:259:20
    at Array.forEach (<anonymous>)
    at /home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:258:12
    at XMLHttpRequest.request.onreadystatechange (/home/pelsasser/ethereum-bridge/node_modules/web3/lib/web3/httpprovider.js:118:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/pelsasser/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/home/pelsasser/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpResponseEnd (/home/pelsasser/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:509:12)

Our current best research at this point says there is some asynchronous issues that sometimes occur (more often than not).
We are hoping that you could help provide some insight on how this can be resolved?

How to reproduce:

We have a reference issue open here with instruction on how this can be reproduced. It also contains comments on the different approaches we have taken in order to fix this.

Missing error message when provided account is incorrect

When start application with incorrect account for instance
node bridge.js -a 5
I received message
[2017-09-01T11:02:01.190Z] ERROR {"message":"Error: Account ","stack":"Error: Error: Account \n at deployOraclize (/Users/idrabenia/Projects/opencv-test/ethereum-bridge/bridge.js:525:16)\n at /Users/idrabenia/Projects/opencv-test/ethereum-bridge/bridge.js:425:33\n at /Users/idrabenia/Projects/opencv-test/ethereum-bridge/bridge.js:506:14\n at Request._callback (/Users/idrabenia/Projects/opencv-test/ethereum-bridge/lib/bridge-http.js:25:14)\n at Request.self.callback (/Users/idrabenia/Projects/opencv-test/ethereum-bridge/node_modules/request/request.js:188:22)\n at emitTwo (events.js:106:13)\n at Request.emit (events.js:191:7)\n at Request.<anonymous> (/Users/idrabenia/Projects/opencv-test/ethereum-bridge/node_modules/request/request.js:1171:10)\n at emitOne (events.js:96:13)\n at Request.emit (events.js:188:7)\n at IncomingMessage.<anonymous> (/Users/idrabenia/Projects/opencv-test/ethereum-bridge/node_modules/request/request.js:1091:12)\n at IncomingMessage.g (events.js:291:16)\n at emitNone (events.js:91:20)\n at IncomingMessage.emit (events.js:185:7)\n at endReadableNT (_stream_readable.js:974:12)\n at _combinedTickCallback (internal/process/next_tick.js:74:11)"}

It is not possible to understand - whats going worse from this message.

Possibility to force query execution before specified delay

When running an Oraclize query with a delay (e.g. oraclize_query(60, "URL", url1)), it would be useful, in the context of unit tests, to force the ethereum-bridge to execute the query before the specified delay.

Otherwise, the delay makes it unfeasible to run automated unit tests when the delay that is specified in the contract is far in the future and immutable.

Moreover, I would have imagined that increasing the timestamp on the EVM would do the trick, but it does not seem to be taken into account by the bridge (running on testrpc). For example, when running the following code snippet, although the current block timestamp is advanced by 60 seconds, the ethereum-bridge still waits 60 seconds before executing the query:

let currentBlockTime = web3.eth.getBlock(web3.eth.blockNumber).timestamp;
await web3.currentProvider.send({jsonrpc: "2.0", method: "evm_increaseTime", params: [60], id: 0});
await web3.currentProvider.send({jsonrpc: "2.0", method: "evm_mine", params: [], id: 0});

Is there a way around this? Thanks in advance.

URL query costs

1. The first issue is related to the reported base price.

Ethereum bridge is reporting the following base price upon start:

INFO base price updated to 0.00000277 ETH (so around 0,0025 USD).

Since it is the base price I would expect this to be 1/10th of the URL queries, so the URL price would be around 0,025 USD, which is x2.5 more than the 0,01 announced USD.

2. The second issue is related to the price returned within the smart contract.

I have the following statement in my smart contract:

uint queryCost = oraclize_getPrice("URL");

The value stored in queryCost is 4027700000000000 Wei (0.0040277 ETH), which is around 3.728 USD.

I would expect that the base price would be around 0.001 USD so the URL would match the documented 0.01USD and I would expect the oraclize_getPrice("URL") to return a value in ETH similar to 0.01 USD.

Which is the reason of these differences? I cannot find more documentation related to this and I need a proper estimation in order to invoke Oraclize.

How to retrieve proper estimation of GAS/Value? Why does it differe from the documented ones?

Cannot read property 'node' of undefined

I'm try to execute broadcast via ethereum-bridge --url http://localhost:8542 --broadcast --new and getting error below:

ethereum-bridge --url http://localhost:8542 --broadcast --new
Please wait...
[2018-08-30T20:42:08.143Z] INFO you are running ethereum-bridge - version: 0.6.1
[2018-08-30T20:42:08.144Z] INFO saving logs to: ./bridge.log
Error: Error: Error: Keystore: Must include hdPathString in createVault inputs. Suggested alternatives are m/0'/0'/0' for previous lightwallet default, or m/44'/60'/0'/0 for BIP44 (used by Jaxx & MetaMask)
    at /Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/bridge.js:200:22
    at /Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/lib/bridge-util.js:39:21
    at Function.KeyStore.createVault (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/node_modules/eth-lightwallet/lib/keystore.js:98:12)
    at Object.generateNewAddress (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/lib/bridge-util.js:36:22)
    at Object.<anonymous> (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/bridge.js:199:16)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
    at startup (internal/bootstrap/node.js:240:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:564:3)

Please wait...
/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/lib/blockchain-interface.js:32
  this.mainNode = config.node.main || '127.0.0.1:8545'
                         ^

TypeError: Cannot read property 'node' of undefined
    at BlockchainInterface [as constructor] (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/lib/blockchain-interface.js:32:26)
    at singletonWrapper (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/node_modules/pragma-singleton/PragmaSingleton.js:61:16)
    at process.removeAllLogs (/Users/ivan/.nvm/versions/node/v10.5.0/lib/node_modules/ethereum-bridge/lib/bridge-log-manager.js:138:7)
    at process.emit (events.js:182:13)
    at process._fatalException (internal/bootstrap/node.js:441:27)

I can't use Ethereum-Bridge

I have installed the bridge into a Ubuntu16.04 , on our Alastria node machine, but i have this problem when I tried to use it:
image

Any idea?

our net is Alastria (based on Ethereum)

Unknown transaction

So I am running ethereum bridge inside a docker image, I did npm install and everything went fine until I ran node bridge command as follows, and alos I have unlocked my account. I have a private ethereum network setup and rpc is exposed over 8545, Following is the error log I am experiencing

bash-4.4# node bridge -a 9
Please wait...
[2017-12-19T17:14:10.986Z] INFO you are running ethereum-bridge - version: 0.5.5
[2017-12-19T17:14:10.988Z] INFO saving logs to: ./bridge.log
[2017-12-19T17:14:10.990Z] INFO using active mode
[2017-12-19T17:14:10.991Z] INFO Connecting to eth node http://localhost:8545
[2017-12-19T17:14:12.919Z] INFO connected to node type Geth/v1.8.0-unstable-fe070ab5/linux-amd64/go1.9.2
[2017-12-19T17:14:13.513Z] WARN Using 0xb1d3073bcc45462a3b0dfe69902cdd12971efec9 to query contracts on your blockchain, make sure it is unlocked and do not use the same address to deploy your contracts
[2017-12-19T17:14:13.729Z] INFO deploying the oraclize connector contract...
Error: unknown transaction
at Object.InvalidResponse (/root/oracle/ethereum-bridge/node_modules/web3/lib/web3/errors.js:38:16)
at RequestManager.send (/root/oracle/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:61:22)
at Eth.send [as getTransactionReceipt] (/root/oracle/ethereum-bridge/node_modules/web3/lib/web3/method.js:145:58)
at Timeout._onTimeout (/root/oracle/ethereum-bridge/lib/bridge-tx-manager.js:79:52)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)
Error: Error: unknown transaction
at /root/oracle/ethereum-bridge/bridge.js:614:20
at /root/oracle/ethereum-bridge/node_modules/async/dist/async.js:473:16
at next (/root/oracle/ethereum-bridge/node_modules/async/dist/async.js:5315:29)
at /root/oracle/ethereum-bridge/node_modules/async/dist/async.js:958:16
at /root/oracle/ethereum-bridge/lib/bridge-core.js:274:21
at Timeout. (/root/oracle/ethereum-bridge/lib/bridge-tx-manager.js:90:14)
at ontimeout (timers.js:475:11)
at tryOnTimeout (timers.js:310:5)
at Timer.listOnTimeout (timers.js:270:5)

and after this is the log that is recorded in my geth -

Submitted contract creation fullhash=0x3c49a20a7791a45ddbea222bd9df4bc6071388d678a06b2a5d3d58ae29e3cbc8 contract=0x41B0811e70D135540B0589bC578922995AdB167D

Not sure if this is the expected behavior ?

Unable to make REST service call using oraclize_query deployed on in same environment as Ethereum Network and Bridge

Hi,
I have successfully called webservices residing on internet using Oraclize, but when I am trying to call a REST service which is deployed locally on the same network where my ethereum network & bridge has been setup, it fails.

Doesn't oraclize support API calls which are not available on internet as mentioned in issue##18?
Ethereurm bridge has been installed on private blockchain and using broadcast mode to make the API calls. Hosted on Ubuntu machine.
Using Truffle to test the smart contract(attached).

Thanks,
TestOraclizeCall.txt

Add `bin` directive to project.json

The documentation here is a bit unclear in describing how to get the bridge running. The fact that it must be run from the install directory may be obvious to more experience node developers, but to node beginners it takes a bit of a logical leap.

A simple update of the documentation to indicate that you must either specify the full path to bridge.js or cd to the install directory would be very helpful.

For a more complete solution, I believe that it's possible to add a bin directive to the project's package.json. That adds an symlink to the executable in the npm bin directory for that project, enabling node to execute the proper script when node bridge is executed from the command line.

callback error

after triggering the oracle i get this error in the bridge terminal:

[2017-10-13T14:36:20.749Z] INFO sending __callback tx...
	{
    "contract_myid": "0x8e23b2147e8db2173336116c3f4fe2951e7a2b0c419fc21acb71c4f763f85c42",
    "contract_address": "0xbd31352798e53c1133c1ccf762a822e1da0a3948"
}
[2017-10-13T14:36:20.796Z] ERROR callback tx error, contract myid: 0x8e23b2147e8db2173336116c3f4fe2951e7a2b0c419fc21acb71c4f763f85c42
[2017-10-13T14:36:20.806Z] ERROR transaction hash not found, callback tx database not updated

HTTP query create request error

I am trying to run the Oraclize service on my Ethereum based private blockchain, after deploying the connector and OAR contracts, i am facing issues in getting the callback on the contract.

Here are the logs

[2024-01-29T11:18:09.267Z] DEBUG oraclize HTTP create query body response error code: 522 [2024-01-29T11:18:09.267Z] ERROR HTTP query create request error { "error": "undefined error", "fatal": false }

The server at https://api.oraclize.it is not working, hence query creation is throwing errors. Can someone check ?

infinite "eth_getFilterChanges" messages...

I am not sure it is the ethereum-bridge problem or not. But my testrpc works fine with my normal test script. But, as soon as I run node ethereum-bridge, node bridge -H -a 1 --dev, I got infinite "eth_getFilerChanges" on my testrpc log screen, and never end.
I didn't run any of my script except the ethereum-bridge.

image

Error: More than one instance of bitcore-lib found.

After cloning the repo and running npm install, I try to node bridge -H localhost:8545 -a 1 but this is what I get :

/home/louis/Adventures/Oraclize/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12
    throw new Error(message);
    ^

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (/home/louis/Adventures/Oraclize/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:12:11)
    at Object.<anonymous> (/home/louis/Adventures/Oraclize/ethereum-bridge/node_modules/bitcore-mnemonic/node_modules/bitcore-lib/index.js:15:9)
    at Module._compile (module.js:612:30)
    at Object.Module._extensions..js (module.js:623:10)
    at Module.load (module.js:531:32)
    at tryModuleLoad (module.js:494:12)
    at Function.Module._load (module.js:486:3)
    at Module.require (module.js:556:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/louis/Adventures/Oraclize/ethereum-bridge/node_modules/bitcore-mnemonic/lib/mnemonic.js:3:15)

Also, running npm find-dupes bitcore-lib gives back

remove	inherits	2.0.1	node_modules/bitcore-lib/node_modules/inherits

I'll directly test my contracts on ropsten for the time being.

Thank you very much for this great service ๐Ÿ‘

Unable to use as npm dependency

I added the github url to my npm dependency list like so

"node-bridge": "git://github.com/oraclize/ethereum-bridge#9dd3c06714ada82c7f006901426497c870e14c61"

but when I try to run node bridge from the node_modules folder of my project, it seems that it is missing some files and errors out. It would be nice if the project supported being used as a dependency. Or even better if I could install the package globally npm -g ethereum-bridge and then just use the bridge command.

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.