Go-Ethereum

Geth 不斷更改 coinbase / miner 帳戶並停止工作。(POA 網路)

  • October 2, 2020

我已經在不同的雲實例上建立了 2 個節點的 Geth POA 網路。網路執行良好 2 個月,但現在突然從未知對等方獲得連接,並且採礦停止工作。

蓋特命令:

geth --datadir ethdata/ --syncmode 'full' --port 30312 --rpc --rpcaddr '0.0.0.0' --rpcport 8545 --rpccorsdomain '<URL1>,<URL2>' --rpcapi 'personal,db,eth,net,web3,txpool,miner,admin' --ws --wsport 8546 --wsapi 'eth,net,web3' --wsorigins '<URL1>' --networkid <NETWORKID> --gasprice '1' --unlock <ACCOUNT1> --password pass.txt --mine --etherbase <ACCOUNT1> --allow-insecure-unlock --nat extip:<NODEIP> --nodiscover --netrestrict <NODE2IP>/32

錯誤日誌:

0|ethNode1  | INFO [10-02|21:10:19.001] 🔨 mined potential block                  number=394283 hash="2ef239…81cd72"
0|ethNode1  | INFO [10-02|21:10:19.002] Commit new mining work                   number=394284 sealhash="3377da…5031cd" uncles=0 txs=0 gas=0 fees=0 elapsed="318.567µs"
0|ethNode1  | INFO [10-02|21:10:19.002] Signed recently, must wait for others
0|ethNode1  | INFO [10-02|21:10:29.002] Imported new chain segment               blocks=1 txs=0 mgas=0.000 elapsed="442.732µs" mgasps=0.000 number=394284 hash="0612d1…139ef9" dirty=0.00B
0|ethNode1  | INFO [10-02|21:10:29.003] 🔗 block reached canonical chain          number=394277 hash="825454…683852"
0|ethNode1  | INFO [10-02|21:10:29.003] Commit new mining work                   number=394285 sealhash="f90c28…da2cd8" uncles=0 txs=0 gas=0 fees=0 elapsed="268.822µs"
0|ethNode1  | INFO [10-02|21:10:39.000] Successfully sealed new block            number=394285 sealhash="f90c28…da2cd8" hash="7f408c…1fe2df" elapsed=9.997s
0|ethNode1  | INFO [10-02|21:10:39.001] Signed recently, must wait for others
0|ethNode1  | INFO [10-02|21:10:39.000] 🔨 mined potential block                  number=394285 hash="7f408c…1fe2df"
0|ethNode1  | INFO [10-02|21:10:39.002] Commit new mining work                   number=394286 sealhash="190914…a34e63" uncles=0 txs=0 gas=0 fees=0 elapsed=1.583ms
0|ethNode1  | INFO [10-02|21:10:43.852] Transaction pool price threshold updated price=1
0|ethNode1  | ERROR[10-02|21:10:43.854] Etherbase account unavailable locally    err="unknown account"
0|ethNode1  | WARN [10-02|21:10:43.854] Served miner_start                       conn=217.227.191.41:61800 reqid=1643 t=2.034872ms err="signer missing: unknown account"
0|ethNode1  | WARN [10-02|21:10:44.863] Gas estimation capped by limited funds   original=8000000 balance=98712 sent=78962 gasprice=1 fundable=19750
0|ethNode1  | WARN [10-02|21:10:44.864] Served eth_sendTransaction               conn=217.227.191.41:61805 reqid=1125 t=3.726913ms err="gas required exceeds allowance (19750)"
0|ethNode1  | WARN [10-02|21:10:45.755] Served eth_sendTransaction               conn=217.227.191.41:61807 reqid=831  t=4.255632ms err="authentication needed: password or unlock"
0|ethNode1  | INFO [10-02|21:10:49.002] Imported new chain segment               blocks=1 txs=0 mgas=0.000 elapsed="301.13µs"  mgasps=0.000 number=394286 hash="5ae579…8ae413" dirty=0.00B
0|ethNode1  | INFO [10-02|21:10:54.250] Deep froze chain segment                 blocks=6 elapsed=7.777ms     number=304285 hash="2951e1…0aa545"

來自 IP 地址“217.227.191.41”的連接似乎來自未知節點。我已經設置--nodiscover好了--netrestrict。還使用以下命令阻止了防火牆的 IP 地址:

ufw deny from 217.227.191.41 to any

但是問題仍然存在,當我重新載入 geth 命令時,它會工作一分鐘,但同樣的問題再次發生。正如您在 GETH 命令中看到的那樣,我還阻止了 RPC 訪問。如何防止傳入連接更改我的礦工帳戶?

我與作者進行了一些私人討論,但這與通過 HTTP 對 API 的完全訪問有關,機器人更改了礦工地址。

所以我總結如下:不要讓所有 RPC API 對公眾開放的乙太坊節點。

(如果不是您,請檢查可以使用什麼來更改它。)

引用自:https://ethereum.stackexchange.com/questions/88004