Giter Site home page Giter Site logo

Comments (8)

unixneo avatar unixneo commented on May 21, 2024

DEBUGGING UPDATE

Changed the endpoint to alchemy using the goerli testnet since ropsten is deprecating

hain = Eth::Client.create Endpoint::Provider.alchemy_goerli

This this I get an more interesting error:

Unsupported method: eth_coinbase. Alchemy does not support mining eth...

MacStudio:client tim$ rails c
Loading development environment (Rails 7.0.3)
irb(main):001:0> require "#{Rails.root}/lib/assets/eth.rb"
=> true
irb(main):002:0> EthGem::Core.contract("hello_world")
METAMASK_ETH_ADDRESS: 0xE179C056024150d56A4e94af9C5A36BCC0B4e502
HELLO DEF SEND                  
"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":\"0x853a0d2313c0000\"}"
Balance is 6.0e+17              
FILE: /Users/tim/rails/eth/lib/assets/contracts/hello_world.sol
HELLO DEF SEND                  
"{\"jsonrpc\":\"2.0\",\"result\":\"0x5\",\"id\":2}"
HELLO DEF SEND
"{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32600,\"message\":\"Unsupported method: eth_coinbase. Alchemy does not support mining eth. See available methods at https://docs.alchemy.com/alchemy/documentation/apis\"},\"id\":3}"
/Users/tim/rails/eth/vendor/bundle/ruby/3.0.0/gems/eth-0.5.5/lib/eth/client.rb:453:in `send_command': Unsupported method: eth_coinbase. Alchemy does not support mining eth. See available methods at https://docs.alchemy.com/alchemy/documentation/apis (IOError)
irb(main):003:0> 

So, seems I need to disable or nil chain.eth_coinbase ?

Any ideas how best to do this?

from eth.rb.

unixneo avatar unixneo commented on May 21, 2024

DEBUGGING. client.rb

  def default_account
      @default_account ||= Address.new eth_coinbase["result"]
    end

It appears this is part of the problem?

For test networks which do not mine, this call returns an error, correct?

What is the best way around this issue with test chains which do not mine?

Thanks

from eth.rb.

q9f avatar q9f commented on May 21, 2024

Thank you, this is actually a bug. I partially fixed it in #85 but have not seen this. 👍

from eth.rb.

unixneo avatar unixneo commented on May 21, 2024

Testing all these various blockchain provider endpoints is useful it seems.

  • Hope it helps!

See summary of first test results here:

https://community.unix.com/t/testing-eth-contract-deployment-using-the-eth-ruby-gem-against-provider-endpoints/387004

from eth.rb.

q9f avatar q9f commented on May 21, 2024

Do you want to submit a PR?

from eth.rb.

unixneo avatar unixneo commented on May 21, 2024

Do you want to submit a PR?

I don't yet have the skills to debug the ETH protocol; but if I did, or if I ever do, I would be happy to help out anyway I can.

Not even sure where to start, to be honest. I've been focused on testing provider endpoints and not the underlying protocol; where would I start to debug / fix this issue?

My guess is it would be easier to just use the sender signing key?

    # Deploys a contract. Uses `eth_coinbase` or external signer
    # if no sender key is provided.

Is this documented on how to deploy a contract using a sender key? I'm happy to try that, if you think that is a good way forward @q9f

from eth.rb.

q9f avatar q9f commented on May 21, 2024

Oh, sure:

my_key = Eth::Key.new priv: "30137644b564785d01420f8043f043d74dcca64008e57c59f8ce713a0005a54b"
# ...
chain.deploy_and_wait(contract, sender_key: my_key)

from eth.rb.

unixneo avatar unixneo commented on May 21, 2024

This issue is resolved. Thanks for your help @q9f

from eth.rb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.