【发布时间】:2020-09-15 14:37:34
【问题描述】:
在 macOS 上使用 docker-desktop。
我正在尝试按照this page 上的说明运行一个节点。
数据库名称为node,与用户名相同:node。用户可以访问数据库,可以使用psql客户端登录。
我在 .env 文件中尝试过的连接字符串:
postgresql://node@localhost/node
postgresql://node:password@localhost/node
postgresql://node:password@localhost:5432/node
postgresql://node:password@127.0.0.1:5432/node
postgresql://node:password@127.0.0.1/node
当我在 macOS 上使用 docker-desktop 运行 start command:cd ~/.chainlink-kovan && docker run -p 6688:6688 -v ~/.chainlink-kovan:/chainlink -it --env-file=.env smartcontract/chainlink local n 时,我得到以下堆栈跟踪:
2020-09-15T14:24:41Z [INFO] Starting Chainlink Node 0.8.15 at commit a904730bd62c7174b80a2c4ccf885de3e78e3971 cmd/local_client.go:50
2020-09-15T14:24:41Z [INFO] SGX enclave *NOT* loaded cmd/enclave.go:11
2020-09-15T14:24:41Z [INFO] This version of chainlink was not built with support for SGX tasks cmd/enclave.go:12
2020-09-15T14:24:41Z [INFO] Locking postgres for exclusive access with 500ms timeout orm/orm.go:69
2020-09-15T14:24:41Z [ERROR] unable to lock ORM: dial tcp 127.0.0.1:5432: connect: connection refused logger/default.go:139 stacktrace=github.com/smartcontractkit/chainlink/core/logger.Error
/chainlink/core/logger/default.go:117
...
有谁知道我该如何解决这个问题?
【问题讨论】:
-
您的标签中有
docker- 您是否在不同的 docker 容器中运行这些应用程序?如果是这样,问题是localhost指的是docker容器——你需要链接app容器和数据库容器,然后通过名称引用数据库容器。
标签: docker blockchain psql