bnb-chain / bsc

A BNB Smart Chain client based on the go-ethereum fork
GNU Lesser General Public License v3.0
2.68k stars 1.55k forks source link

Unable to connect to testnet peers #80

Closed 1doce8 closed 3 years ago

1doce8 commented 3 years ago

I started a node using this guide https://docs.binance.org/smart-chain/developer/fullnode.html Node has started, but doesn't sync because it can't connect to peers up to 7 hours

INFO [02-18|17:23:46.386] Looking for peers                        peercount=0 tried=61  static=0
INFO [02-18|17:23:56.580] Looking for peers                        peercount=0 tried=126 static=0
INFO [02-18|17:24:07.110] Looking for peers                        peercount=0 tried=85  static=0
INFO [02-18|17:24:17.245] Looking for peers                        peercount=0 tried=100 static=0
INFO [02-18|17:24:27.358] Looking for peers                        peercount=0 tried=64  static=0
INFO [02-18|17:24:38.583] Looking for peers                        peercount=0 tried=119 static=0
INFO [02-18|17:24:48.692] Looking for peers                        peercount=0 tried=87  static=0
INFO [02-18|17:24:58.836] Looking for peers                        peercount=0 tried=52  static=0
INFO [02-18|17:25:09.015] Looking for peers                        peercount=0 tried=78  static=0
INFO [02-18|17:25:19.097] Looking for peers                        peercount=0 tried=81  static=0
INFO [02-18|17:25:30.234] Looking for peers                        peercount=0 tried=86  static=0
riccardope commented 3 years ago

I have the same problem. Please help

unclezoro commented 3 years ago

Will have a check

longhoangwkm commented 3 years ago

I have the same problem too

longhoangwkm commented 3 years ago

I can connect to peers after removed some configs of [Node.P2P] section into config.toml file

 [Node.P2P]
 MaxPeers = 50
-NoDiscovery = false
-StaticNodes = []
-BootstrapNodes = ["enode://69a90b35164ef862185d9f4d2c5eff79b92acd1360574c0edf36044055dc766d87285a820233ae5700e11c9ba06ce1cf23c1c68a4556121109776ce2a3990bba@52.199.214.252:30311","enode://330d768f6de90e7825f0ea6fe59611ce9d50712e73547306846a9304663f9912bf1611037f7f90f21606242ded7fb476c7285cb7cd792836b8c0c5ef0365855c@18.181.52.189:30311","enode://df1e8eb59e42cad3c4551b2a53e31a7e55a2fdde1287babd1e94b0836550b489ba16c40932e4dacb16cba346bd442c432265a299c4aca63ee7bb0f832b9f45eb@52.51.80.128:30311","enode://0bd566a7fd136ecd19414a601bfdc530d5de161e3014033951dd603e72b1a8959eb5b70b06c87a5a75cbf45e4055c387d2a842bd6b1bd8b5041b3a61bab615cf@34.242.33.165:30311","enode://604ed87d813c2b884ff1dc3095afeab18331f3cc361e8fb604159e844905dfa6e4c627306231d48f46a2edceffcd069264a89d99cdbf861a04e8d3d8d7282e8a@3.209.122.123:30311","enode://4d358eca87c44230a49ceaca123c89c7e77232aeae745c3a4917e607b909c4a14034b3a742960a378c3f250e0e67391276e80c7beee7770071e13f33a5b0606a@52.72.123.113:30311"]
-TrustedNodes = ["enode://69a90b35164ef862185d9f4d2c5eff79b92acd1360574c0edf36044055dc766d87285a820233ae5700e11c9ba06ce1cf23c1c68a4556121109776ce2a3990bba@52.199.214.252:30311","enode://330d768f6de90e7825f0ea6fe59611ce9d50712e73547306846a9304663f9912bf1611037f7f90f21606242ded7fb476c7285cb7cd792836b8c0c5ef0365855c@18.181.52.189:30311","enode://df1e8eb59e42cad3c4551b2a53e31a7e55a2fdde1287babd1e94b0836550b489ba16c40932e4dacb16cba346bd442c432265a299c4aca63ee7bb0f832b9f45eb@52.51.80.128:30311","enode://0bd566a7fd136ecd19414a601bfdc530d5de161e3014033951dd603e72b1a8959eb5b70b06c87a5a75cbf45e4055c387d2a842bd6b1bd8b5041b3a61bab615cf@34.242.33.165:30311","enode://604ed87d813c2b884ff1dc3095afeab18331f3cc361e8fb604159e844905dfa6e4c627306231d48f46a2edceffcd069264a89d99cdbf861a04e8d3d8d7282e8a@3.209.122.123:30311","enode://4d358eca87c44230a49ceaca123c89c7e77232aeae745c3a4917e607b909c4a14034b3a742960a378c3f250e0e67391276e80c7beee7770071e13f33a5b0606a@52.72.123.113:30311"]

Updated 1: Sometime not works(delete and reinstall) Updated 2: I have not the same config datadir between geth init cmd and datadir in thegeth --config ./config.toml cmd. After fixing them the same, it sync normally, local and docker container.

unclezoro commented 3 years ago

Enable more peer connections on those public nodes. Test it in several vms, should work now.

maurodelazeri commented 3 years ago

This normally happens if you do not initialize it properly

./geth_linux --datadir ./bsc init genesis.json (only executed once)

for fast spin up, I have a docker compose right here...

https://github.com/maurodelazeri/bsc-node

DylanVerstraete commented 3 years ago

@guagualvcha I am experiencing this issue again since friday, please help..

maurodelazeri commented 3 years ago

@DylanVerstraete https://github.com/maurodelazeri/bsc-node

clean up the directory that the data is and do it ./geth_linux --datadir ./data/mainnet/ init config/mainnet/genesis.json before starting (only once)

DylanVerstraete commented 3 years ago

@maurodelazeri I am running light clients, just trying to sync to the network..

ares0x commented 3 years ago

If i forget to execute ./geth_linux --datadir ./data/mainnet/ init config/mainnet/genesis.json What will happen

gadisauskas commented 2 years ago

Hello, I have same the problem. Running ./geth --config ./config.toml --datadir ./mainnet --cache 20480 --rpc.allow-unprotected-txs --txlookuplimit 0 --maxpeers 2000 --ws --syncmode=fast --snapshot=false --diffsync --datadir.ancient /media/jonas/D/Ancient this command made up to 12.9 blocks. After restart can't find any peers. Tried everything no luck :( . Also saw message that sync is changing form fast to full mode? geth v1.1.7

imnovox commented 2 years ago

Hi guys, i'm with same problem, my node just report: t=2022-01-08T20:48:22+0100 lvl=info msg="Looking for peers" peercount=2 tried=131 static=23 t=2022-01-08T20:48:33+0100 lvl=info msg="Looking for peers" peercount=2 tried=105 static=23 t=2022-01-08T20:48:43+0100 lvl=info msg="Looking for peers" peercount=2 tried=172 static=23 t=2022-01-08T20:48:53+0100 lvl=info msg="Looking for peers" peercount=1 tried=118 static=23

on ./geth_linux attach node/geth.ipc

eth.syncing false eth.blockNumber 12965001

i got the last snapshot geth-20220106.tar.lz4 i follow the step>Sync From Snapshot (Recommended) to start service: ./geth_linux --config ./config.toml --datadir ./node --cache 102400 --rpc.allow-unprotected-txs --txlookuplimit 0 --http --ws --snapshot=false --syncmode=fast

My server is AX61-NVME of HETZNER

Obs: on "./node" i rename geth to _geth and run script bellow I run ./geth_linux --datadir ./node init ./genesis.json

the new geth was created, but the problem "Looking for peers" show me again.

I really don't know what to do. Someone help me?

athlonUA commented 1 year ago

Hello guys! Any new how to speed up syncing testnet node?

graygt commented 1 year ago

Hi guys, i'm with same problem, my node just report: t=2022-01-08T20:48:22+0100 lvl=info msg="Looking for peers" peercount=2 tried=131 static=23 t=2022-01-08T20:48:33+0100 lvl=info msg="Looking for peers" peercount=2 tried=105 static=23 t=2022-01-08T20:48:43+0100 lvl=info msg="Looking for peers" peercount=2 tried=172 static=23 t=2022-01-08T20:48:53+0100 lvl=info msg="Looking for peers" peercount=1 tried=118 static=23

on ./geth_linux attach node/geth.ipc

eth.syncing false eth.blockNumber 12965001

i got the last snapshot geth-20220106.tar.lz4 i follow the step>Sync From Snapshot (Recommended) to start service: ./geth_linux --config ./config.toml --datadir ./node --cache 102400 --rpc.allow-unprotected-txs --txlookuplimit 0 --http --ws --snapshot=false --syncmode=fast

My server is AX61-NVME of HETZNER

Obs: on "./node" i rename geth to _geth and run script bellow I run ./geth_linux --datadir ./node init ./genesis.json

the new geth was created, but the problem "Looking for peers" show me again.

I really don't know what to do. Someone help me?

Did you manage to fix it? It looks like this issue is intrinsic to Hetzner hosting?