简体   繁体   English

Chainlink 节点无法向 Chainlink 外部适配器发出请求(在 localhost 上)

[英]Chainlink node can't make requests to Chainlink external adapter (on localhost)

I have a chainlink Node which is running on port 6688. I'm running it with docker, with the following command:我有一个在端口 6688 上运行的 chainlink 节点。我使用 docker 运行它,使用以下命令:

cd ~/.chainlink-rinkeby && docker run -p 6688:6688  \
-v ~/.chainlink-rinkeby:/chainlink  \
-it --env-file=.env \
 smartcontract/chainlink:1.4.0-root local n -p /chainlink/.password -a /chainlink/.api

And I have an external adapter running on port 8080.我有一个在端口 8080 上运行的外部适配器。

If I request it { "id": 0, "data":{ "columns": ["blood","heath"], "linesAmount":500 } } it returns me a correct payload, in the format that is expected from the external adapter:如果我请求它{ "id": 0, "data":{ "columns": ["blood","heath"], "linesAmount":500 } }它会以预期的格式返回正确的有效负载从外部适配器:

{
    "jobRunID": 0,
    "data": {
        "ipfsHash": "anIpfshashShouldBeHere",
        "providers": [
            "0x03996eF07f84fEEe9f1dc18B255A8c01A4986701"
        ],
        "result": "anIpfshashShouldBeHere"
    },
    "result": "anIpfshashShouldBeHere",
    "statusCode": 200
}

The problem is, in the chainlink node, specifically in the fetch method it gives me an error: error making http request: Post "http://localhost:8080": dial tcp 127.0.0.1:8080: connect: connection refused问题是,在chainlink节点中,特别是在fetch方法中,它给了我一个错误: error making http request: Post "http://localhost:8080": dial tcp 127.0.0.1:8080: connect: connection refused

Is it related to the docker container?它与docker容器有关吗? I don't see why it wouldn't be able to request resuources from another port in the same machine.我不明白为什么它不能从同一台机器的另一个端口请求资源。 Am I missing some configuration maybe?我可能缺少一些配置吗? From what I've read from the docs it's possible to run the adapter locally.根据我从文档中读到的内容,可以在本地运行适配器。 Below, a picture with more information:下面是一张包含更多信息的图片:

在此处输入图像描述

If you're External Adapter (EA) is running on http://localhost:8080 and you're trying to reach that EA from a Chainlink node running inside Docker, then you can't use localhost , you need to get out of the Docker container and onto the host running the Docker engine (your Windows or Mac machine).如果您的外部适配器 (EA) 在http://localhost:8080上运行,并且您试图从运行在 Docker 内的 Chainlink 节点访问该 EA,那么您不能使用localhost ,您需要退出Docker 容器和运行 Docker 引擎的主机(您的 Windows 或 Mac 机器)。

To do, so define your bridge to use http://host.docker.internal:8080 .为此,请定义您的网桥以使用http://host.docker.internal:8080

Further details can be found in the Docker Docs .更多细节可以在Docker 文档中找到。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 运行 Chainlink 节点 - 无法连接到数据库 - Running a Chainlink Node - Can't connect to database 运行 Chainlink 节点 - 远程 DATABASE_URL 配置 PostgreSQL 问题 - Running a Chainlink Node - Remote DATABASE_URL Config PostgreSQL problem 运行 Chainlink 节点 - 在 MacOS/OSX 中将本地 Docker/DB 连接到 Docker/Node 问题 - Running a Chainlink Node - Connecting local Docker/DB to Docker/Node issue in MacOS/OSX docker chainlink 容器未连接到 postgres 数据库 - docker chainlink container not connecting to postgres database Docker容器中的Yesod应用无法发出网络请求 - Yesod app in Docker container can't make network requests 无法从外部机器访问公开暴露的Docker容器端口,只能从localhost访问? - Can't access publicly exposed Docker container port from external machine, only from localhost? Kubernetes节点无法访问外部Kafka集群 - Kubernetes node can't reach external Kafka Cluster 无法对“外部” DNS服务器进行任何DNS查找? - Can't make any DNS lookups to “external” DNS servers? 无法连接到Docker上的localhost - Can't connect to localhost on Docker Localhost不会将请求转发到Oracle Docker容器 - Localhost doesn't forward requests to Oracle Docker container
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM