For educational purposes. Supplement to this ewf wiki post. The examples were taken from the oraclize/ethereum-examples repo, then extended/modified to make them more wholesome.
Tested with Parity client version 1.11.6 Beta.
- Connection to Tobalaba. For a tutorial on how to set up a local Parity client and connect to the network, check here.
- Two accounts with some test Ethers in it. You can use the Parity UI for this purpose, then navigate to the faucet to get some ethers.
- Ethereum-bridge
- Truffle
After you have the Parity client running, you need to set up a connection between the private network and Oraclize:
git clone https://github.com/oraclize/ethereum-bridge.git
cd ethereum-bridge
npm install
Then:
node bridge -H localhost:8545 -a 1
When the bridge is launched, sometimes you see the following in the console:
Please add this line to your contract constructor:
OAR = OraclizeAddrResolverI(<an address here>);
You have to add this line to the smart contract constructors. Just replace the existing one.
When you stop the bridge, you see something like this:
To load this instance again: ethereum-bridge --instance oracle_instance_20180813T181443.json
Exiting...
Which means you can run the bridge next time with:
node bridge --instance oracle_instance_20180813T181443.json
and have the same OAR address.
- Make sure your parity client is running and configured to connect to Tobalaba
- Launch ethereum-bridge
- Clone repo, install web3 (the new 1.x version)
git clone https://github.com/ngyam/tutorial-oraclize.git
cd tutorial-oraclize
npm install web3
- Migrate, or run the tests
truffle test --network tobalaba
truffle migrate --network tobalaba