[SOLVED] Prysm node unable to connect Geth node


This Content is from Stack Overflow. Question asked by Mr.Patience

Docker:Docker version 19.03.2, build 6a30dfc

Prysm: prysmaticlabs/prysm-beacon-chain:latest

Geth: ethereum/client-go:latest


1. two containers are running on the same machine;
2. docker run -d -v /mnt/prysm:/data -p 4000:4000 -p 13000:13000 -p 12000:12000/udp --name beacon-node prysmaticlabs/prysm-beacon-chain --datadir=/data --jwt-secret=/data/jwtsecret --execution-endpoint=http://localhost:8551  --accept-terms-of-use=true;
3. docker run -d --name ethereum --restart always 
-p 8545:8545 -p 30303:30303 -p 8546:8546 -p 8551:8551 
-v /mnt/blockchain_data/eth:/root/.ethereum ethereum/client-go 
--http --http.addr "" --http.port 8545 --http.api "eth,personal,net,web3,db,txpool,ws" 
--ws --ws.addr "" --ws.origins "*" --ws.port "8546" 
--authrpc.jwtsecret "/root/.ethereum/geth/jwtsecret" 
--syncmode=snap --cache=1024 --maxpeers=50

1.JWT on both nodes;
2. based on Prysm official guide, port 8551 mapping on geth node;
3. test localhost:8551 via nc -z -v and the connection successful;

After running two containers:

  1. beacon node logs: time=”2022-09-16 05:38:19″ level=error msg=”Could not connect to execution client endpoint” error=”Post “http://localhost:8551”: dial tcp connect: connection refused: Post “http://localhost:8551″: dial tcp connect: connection refused” prefix=powchain;


After spending a bit of time and effort on trying a wide variety of ways to resolve this issue, the root reason behind it is the docker network in which the beacon node cannot communicate with get node via port 8551. Adopting the host mode network can resolve this issue but I have no idea why this is happening.

This Question was asked in StackOverflow by Mr.Patience and Answered by Mr.Patience It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?