Web3時代のつよつよビジネスパーソンを目指すブログ

Web3という大きな波に会社員エンジニアはどう対峙すべきか。クリプト、NFT、DeFi、メタバース…多様な情報に触れ思考したことを発信します。どこにでもいる会社員だからこその、日々の気づき、ビジネスTipsも発信します。

Go Ethereum(Geth)でハマったことのメモ

 

sendTransactionでエラー

 eth.sendTransaction({from:eth.accounts[0],to:eth.accounts[1],value:web3.toWei(10,"ether")})
Error: only replay-protected (EIP-155) transactions allowed over RPC
        at web3.js:6365:37(47)
        at send (web3.js:5099:62(35))
        at <eval>:1:20(21)

 

 

解決法

Geth起動時のオプションに、

--rpc.allow-unprotected-txs を追加

geth --networkid 4649 --nodiscover --maxpeers 0 --datadir C:\Users\xxxx\data_testnet\ --rpc.allow-unprotected-txs console 2>> C:\Users\xxxx\data_testnet\geth.log

 

github.com

 

EIP-155 はリプレイ攻撃を防ぐためにトランザクションに chain id を含めるようにする提案
これに対応していないトランザクションを RPC が受け付けないというエラーっぽい

 

 

zenn.dev