{"id":20314387,"url":"https://github.com/dlc-link/stacks-chainlink-documentation","last_synced_at":"2025-10-30T04:03:45.059Z","repository":{"id":54774107,"uuid":"478090154","full_name":"DLC-link/stacks-chainlink-documentation","owner":"DLC-link","description":"This repo holds updated details for setting up a Chainlink on Stacks node","archived":false,"fork":false,"pushed_at":"2022-06-08T15:12:23.000Z","size":26,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T13:11:32.412Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DLC-link.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-05T11:04:44.000Z","updated_at":"2023-02-13T12:07:35.000Z","dependencies_parsed_at":"2022-08-14T02:20:52.972Z","dependency_job_id":null,"html_url":"https://github.com/DLC-link/stacks-chainlink-documentation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLC-link%2Fstacks-chainlink-documentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLC-link%2Fstacks-chainlink-documentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLC-link%2Fstacks-chainlink-documentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DLC-link%2Fstacks-chainlink-documentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DLC-link","download_url":"https://codeload.github.com/DLC-link/stacks-chainlink-documentation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447609,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:15:04.427Z","updated_at":"2025-10-30T04:03:44.965Z","avatar_url":"https://github.com/DLC-link.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chainlink on Stacks\n\nThanks to the team at [TinTash](https://bitbucket.org/tintash/), this project is based heavily on their initial work on [Chainlink integration onto Stacks](https://bitbucket.org/tintash/chainlink-integration/src/master/)\n\nUsing [Chainlink](https://chain.link) DRM (Direct Request Model) Oracles on [Stacks](https://stacks.org).\n\nTo enable chainlink oracle usage on stacks we have deployed a Chainlink Node with it's related smart contracts:\n\n```\noracle:         ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.oracle\nstxlink-token:  ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM.stxlink-token\n```\n\nTo test the system you can use the deployed `direct-request` contract. `contract-call.js` has code that calls\nthis contract to fetch ETH/USD price. After a successful call you can extract the data from the contract by calling the `read-data-value` function to get the response that is stored in the `data-value` variable in the contract:\n\n```\ncurl -X POST https://stacks-node-api.testnet.stacks.co/v2/contracts/call-read/ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM/direct-request/read-data-value \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n\"sender\": \"ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM\",\n\"arguments\":[] }'\n```\n\nThis will give the response in the form of hex. You can decode it to string.\n\n## Examples\n\nWell commented example codes for both a consumer contract and the usage of it are available in this repository under `src/`.\n\n## Writing a consumer contract\n\nTo utilize the oracle you need to write your own consumer contract. An example contract is available in this\nrepository (`direct-request.clar`).\n\nYou will need to implement the traits `.oracle-callback-trait.oracle-callback` and `.stxlink-transfer-trait.stxlink-transfer-trait`.\n\n## Getting STXLINK tokens\n\nTo call the oracle contract you will need to have STXLINK tokens. To get these go to the [STXLINK Faucet](https://stx-link-faucet.dlc.link/) page and input a valid STX address.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlc-link%2Fstacks-chainlink-documentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdlc-link%2Fstacks-chainlink-documentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdlc-link%2Fstacks-chainlink-documentation/lists"}