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!

Contract Creators

As a contract creator, you can specify an external adapter in the job spec of your service agreement by providing its name as a task type.

For example:

{
  "initiators": [
    { "type": "runLog" }
  ],
  "tasks": [
    { "type": "randomNumber" },
    { "type": "copy",
      "params": {"copyPath": ["details", "current"]}},
    { "type": "multiply",
      "params": {"times": 100 }},
    { "type": "ethuint256" },
    { "type": "ethtx" }
  ]
}

Notice the use of the "randomNumber" task in the spec above. Since this is not a core adapter, it is an external adapter that each node on the request needs to have in order to fulfill the request.

Using the Copy adapter with an External Adapter

The Copy adapter allows for the same functionality of the JSONParse adapter but for getting data from the external adapter's response.

For example, if an adapter returns JSON data like what is below:

{
    "firstValue": "SomeValue",
    "details": {
        "close": "100",
        "open": "110",
        "current": "111"
    },
    "other": "GetData"
}

And you wanted the value in the field "open", you would specify the path for the adapter to walk through the JSON object to your desired field.

"copyPath": ["details", "open"]

In Solidity, this would look like:

string[] memory path = new string[](2);
path[0] = "details";
path[1] = "open";
run.addStringArray("copyPath", path);