Ethereum.rbで.deploy_and_wait()をしたらIOError: unknown transactionになる

まえおき

https://qiita.com/fukumame55/items/a66b8b04a543fae0baff
https://qiita.com/shiki_tak/items/1fdac873e35c5257a4d7
上記の記事を参考にしてEthereum.rbを学習していた際に遭遇したエラー

現状

ターミナルにて.
$ geth version

Geth
Version: 1.8.1-stable(1.8.1以下だと起こるのかな?という所)
Git Commit: 329ac18ef617d0238f71637bffe78f028b0f13f7
......
Ruby.
irb> client = Ethereum::IpcClient.new('/Users/cohki0305/private_geth/geth.ipc')
irb> contract = Ethereum::Contract.create(file: '/Users/cohki0305/sample.sol', client: client)
irb> contract.deploy_and_wait()

IOError: unknown transaction
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/client.rb:129:in `send_command'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/client.rb:137:in `block (2 levels) in <class:Client>'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/deployment.rb:27:in `check_deployed'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/deployment.rb:35:in `deployed?'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/deployment.rb:43:in `block in wait_for_deployment'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/deployment.rb:40:in `loop'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/deployment.rb:40:in `wait_for_deployment'
    from /Users/cohki0305/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/ethereum.rb-2.2/lib/ethereum/contract.rb:152:in `deploy_and_wait'
    from (irb):18
    from /Users/cohki0305/.rbenv/versions/2.4.3/bin/irb:11:in `<main>'

Versionが1.8.1とかそれ以下だと当てはまりそうです。
deploy_and_wait()するとIOErrorが起こる

解決策

gethをアップデートしましょう!
1.8.3では解決がされているようです。
https://github.com/EthWorks/ethereum.rb/issues/71

bundle経由でダウンロードをしている場合は、bundle updateとかでできそう。
自分の場合はgit経由でアップデートしました

ターミナル.
$ cd
$ cd go-ethereum
$ git branch -r
$ git checkout -b release/1.8 origin/release/1.8 (最新のverに)
$ git pull origin release/1.8
$ make all
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.