无法启动 Chainlink:正在打开数据库:无法打开数据库:

发布于 2025-01-11 03:41:19 字数 807 浏览 4 评论 0原文

当我“chainlink节点启动”时, 我收到错误:

“无法启动 Chainlink:打开数据库:无法打开数据库:无法连接到 host=/private/tmp user=myname database=:服务器错误(致命:无法识别的配置参数” ?application_name" (SQLSTATE 42704))"

我关注此 YouTube 视频:https://youtu.be/ZB3GLtQvgME?t=2017 我有一个 .env 但它不是从那里读取的。 无论我对 DATABASE_URL 进行什么更改, 我得到同样的错误。

ETH_URL=wss://kovan.infura.io/ws/v3/ 
FEATURE_EXTERNAL_INITIATORS=true 
LOG_LEVEL=debug 
ETH_CHAIN_ID=42 
MIN_OUTGOING_CONFIRMATIONS=2 
LINK_CONTRACT_ADDRESS= 
CHAINLINK_TLS_PORT=0 
SECURE_COOKIES=false 
ALLOW_ORIGINS=* 
DATABASE_URL=postgresql://localhost:5432/kovan_demo?sslmode=disable 
DATABASE_TIMEOUT=0 
FEATURE_FLUX_MONITOR=true 
MINIMUM_CONTRACT_PAYMENT=0 
CHAINLINK_DEV=true

When I "chainlink node start",
I get the error:

"Cannot boot Chainlink: opening db: failed to open db: failed to connect to host=/private/tmp user=myname database=: server error (FATAL: unrecognized configuration parameter "?application_name" (SQLSTATE 42704))"

I follow this youtube video: https://youtu.be/ZB3GLtQvgME?t=2017
I have a .env
but it is not reading from there.
No matter what I change on DATABASE_URL,
I get the same error.

ETH_URL=wss://kovan.infura.io/ws/v3/ 
FEATURE_EXTERNAL_INITIATORS=true 
LOG_LEVEL=debug 
ETH_CHAIN_ID=42 
MIN_OUTGOING_CONFIRMATIONS=2 
LINK_CONTRACT_ADDRESS= 
CHAINLINK_TLS_PORT=0 
SECURE_COOKIES=false 
ALLOW_ORIGINS=* 
DATABASE_URL=postgresql://localhost:5432/kovan_demo?sslmode=disable 
DATABASE_TIMEOUT=0 
FEATURE_FLUX_MONITOR=true 
MINIMUM_CONTRACT_PAYMENT=0 
CHAINLINK_DEV=true

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

记忆里有你的影子 2025-01-18 03:41:19

数据库参数通过

The database parameters are set via environment variable

油焖大侠 2025-01-18 03:41:19

正如理查德所说,您需要将 DATABASE_URL 设置为环境变量。由于某种原因,chainlink 客户端无法读取文件 .env 并按预期设置环境变量。

我解决这个问题的方法是通过命令显式地将DATABASE_URL设置为环境变量:

export DATABASE_URL=postgresql://<usrname>:<passswd>@localhost:5432/chainlink_node?sslmode=disable

您可以找到Chainlink节点的所有配置此处

希望有帮助。

As Richard said, you need to set DATABASE_URL as an environment variable. For some reason, the chainlink client cannot read file .env and set the environment variable as expected.

The way how I solve the problem is to set DATABASE_URL as an environment variable explicitly by command:

export DATABASE_URL=postgresql://<usrname>:<passswd>@localhost:5432/chainlink_node?sslmode=disable

You can find all configurations of Chainlink node here.

Hope it helps.

剩余の解释 2025-01-18 03:41:19

连接到数据库的格式如下:

DATABASE_URL=postgresql://$USERNAME:$PASSWORD@$SERVER:$PORT/$DATABASE

我总是按照以下步骤创建数据库:

sudo -u postgres psql
create database $DATABASE;
create user $USERNAME with encrypted password '$PASSWORD';
grant all privileges on database $DATABASE to $USERNAME;

只需更改变量

sudo -u postgres psql
create database chainlink;
create user username with encrypted password 'pass';
grant all privileges on database chainlink to username;

然后:

DATABASE_URL=postgresql://username:pass@localhost:5432/chainlink?sslmode=disable

我完全不建议将这些凭据用于生产。

The format to connect to the database is the following:

DATABASE_URL=postgresql://$USERNAME:$PASSWORD@$SERVER:$PORT/$DATABASE

I always follow this steps to create the database:

sudo -u postgres psql
create database $DATABASE;
create user $USERNAME with encrypted password '$PASSWORD';
grant all privileges on database $DATABASE to $USERNAME;

Just change the variables

sudo -u postgres psql
create database chainlink;
create user username with encrypted password 'pass';
grant all privileges on database chainlink to username;

And then:

DATABASE_URL=postgresql://username:pass@localhost:5432/chainlink?sslmode=disable

I don't recommend at all this credentials for production.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文