我正在尝试使用 Docker Compose 设置 Chainlink 节点,但我一直遇到问题。我的 Chainlink 节点容器启动,但它不断抛出以下错误:
...
2024-11-09T15:59:49.588Z [INFO] Nurse service (automatic pprof profiling) is disabled chainlink/application.go:229 version=1.13.3@47c02ec
2024-11-09T15:59:49.588Z [INFO] DatabaseBackup: periodic database backups are disabled. To enable automatic backups, set DATABASE_BACKUP_MODE=lite or DATABASE_BACKUP_MODE=full chainlink/application.go:272 version=1.13.3@47c02ec
2024-11-09T15:59:49.590Z [WARN] P2P_LISTEN_PORT was not set, listening on random port 43519. A new random port will be generated on every boot, for stability it is recommended to set P2P_LISTEN_PORT to a fixed value in your environment config/p2p_v1_config.go:87 logger=GeneralConfig p2pPort=43519 version=1.13.3@47c02ec
error authenticating keystore: no password provided
这是我的设置:
我使用 Docker Compose 来运行 Chainlink Node、Postgres、Grafana 和 Prometheus。
pickycamel@chainlink-node:~/chainlink_node_project$ ls -al
total 36
drwxr-xr-x 3 pickycamel pickycamel 4096 Nov 9 15:59 .
drwxr-xr-x 13 pickycamel pickycamel 4096 Nov 9 15:17 ..
-rw-r--r-- 1 pickycamel docker 15 Nov 9 14:58 .chainlink_password
-rw-r--r-- 1 pickycamel docker 1024 Nov 9 15:07 .docker-compose.ymldocker-compose.swp
-rw-r--r-- 1 pickycamel docker 371 Nov 9 15:14 .env
-rw-r--r-- 1 pickycamel docker 1024 Nov 9 15:07 .up.swp
drwxr-xr-x 2 root root 4096 Nov 9 15:52 chainlink_password
-rw-r--r-- 1 pickycamel docker 1357 Nov 9 15:59 docker-compose.yml
-rw-r--r-- 1 pickycamel docker 135 Nov 9 15:11 prometheus.yml
下面是我的
docker-compose.yml
:
pickycamel@chainlink-node:~/chainlink_node_project$ cat docker-compose.yml
version: '3'
services:
chainlink:
image: smartcontract/chainlink:1.13.3
container_name: chainlink-node
restart: always
environment:
ETH_URL: ${ETH_URL}
ETH_CHAIN_ID: ${ETH_CHAIN_ID}
CHAINLINK_EMAIL: ${CHAINLINK_EMAIL}
CHAINLINK_PASSWORD: ${CHAINLINK_PASSWORD}
DATABASE_URL: postgresql://chainlink:${POSTGRES_PASSWORD}@chainlink-postgres:5432/chainlink
volumes:
- ~/.chainlink-kovan:/chainlink
ports:
- "6688:6688"
networks:
- chainlink_network
chainlink-postgres:
image: postgres:13
container_name: chainlink-postgres
restart: always
environment:
POSTGRES_USER: chainlink
POSTGRES_PASSWORD: MyNewComplexPassword!2024
POSTGRES_DB: chainlink
volumes:
- chainlink_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- chainlink_network
prometheus:
image: prom/prometheus
container_name: prometheus
restart: always
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- chainlink_network
grafana:
image: grafana/grafana
container_name: grafana
restart: always
ports:
- "3000:3000"
networks:
- chainlink_network
networks:
chainlink_network:
driver: bridge
volumes:
chainlink_data:
.env
文件看起来像这样:
pickycamel@chainlink-node:~/chainlink_node_project$ cat .env
ETH_URL=https://rinkeby.infura.io/v3/##########################
ETH_CHAIN_ID=4
[email protected]
CHAINLINK_PASSWORD=MyPassword123@
POSTGRES_PASSWORD=MyNewComplexPassword!2024
Chainlink 容器启动,但我总是收到错误:
error authenticating keystore: no password provided
。
Postgres 和其他容器工作正常,我可以手动访问数据库。
密码文件
.chainlink_password
包含正确的密码,并且与.env
文件中的内容匹配。
pickycamel@chainlink-node:~/chainlink_node_project$ cat .chainlink_password
MyPassword123@
pickycamel@chainlink-node:~/chainlink_node_project$ cat prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'chainlink'
static_configs:
- targets: ['chainlink-node:6688']
pickycamel@chainlink-node:~/chainlink_node_project$
我尝试过的:
已验证
.chainlink_password
中的密码与CHAINLINK_PASSWORD
匹配。
确保
.chainlink_password
文件中没有拼写错误或多余的空格。
使用容器内的
psql
更新了数据库密码。
尝试先使用
docker-compose down
删除并重新创建容器,然后使用 docker-compose up -d
。
问题:
我需要通过特定方式向 Docker Compose 中的 Chainlink 节点提供密钥库密码吗?
有人遇到过类似问题并找到解决方案吗??
任何帮助将不胜感激。预先感谢您!