Ethereum-Dollar price oracle that calls upon Binance's public API.
Blockchain oracles are third-party services that provide smart contracts with external information. Oracles provide a link between off-chain and on-chain data and are vital within the blockchain ecosystem because they broaden the scope in which smart contracts can operate.
- Make sure caller and oracle smart contracts are already deployed on the chain.
- Configure
.env
for./client
cp .env-sample .env
- Configure
.env
in./server
cd ./server
cp .env-sample .env
- Compile server binary
cd ./server
cargo build --release
- run the oracle service
cd ./server
RUST_LOG=info ./target/release/oracle-service
- install dependency
yarn
- Call
updateEthPrice
function and listenPriceUpdatedEvent
event
yarn start client/src/caller-core.ts