Go-Ethereum
封堵失敗 err=‘unauthorized signer’
在 linux 上成功設置後,我正在嘗試在 windows 上執行 geth 環境。當嘗試像我在 linux 中那樣在 geth 上部署契約時,它會產生以下錯誤。
loadScript('contract.js') INFO [03-12|11:41:37.126] Commit new mining work number=1 sealhash=ae591c…7d2135 uncles=0 txs=0 gas=0 fees=0 elapsed=0s INFO [03-12|11:41:37.126] Submitted contract creation fullhash=0xbaf4bbcf3794d28b561c437cf2cc9bab1f4dab3824a039f44810bc7d8cf566fc contract=0x513b725b5d9369690800a10803e52daCC4BFDb1e INFO null [objec[0t3 -O1b2j|e1c1t:]4 1:37.126] Sealing pausedt,r uweaiti ng > for transactions WARN [03-12|11:41:37.153] Block sealing failed err="unauthorized signer" INFO [03-12|11:41:37.153] Commit new mining work number=1 sealhash=eb4c1f…eb0b05 uncles=0 txs=1 gas=1387245 fees=1.387245e-12 elapsed=27.021ms
每一步都與 linux 的情況一樣。
以下是 genesis.json
{ "config": { "chainId": 786, "homesteadBlock": 1, "eip150Block": 2, "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", "eip155Block": 3, "eip158Block": 3, "byzantiumBlock": 4, "constantinopleBlock": 5, "clique": { "period": 0, "epoch": 30000 } }, "nonce": "0x0", "timestamp": "0x5c820746", "extraData": "0x000000000000000000000000000000000000000000000000000000000000000001bf178cacf17f566b1223e3e45dbddb0c20e7030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "gasLimit": "0x47b760", "difficulty": "0x1", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "coinbase": "0x0000000000000000000000000000000000000000", "alloc": { "5313f537528ef5348676b0e42b6a87792005bf5e": { "balance": "1000000000000" } }, "number": "0x0", "gasUsed": "0x0", "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" }
這是我用於執行 geth 的命令。
geth --datadir data --syncmode 'full' --port 30311 --rpc --rpcaddr 'localhost' --rpcport 8501 --rpccorsdomain "*" --rpcapi 'personal,db,eth,ne t,web3,txpool,miner' --ws --wsport 8502 -wsapi 'personal,db,eth,net,web3,txpool,miner' --wsorigins="*" --networkid 786 --gasprice '1' -unlock '0x5313f537528ef 5348676b0e42b6a87792005bf5e' --password data/password.txt --mine console
弄清楚了。我創建了新帳戶,但忘記將其添加到“額外數據”中。現在它起作用了。
就我而言,我使用的是另一個
etherbase
地址(這是預設地址)。來自
geth --help
:--miner.etherbase value Public address for block mining rewards (default = first account)
在您的日誌 (
Etherbase automatically configured address=0x...
) 中檢查它並確保它是正確的。如果不是,請使用上述標誌進行更正。或者也許它沒有解鎖。然後你需要解鎖它:
--unlock value Comma separated list of accounts to unlock