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

Chainlink Alarm Clock (Testnet)

You can use Chainlink to trigger a smart contract at a specified time. Using this Chainlink, you will create a request with a timestamp for the node to call back to your desired function. You can include additional logic in that function to perform additional computation.

Steps for using this oracle

Chainlink Network Details

You will need to use the following LINK token address, oracle address, and JobSpec ID in order to create the Chainlink request.

Ropsten

LINK Token address: 0x20fE562d797A42Dcb3399062AE9546cd06f63280
Oracle address: 0xc99B3D447826532722E41bc36e644ba3479E4365
JobID: 6b0d36db9a7347aabffffc74a0caf977

Rinkeby

LINK token address: 0x01BE23585060835E02B77ef475b0Cc51aA1e0709
Oracle address: 0x7AFe1118Ea78C1eae84ca8feE5C65Bc76CcF879e
JobID: 4fff47c3982b4babba6a7dd694c9b204

Kovan

LINK token address: 0xa36085F69e2889c224210F603D836748e7dC0088
Oracle address: 0x2f90A6D021db21e1B2A077c5a37B3C7E75D15b7e
JobID: a7ab70d561d34eb49e9b1612fd2e044b

Create your Chainlinked contract

Import Chainlinked.sol into your contract so you can inherit the Chainlinked behavior.

pragma solidity ^0.4.24;

import "chainlink/contracts/ChainlinkClient.sol";

contract ChainlinkAlarmClock is ChainlinkClient {

  uint256 oraclePayment;

  constructor(uint256 _oraclePayment) public {
    setPublicChainlinkToken();
    oraclePayment = _oraclePayment;
  }
  // Additional functions here:
  
}

Tasks

Request Parameters

until

Required

The timestamp for which the Chainlink node will wait to respond.

Solidity example

req.addUint("until", now + 5 minutes);

Chainlink Examples

This example shows how to create the request for the Chainlink node:

function delayStart
(
  address _oracle,
  bytes32 _jobId
)
  public
  onlyOwner
{
  Chainlink.Request memory req = buildChainlinkRequest(_jobId, this, this.fulfill.selector);
  req.addUint("until", now + 5 minutes);
  sendChainlinkRequestTo(_oracle, req, oraclePayment);
}

This example shows the callback method:

function fulfill(bytes32 _requestId)
  public
  recordChainlinkFulfillment(_requestId)
{
  /* additional computation here */
}

Chainlink Alarm Clock (Testnet)


Suggested Edits are limited on API Reference Pages

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