Front-end is generated with vue-cli version 3.2.1
Basic Ethereum Oracle example including Oraclize, Truffle, Coinbase API, Web3
Get the current ETH/USD price from the Coinbase API through an Ethereum Oracle
npm install
Install Truffle (Works on the truffle version below, newer versions might get a compile error later on)
npm install -g truffle@4.1.15
truffle develop
npm run bridge
Wait till it is fully loaded and you see the following message
Please add this line to your contract constructor:
OAR = OraclizeAddrResolverI(address);
truffle(develop)> compile
truffle(develop)> migrate --development --reset
Output should be something like this
"contract_myid": "0x9fa87c542cab950bd129f3d2d13cba6199741bd1984351c04e83c54620dfee1b",
"contract_address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10"
let myContract = new web3.eth.Contract(
MyContract.abi,
//Your contract address
"0x345ca3e014aaf5dca488057592ee47305d9b3e10"
);
npm run serve
Enjoy!