Chainlink
$27.16 -1.79%
LINK · 2w

Convert a Vending Machine to Accept Cryptocurrency Payments Using Chainlink Price Feeds

What would it take to upgrade a vending machine so it can accept cryptocurrency?

For automated real-world systems to allow people to transact in their currency of choice, including cryptocurrency, these external systems need the ability to speak to blockchains and exchange transactional logic that makes sense to both environments. Chainlink oracles are the bridge between these systems, designed to securely connect external inputs to smart contracts.

As an excellent example of this real-world connectivity, one of the Chainlink Virtual Hackathon prize winners, developer Ted Nivan, used a Chainlink External Adapter to connect a simulated fruit vending machine to a Chainlink ETH/USD Price Feed oracle so it can accept ETH as the currency to buy single-serving fruit. In this post, Ted explains how he built it.

By Ted Nivan

Fruity Market is an open proof of concept designed to experiment with a new way to make vending machine purchases using cryptocurrencies. Using Fruity Market, a user will be able to make a vending machine purchase using blockchain technology on a mobile phone wallet without a cashier. Specifically, this tutorial will show developers the steps needed to convert a vending machine to use ETH as money by referencing the Chainlink ETH/USD Price Feed to price products at fair market prices.

What you will learn:

How to integrate the Chainlink ETH/USD Price Feed oracle How to connect a hardware device to the web Developer Prerequisites

This dApp requires both software and hardware components.

Software:

Infura: Used to connect to the Ethereum network. As a developer you will need an Infura key. Web3JS: Used by the front-end to interact with the Ethereum network. WebUSB: Used to talk to the hardware device through the web. Arduino IDE: Used to flash the device's firmware.

Hardware:

A server or laptop is required to act as the host. Arduino Nano 33 IoT: Used as the...
Continue on blog.chain.link
Recent news