# Using docker-compose for local development
The docker-compose configuration present in this directory allows for a user to quickly setup all of chainlink's services to perform actions like integration tests, acceptance tests, and development across multiple services.
# Requirements
- [docker-compose](https://docs.docker.com/compose/install/)
# Using the compose script
Inside the `chainlink/tools/docker` directory, there is a helper script that is included which should cover all cases of integration / acceptance / development needs acroos multiple services. To see a list of available commands, perform the following:
```sh
cd tools/docker
./compose help
```
## Examples
### Acceptance testing
Acceptance can be accomplished by using the `acceptance` command.
```sh
./compose acceptance
```
- The explorer can be reached at `http://localhost:8080`
- The chainlink node can be reached at `http://localhost:6688`
Credentials for logging into the operator-ui can be found [here](../../tools/secrets/apicredentials)
###
### Doing local development on the core node
Doing quick, iterative changes on the core codebase can still be achieved within the compose setup with the `cld` or `cldo` commands.
The `cld` command will bring up the services that a chainlink node needs to connect to (explorer, parity/geth, postgres), and then attach the users terminal to a docker container containing the host's chainlink repository bind-mounted inside the container at `/usr/local/src/chainlink`. What this means is that any changes made within the host's repository will be synchronized to the container, and vice versa for changes made within the container at `/usr/local/src/chainlink`.
This enables a user to make quick changes on either the container or the host, run `cldev` within the attached container, check the new behaviour of the re-built node, and repeat this process until the desired results are achieved.
```sh
./compose cld
#
# Now you are inside the container
cldev # cldev without the "core" postfix simply calls the core node cli
#
# NAME:
# main - CLI for Chainlink
#
# USAGE:
# main [global options] command [command options] [arguments...]
#
# VERSION:
# unset@unset
#
# COMMANDS:
# admin Commands for remotely taking admin related actions
# bridges Commands for Bridges communicating with External Adapters
# config Commands for the node's configuration
# jobs Commands for managing Jobs
# node, local Commands for admin actions that must be run locally
# runs Commands for managing Runs
# txs Commands for handling Ethereum transactions
# agreements, agree Commands for handling service agreements
# attempts, txas Commands for managing Ethereum Transaction Attempts
# createextrakey Create a key in the node's keystore alongside the existing key; to create an original key, just run the node
# initiators Commands for managing External Initiators
# help, h Shows a list of commands or help for one command
#
# GLOBAL OPTIONS:
# --json, -j json output as opposed to table
# --help, -h show help
# --version, -v print the version
cldev core # import our testing key and api credentials, then start the node
#
# ** Importing default key 0x9ca9d2d5e04012c9ed24c0e513c9bfaa4a2dd77f
# 2019-12-11T20:31:18Z [INFO] Locking postgres for exclusive access with 500ms timeout orm/orm.go:74 #
# 2019-12-11T20:31:18Z [WARN] pq: relation "migrations" does not exist migrations/migrate.go:149
# ** Running node
# 2019-12-11T20:31:20Z [INFO] Starting Chainlink Node 0.7.0 at commit 7324e9c476ed6b5c0a08d5a38779d4a6bfbb3880 cmd/local_client.go:27
# ...
# ...
```
`cldo` allows the user to perform the same actions above, but also applied to the operator-ui codebase and the core codebase. The operator-ui will be hosted in hot-reload/development mode at `http://localhost//3000`. To see the build progress of operator-ui, we can open another terminal to watch its output while we can mess around with the core node in the original terminal.
In the first terminal:
```sh
./compose cldo
#
# Now you are inside the container
cldev # cldev without the "core" postfix simply calls the core node cli
#
# NAME:
# main - CLI for Chainlink
#
# USAGE:
# main [global options] command [command options] [arguments...]
#
# VERSION:
# unset@unset
#
# COMMANDS:
# admin Commands for remotely taking admin related actions
# bridges Commands for Bridges communicating with External Adapters
# config Commands for the node's configuration
# jobs Commands for managing Jobs
# node, local Commands for admin actions that must be run locally
# runs Commands for managing Runs
# txs Commands for handling Ethereum transactions
# agreements, agree Commands for handling service agreements
# attempts, txas Commands for managing Ethereum Transaction Attempts
# createextrakey Create a key in the node's keystore alongside the existing key; to create an original key, just run the node
# initiators Commands for managing External Initiators
# help, h Shows a list of commands or help for one command
#
# GLOBAL OPTIONS:
# --json, -j json output as opposed to table
# --help, -h show help
# --version, -v print the version
cldev core # import our testing key and api credentials, then start the node
#
# ** Importing default key 0x9ca9d2d5e04012c9ed24c0e513c9bfaa4a2dd77f
# 2019-12-11T20:31:18Z [INFO] Locking postgres for exclusive access with 500ms timeout orm/orm.go:74 #
# 2019-12-11T20:31:18Z [WARN] pq: relation "migrations" does not exist migrations/migrate.go:149
# ** Running node
# 2019-12-11T20:31:20Z [INFO] Starting Chainlink Node 0.7.0 at commit 7324e9c476ed6b5c0a08d5a38779d4a6bfbb3880 cmd/local_client.go:27
# ...
# ...
```
In a new terminal:
```sh
docker logs operator-ui -f
```
You'll now have two terminals, one with the core node, one with operator-ui, with both being able to react to code changes without rebuilding their respective images.
### Running integration test suites
The integration test suite will run against a parity node by default. You can run the integration test suite with the following command:
```sh
./compose test
```
If you want to run the test suite against a geth node, you can set the `GETH_MODE` environment variable.
```sh
GETH_MODE=true ./compose test
```
If we want to quickly test new changes we make to `integration/` or `tools/ci/ethereum_test` without re-building our images, we can use the `test:dev` command which will reflect those changes from the host file system without rebuilding those containers.
```sh
./compose test:dev
```
Still a work in progress, you can run the tests in typescript (instead of bash) by using
```sh
./compose test:ts
# or
./compose test:ts:dev
```
Eventually, these tests should replace the bash tests entirely
### Running specifically cypress tests
See the README within the [integration folder.](../../integration/README.md)
### Cleaning up
To remove any containers, volumes, and networks related to our docker-compose setup, we can run the `clean` command:
```sh
./compose clean
```
Individual clean commands are included for CI purposes when matrix jobs are being executed.
```sh
./compose test:down
./compose test:ts:down
```
### Running your own commands based off of docker-compose
The following commands allow you do just about anything:
```sh
./compose <subcommand>
./compose integration <subcommand> # or ./compose i
./compose dev:integration <subcommand> # or ./compose di
./compose dev <subcommand>
```
For example, to see what our compose configuration looks like:
```sh
./compose config # base config
./compose dev:integration # development integration test config
```
Or, to run just
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 1、该资源包括项目的全部源码,下载可以直接使用! 2、本项目适合作为计算机、数学、电子信息等专业的竞赛项目学习资料,作为参考学习借鉴。 3、本资源作为“参考资料”如果需要实现其他功能,需要能看懂代码,并且热爱钻研,自行调试。 2021Q2全国联动黑客松大赛参赛源码+学习说明.zip
资源推荐
资源详情
资源评论
收起资源包目录
2021Q2全国联动黑客松大赛参赛源码+学习说明.zip (2000个子文件)
UTC--2018-04-27T21-03-21.628647000Z--7db75251a74f40b15631109ba44d33283ed48528 491B
UTC--2017-01-05T20-42-24.637Z--9ca9d2d5e04012c9ed24c0e513c9bfaa4a2dd77f 594B
zUTC--2017-01-05T20-42-24.637Z--9ca9d2d5e04012c9ed24c0e513c9bfaa4a2dd77f 489B
OffchainAggregator.abi 14KB
apicredentials 37B
apicredentials 31B
apicredentials 31B
branch2tag 910B
build_abigen 933B
cldev 693B
clean_test_dbs 106B
CODEOWNERS 144B
compose 6KB
cookie 291B
cookie 0B
create-solc-cache 162B
show.css 5KB
reset.css 831B
App.css 641B
PrettyJson.css 455B
App.css 377B
index.css 366B
index.css 194B
index.css 63B
App1.css 0B
chainlink.Dockerfile 3KB
integration.Dockerfile 3KB
develop.Dockerfile 2KB
ts-integration.Dockerfile 1KB
Dockerfile 553B
Dockerfile 549B
Dockerfile 501B
Dockerfile 363B
cldev.Dockerfile 301B
wait-postgres.Dockerfile 161B
operatorui.Dockerfile 109B
chainlink-variables.env 111B
eslintrc 63B
ethereum_test 916B
forks_test 125B
.gitattributes 33B
.gitignore 310B
.gitignore 59B
.gitignore 40B
.gitignore 25B
.gitignore 23B
.gitignore 18B
.gitignore 17B
.gitignore 4B
.gitignore 4B
.gitignore 4B
.gitkeep 0B
.gitkeep 0B
gittag2dockertag 739B
GNUmakefile 4KB
flux_aggregator_wrapper.go 149KB
keeper_registry_wrapper.go 120KB
offchain_aggregator_wrapper.go 111KB
operator_wrapper.go 92KB
eth_confirmer_test.go 83KB
0001_initial.go 79KB
features_test.go 66KB
config.go 61KB
flags_wrapper.go 60KB
orm_test.go 60KB
cltest.go 59KB
solidity_vrf_coordinator_interface.go 58KB
orm.go 57KB
flux_monitor_test.go 56KB
flux_aggregator.go 55KB
multiwordconsumer_wrapper.go 51KB
eth_confirmer.go 47KB
flux_monitor.go 45KB
oracle_wrapper.go 45KB
eth_broadcaster_test.go 44KB
mock_v3_aggregator_contract.go 44KB
flux_monitor_test.go 42KB
broadcaster_test.go 40KB
solidity_vrf_verifier_wrapper.go 37KB
integrations_test.go 32KB
link_token_interface.go 31KB
flux_monitor.go 29KB
run_manager_test.go 29KB
factories.go 29KB
job_specs_controller_test.go 29KB
flags.go 29KB
runner_integration_test.go 27KB
gas_updater_test.go 25KB
utils.go 24KB
head_tracker_test.go 24KB
presenters.go 24KB
flux_monitor_simulated_blockchain_test.go 23KB
application.go 23KB
basic_upkeep_contract.go 22KB
http_test.go 22KB
common.go 21KB
job_runs_controller_test.go 21KB
remote_client_test.go 20KB
app.go 20KB
head_tracker.go 20KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
土豆片片
- 粉丝: 1556
- 资源: 5641
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功