How to use an Oracle in a Ethereum Smart-contract

Maxime Atton
Coinmonks

--

An Oracle is a source of external data that can be used in a smart contract. Oracles provide a way for smart contracts to interact with external data and trigger contract execution based on that data.

Chainlink is a decentralized oracle network that allows smart contracts to securely access off-chain data feeds, web APIs, and traditional bank payments. It provides a reliable and secure connection to external data sources and ensures that the data delivered to the smart contract is accurate and tamper-proof.

In this article, we will demonstrate how to use an Oracle in a Ethereum smart contract to fetch the price of bitcoin from Coinmarketcap, a popular cryptocurrency price tracking website, using REMIX IDE and Chainlink.

Set up a Chainlink node

Before we can use Chainlink to fetch data in our smart contract, we need to set up a Chainlink node.

A Chainlink node is a server that runs the Chainlink software and is responsible for executing on-chain requests for data and returning the results to the requesting contract.

To set up a Chainlink node, follow these steps:

  1. Go to the Chainlink documentation and follow the instructions for setting up a local node.

--

--

Maxime Atton
Coinmonks

Decentralized Finance & Digital Assets specialist.