Oracles with Chainlink on Ethereum networks tutorial series

Adam Z. Nagy
3 min readNov 27, 2019

--

Parts

Oracles

It is often the case that your smart contracts need external data feed in order to do their proper job. Smart contracts cannot reach out to the external world to fetch data, cannot schedule transactions, so they rely on external entities/third parties to do this which we call Oracles. When you need to “blockchainize” real world information, Oracles are always there in one form or another. The flipside though: they introduce heavy trust assumptions in your otherwise trustless system. How can you trust an external data source? What if there is malicious intent, the source gets compromised or data never arrives? These are not trivial issues.

Chainlink’s value proposition

Chainlink aims to bridge the on-chain & off-chain world with decentralized Oracles, eliminating single-point-of-failures and unconditional trust in centralized Oracle services. They provide this in a hassle-free manner for contract creators and developers so they can focus on what actually matters: their use case. As you will see, setting up Chainlink nodes and getting integrated at smart contract level is surprisingly easy.

Chainlink integration has arrived to EWF’s chains

The aim of this series

I like to be hands-on so expect hands-on stuff and some bonus memes. We will:

  • Learn how to set up a Chainlink node and use it from a smart contract on our public Ethereum testnet, Volta.
  • Learn how to aggregate the answers of multiple Oracles, and how to use the public EWT/EUR Price Pair Oracle infrastructure on Volta.
  • Learn some design principles around Chainlink oracles.
  • Philosophize about when does it makes sense to use Chainlink.

Why Volta? B̶e̶c̶a̶u̶s̶e̶ ̶I̶ ̶m̶a̶d̶e̶ ̶i̶t̶.̶ We at EnergyWeb created the world’s largest energy blockchain ecosystem with more than 100 companies and 2 enterprise-grade blockchain platforms: the Energy Web Chain and a related testnet called Volta. They are Ethereum chains with Parity’s AuRa Proof-of-Authority consensus engine, 25+ reputable energy corporates as validators, rock stability and 5s block times. Thus, even if you are not doing anything energy specific it is worth to use Volta as a live Ethereum testnet because from a dev perspective it is the same. You can get started here.

Since more and more of our projects need some kind of Oracle service, the time has come to look into it and set the Chainlink infrastructure up on our chain as well. I decided to document my journey and share the outcome of my experimentation in form of a tutorial series as a pledge to the open source community. Naturally, everything is applicable to any other Ethereum network too.

Need help with your blockchain based project? Shoot me a mail: adam.zsolt.nagy@gmail.com
Did you learn something useful? Made your job easier? Tips are welcome too: Ethereum: 0x74dd76E24B2CFB43C1b1a4498295d553D0843746

--

--