Chainlink Developers

Welcome to the Chainlink documentation site. You'll find comprehensive guides and documentation to help you start working with Chainlink as quickly as possible, as well as support if you get stuck. Click here for an introductory walkthrough on how to create a Chainlink request on the Ropsten test network!

Building on Chainlink? Click here to get started!

Get Started

Use your first contract!

  • Navigate back to Remix.
  • On the left side panel you will see a list of functions of your contract.
  • In our example contract there are 3 functions that you can use to request external data from Chainlink. requestEthereumChange, requestEthereumLastMarket and requestEthereumPrice
  • For this example we will use requestEthereumPrice.
  • In the input field to the right of requestEthereumPrice, copy the text below to request the price of ETH in United States Dollars. The first parameter is the oracle contract address, and the second parameter is the Job ID. You will need to include the quotes.
"0xc99B3D447826532722E41bc36e644ba3479E4365", "3cff0a3524694ff8834bda9cf9c779a1"
"0xc99B3D447826532722E41bc36e644ba3479E4365", "46a7c3f9852e46e09350ad5af92ce86f"
"0xc99B3D447826532722E41bc36e644ba3479E4365", "76ca51361e4e444f8a9b18ae350a5725"
  • Click on the requestEthereumPrice button.
  • MetaMask will pop-up to confirm the transaction, click Confirm. (If you get a gas estimation failed message here, make sure the contract is funded with LINK.)
  • Once the transaction confirms, you can visit the Ropsten Chainlink Explorer in order to view the status of your request. Search for either the address of your contract or your requesting transaction ID and you should see an update from the Chainlink node. You can refresh the page to keep up-to-date with the status, and when the response is confirmed, you can view the result in your contract.
  • To verify that your request was fulfilled, click on the blue currentPrice button. If the value after uint256 displays 0 then the request has not be fulfilled yet. Wait a little longer since the Chainlink node will wait for 3 block confirmations before fulfilling your request. Otherwise, it will show you the current price of ETH multiplied by 100. This weird looking output is by design, as the ETH protocol cannot display decimal values. In our example, the currentPrice returned 20743 which represents $207.43 USD.

If you see a value for the currentPrice variable, then Chainlink has successfully responded to your contract with the current price of ETH. Now you're ready to write more complex smart contracts that execute based on real-world data.

Updated 2 months ago


Use your first contract!


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.