This article was first published on Chainlink
As the Chainlink Virtual Hackathon’s Grand Prize winners, smart contract developers Harry Papacharissiou and Matt Durkin used a Chainlink External Adapter to connect a Tesla Vehicle API to a Chainlink oracle for a peer-to-peer vehicle rental app. Their Tesla smart contract is a great example of how Chainlink can be used to connect off-chain APIs to smart contracts and enable completely new business models. In this post, Harry and Matt walk through how they created the implementation.
Chainlink’s External Adapter feature makes it easy to connect smart contracts to any API, enabling a variety of use cases for smart contracts to trigger off-chain events and bring tamper-proof digital agreements to external systems.
Tesla, Inc. produces a range of innovative electric vehicles equipped with technologically advanced functionality and features. One of these features is a rich API that can provide an authenticated client with a wealth of vehicle data, as well as access to perform various state-changing functions on vehicles remotely.
Consuming this API through an External Adapter and Chainlink node allows our Tesla smart contract to fully integrate with a Tesla vehicle, which opens up several unique use cases.
In this technical article, we’ll go through:
- How to use the Tesla External Adapter to interact with the Tesla API
- How to write a smart contract to use the Tesla External Adapter via a Chainlink node to get vehicle data and modify the state of the vehicle
The Tesla API
The official Tesla mobile app gives Tesla vehicle owners access to data such as vehicle location, odometer reading, the vehicle's battery charge state, and more, as shown in the vehicle data API. The mobile app also allows users to perform various remote commands, such as locking and unlocking the vehicle, remotely starting it, ...
To keep reading, please go to the original article at: