Chainlink is middleware to simplify communication with blockchains.Here you'll find the Chainlink Golang node, currently in alpha.This initial implementation is intended for use and review by developers,and will go on to form the basis for Chainlink's decentralized oracle network.Further development of the Chainlink Node and Chainlink Network will happen here,if you are interested in contributing please see our contribution guidelines.
Examples of how to utilize and integrate Chainlinks can be found in the Chainlink Truffle Box.
Chainlink has an active and ever growing community. Discordis the primary communication channel used for day to day communication,answering development questions, and aggregating Chainlink related content. Takea look at the community docs for more informationregarding Chainlink social accounts, news, and networking.
export PATH=$GOPATH/bin:$PATH
& export GOPATH=/Users/$USER/go
nvm install 12.18 && nvm use 12.18
git clone https://github.com/smartcontractkit/chainlink && cd chainlink
make install
yarn install
before this stepyarn install
throws a network connection error, try increasing the network timeout by running yarn install --network-timeout 150000
before this stepchainlink help
In order to run the Chainlink node you must have access to a running Ethereum node with an open websocket connection.Any Ethereum based network will work once you've configured the chain ID.Ethereum node versions currently tested and supported:
NOTE: By default, chainlink will run in TLS mode. For local development you can either disable this by setting CHAINLINK_DEV to true, or generate self signed certificates using tools/bin/self-signed-certs
or manually.
To start your Chainlink node, simply run:
chainlink node start
By default this will start on port 6688, where it exposes a REST API.
Once your node has started, you can view your current jobs with:
chainlink jobs list
View details of a specific job with:
chainlink job show [$JOB_ID]
To find out more about the Chainlink CLI, you can always run chainlink help
.
Check out the doc pages on Jobs to learn more about how to create Jobs.
You can configure your node's behavior by setting environment variables. All the environment variables can be found in the ConfigSchema
struct of schema.go
. You can also read the official documentation to learn the most up to date information on each of them. For every variable, default values get used if no corresponding environment variable is found.
Chainlink is a monorepo containing several logically separatable and relatableprojects.
External adapters are what make Chainlink easily extensible, providing simple integration of custom computations and specialized APIs.A Chainlink node communicates with external adapters via a simple REST API.
For more information on creating and using external adapters, please see our external adapters page.
For the latest information on setting up a development environment, see the guide here.
go build -o chainlink ./core/
./chainlink
make mockery
Using the make
command will install the correct version.
yarn
yarn setup:contracts
go generate ./...
go run ./packr/main.go ./core/services/eth/
export DATABASE_URL=postgresql://127.0.0.1:5432/chainlink_test?sslmode=disable
export CHAINLINK_DEV=true # I prefer to use direnv and skip this
go run ./core/main.go local db preparetest
If you do end up modifying the migrations for the database, you will need to rerun
go test -parallel=1 ./...
Inside the contracts/
directory:
yarn
yarn test
Go generate is used to generate mocks in this project. Mocks are generated with mockery and live in core/internal/mocks.
A flake is provided for use with the Nixpackage manager. It defines a declarative, reproducibledevelopment environment.
To use it:
nix develop
. You will be put in shell containing all the dependencies.Alternatively, a direnv
integration exists to automatically change theenvironment when cd
-ing into the folder.cd $PGDATA/
initdb
pg_ctl -l $PGDATA/postgres.log -o "--unix_socket_directories='$PWD'" start
createdb chainlink_test -h localhost
createuser --superuser --no-password chainlink -h localhost
pg_ctl -l $PGDATA/postgres.log -o "--unix_socket_directories='$PWD'" start
Now you can run tests or compile code as usual.
For more tips on how to build and test Chainlink, see our development tips page.
Chainlink's source code is licensed under the MIT License, and contributions are welcome.
Please check out our contributing guidelines for more details.
Thank you!
Chainlink 2022 年秋季黑客马拉松已于 12 月 7日结束,从本次黑客马拉松的数据中,可以清楚地看到,Web3 创业者们正在以惊人的速度速度创新。 本次 Chainlink 黑客马拉松吸引了来自全球各地团队的 10,000 多个参赛者报名,最终提交浪超过 380 个项目,这两项数据均打破了过去的记录。Chainlink 提供了 30 多个小时的开发教程,让新一代的开发者能够开始在区块链
获取 价格 // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; contract PriceConsumerV3 { AggregatorV3Interface inter
本文环境: 操作系统:Windows 11家庭版(64 位) 测试工具:Remix IDE + MetaMask 7.7.9 合约源码:https://github.com/smartcontractkit/chainlink/tree/develop/contracts 参考文档:Consuming Data Feeds | Cha