Trying to perform a basic query using ethereum bridge / ganache / truffle.
I appear to have Ethereum bridge running correctly.
iPod-Classic-3:ethereum-bridge benandre$ node bridge -H localhost:7545 --broadcast -a 0
Please wait...
[2018-03-04T11:46:28.162Z] INFO you are running ethereum-bridge - version: 0.5.5
[2018-03-04T11:46:28.163Z] INFO saving logs to: ./bridge.log
[2018-03-04T11:46:28.164Z] INFO using broadcast mode
[2018-03-04T11:46:28.164Z] INFO Connecting to eth node http://localhost:7545
[2018-03-04T11:46:29.217Z] INFO connected to node type EthereumJS TestRPC/v3.0.0-beta.0/ethereum-js
[2018-03-04T11:46:29.586Z] WARN Using 0xcd7f4a4af40f291f9f2bf1cf538fb44a6c94e4dc to query contracts on your blockchain, make sure it is unlocked and do not use the same address to deploy your contracts
[2018-03-04T11:46:29.681Z] WARN 0xcd7f4a4af40f291f9f2bf1cf538fb44a6c94e4dc doesn't have enough funds to cover transaction costs, please send at least 0.05 ETH
Authorize the bridge to move funds automatically from your node? [Y/n]: Y
Please choose the unlocked account index number in your node: 7
send 0.05 ETH from account 0x0f4f2ac550a1b4e2280d04c21cea7ebd822934b5 (index n.: 7) to 0xcd7f4a4af40f291f9f2bf1cf538fb44a6c94e4dc ? [Y/n]: Y
[2018-03-04T11:46:39.797Z] INFO received funds
[2018-03-04T11:46:39.799Z] INFO deploying the oraclize connector contract...
[2018-03-04T11:46:50.336Z] INFO connector deployed to: 0x5daf19eb687b6e9bc96b7920e7a1206f2c1e2555
[2018-03-04T11:46:50.430Z] INFO deploying the address resolver with a deterministic address...
[2018-03-04T11:47:11.640Z] INFO address resolver (OAR) deployed to: 0x6f485c8bf6fc43ea212e93bbf8ce046c7f1cb475
[2018-03-04T11:47:11.640Z] INFO updating connector pricing...
[2018-03-04T11:47:22.600Z] INFO successfully deployed all contracts
[2018-03-04T11:47:22.604Z] INFO instance configuration file saved to /Users/benandre/ethereum-bridge/config/instance/oracle_instance_20180304T064722.json
Please add this line to your contract constructor:
OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
[2018-03-04T11:47:22.611Z] WARN re-org block listen is disabled while using TestRPC
[2018-03-04T11:47:22.611Z] WARN if you are running a test suit with Truffle and TestRPC or your chain is reset often please use the --dev mode
[2018-03-04T11:47:22.612Z] INFO Listening @ 0x5daf19eb687b6e9bc96b7920e7a1206f2c1e2555 (Oraclize Connector)
This is a contract that I have written.
contract testContract is usingOraclize {
event callback_received(string goodies);
function __callback(bytes32 myid, string result) {
callback_received(result);
}
function testQuery() {
oraclize_query("URL", "json(http://api.fixer.io/latest?symbols=USD,GBP).rates.GBP");
}
function testContract() {
OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
}
}
I have a truffle test that calls the testQuery function.
ethereum bridge does seem to hear the request, which is good. However, it immediately errors out with this message that nobody seems to have has posted about on google. What does it mean? Database saywhatnow?
**Error: Key not found in database
at Object.InvalidResponse (/Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/errors.js:38:16)
at RequestManager.send (/Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:61:22)
at Eth.send [as getBlock] (/Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/method.js:145:58)
at parseLog (/Users/benandre/ethereum-bridge/lib/bridge-log-manager.js:130:59)
at /Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/filter.js:120:21
at Array.forEach (native)
at /Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/filter.js:119:32
at Array.forEach (native)
at Object.onMessage [as callback] (/Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/filter.js:117:22)
at /Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:259:20
at Array.forEach (native)
at /Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:258:12
at XMLHttpRequest.request.onreadystatechange (/Users/benandre/ethereum-bridge/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/benandre/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/Users/benandre/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/Users/benandre/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:509:12)**
Edit:
I am getting the same error in active mode.
iPod-Classic-3:ethereum-bridge benandre$ node bridge -H localhost:7545 -a 1 --dev
Please wait...
[2018-03-06T20:15:08.714Z] WARN --dev mode active, contract myid checks and pending queries are skipped, use this only when testing, not in production
[2018-03-06T20:15:08.715Z] INFO you are running ethereum-bridge - version: 0.5.5
[2018-03-06T20:15:08.715Z] INFO saving logs to: ./bridge.log
[2018-03-06T20:15:08.716Z] INFO using active mode
[2018-03-06T20:15:08.716Z] INFO Connecting to eth node http://localhost:7545
[2018-03-06T20:15:10.246Z] INFO connected to node type EthereumJS TestRPC/v3.0.0-beta.0/ethereum-js
[2018-03-06T20:15:10.608Z] WARN Using 0xf17f52151ebef6c7334fad080c5704d77216b732 to query contracts on your blockchain, make sure it is unlocked and do not use the same address to deploy your contracts
[2018-03-06T20:15:10.701Z] INFO deploying the oraclize connector contract...
[2018-03-06T20:15:21.042Z] INFO connector deployed to: 0xb9a219631aed55ebc3d998f17c3840b7ec39c0cc
[2018-03-06T20:15:21.134Z] INFO deploying the address resolver with a deterministic address...
[2018-03-06T20:15:42.197Z] INFO address resolver (OAR) deployed to: 0x6f485c8bf6fc43ea212e93bbf8ce046c7f1cb475
[2018-03-06T20:15:42.197Z] INFO updating connector pricing...
[2018-03-06T20:15:52.936Z] INFO successfully deployed all contracts
[2018-03-06T20:15:52.941Z] INFO instance configuration file saved to /Users/benandre/bridge/ethereum-bridge/config/instance/oracle_instance_20180306T151552.json
Please add this line to your contract constructor:
OAR = OraclizeAddrResolverI(0x6f485C8BF6fc43eA212E93BBF8ce046C7f1cb475);
[2018-03-06T20:15:52.951Z] WARN re-org block listen is disabled
[2018-03-06T20:15:52.951Z] INFO Listening @ 0xb9a219631aed55ebc3d998f17c3840b7ec39c0cc (Oraclize Connector)
(Ctrl+C to exit)
Error: Key not found in database
at Object.InvalidResponse (/Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/errors.js:38:16)
at RequestManager.send (/Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:61:22)
at Eth.send [as getBlock] (/Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/method.js:145:58)
at parseLog (/Users/benandre/bridge/ethereum-bridge/lib/bridge-log-manager.js:130:59)
at /Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/filter.js:120:21
at Array.forEach (native)
at /Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/filter.js:119:32
at Array.forEach (native)
at Object.onMessage [as callback] (/Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/filter.js:117:22)
at /Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:259:20
at Array.forEach (native)
at /Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/requestmanager.js:258:12
at XMLHttpRequest.request.onreadystatechange (/Users/benandre/bridge/ethereum-bridge/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequestEventTarget.dispatchEvent (/Users/benandre/bridge/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/Users/benandre/bridge/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/Users/benandre/bridge/ethereum-bridge/node_modules/xhr2/lib/xhr2.js:509:12)