Go-Ethereum
POA:Geth 節點(礦工)在 3-4 小時後自動停止,導致主節點暫停並尋找對等節點
我在不同的機器上設置了 2 個帶有 POA 的 Geth 節點。啟動bootnode和啟動Geth節點後,同步良好,交替開始挖礦。如果我手動停止一個節點,其他節點會繼續尋找對等節點。如果我重新啟動兩個節點,它們會再次開始正常工作。但是 3-4 小時後,當他們暫停礦工到“將記憶體狀態寫入磁碟”和“保持乾淨的 trie 記憶體”時,Node2 嘗試重新啟動探勘並出現以下錯誤:
0|ethNode2 | ERROR[08-20|10:28:37.169] Etherbase account unavailable locally err="unknown account" 0|ethNode2 | WARN [08-20|10:28:37.170] Served miner_start conn=84.147.159.252:62347 reqid=1134 t="323.102µs" err="signer missing: unknown account" 0|ethNode2 | INFO [08-20|10:28:37.990] Submitted transaction fullhash=0x4336151b175d4d67f68a2760c995ff0c9cb14823c0ba11634cbac1dfb85bbd88 reci pient=0x352828EF008Cf9f63Cc79ec002449E2d8B16370a 0|ethNode2 | INFO [08-20|10:54:28.648] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:55:31.673] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:55:54.716] Writing clean trie cache to disk path=/home/pistis/ethereum/ethdata/geth/triecache threads=1 0|ethNode2 | INFO [08-20|10:55:54.717] Regenerated local transaction journal transactions=1 accounts=1 0|ethNode2 | INFO [08-20|10:55:54.747] Persisted the clean trie cache path=/home/pistis/ethereum/ethdata/geth/triecache elapsed=29.536ms 0|ethNode2 | INFO [08-20|10:55:55.682] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:56:06.703] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:56:16.724] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:56:26.746] Looking for peers peercount=1 tried=0 static=0 0|ethNode2 | INFO [08-20|10:56:36.766] Looking for peers peercount=1 tried=0 static=0 ``` Please note that in the error message `Served miner_start conn=84.147.159.252:62347` This is an unknown IP address so I think the miner tries to connect with an unknown node and is failing to find Etherbase account on that node?
我能夠通過在 Geth 命令中添加
--nodiscover
和來解決這個問題,--netrestrict <CIDR>
這有助於防止未知節點與我的節點連接。對於即使在實施上述建議後仍面臨類似問題的使用者,請嘗試在 Geth Command 中減少 RPC-API。只使用必要的,因為那裡有許多機器人可能會嘗試連接和更改您的 etherbase 帳戶、進行交易等。