Giter VIP home page Giter VIP logo

Comments (4)

ghivert avatar ghivert commented on August 24, 2024 1

I got the same problem. Working with directly with Infura, having to change the sender, as no default client was running on my computer.

You can do something like this:

contract.sender = address

It works for me.

from ethereum.rb.

jasonadkison avatar jasonadkison commented on August 24, 2024 1

@ToJen you set the default account address on the client before sending a transaction:

@client.default_account = '0x123..'

You also need to setup the key on the contract:
@contract.key = Eth::Key.new(priv: your_private_key)

from ethereum.rb.

gmile avatar gmile commented on August 24, 2024

@ghivert you're totally right, thank you! Indeed, I figured this out later after posting the issue, but forgot to close it.

from ethereum.rb.

ToJen avatar ToJen commented on August 24, 2024

@ghivert I'm also using Infura like this:

    @client = Ethereum::HttpClient.new('https://ropsten.infura.io/my_api_key')
    PATH = "#{Dir.pwd}/contracts/MyContract.sol"

    def create
        @contract = Ethereum::Contract.create(file: PATH, address: "my_contract_address", client:@client)
        # @contract.key = "an_account_i_created_using_parity_on_ropsten"
        @contract.deploy_and_wait
        ## render html: address ##
        render json: @contract.abi #json: client.eth_gas_price
    end

How do I set the default account?

from ethereum.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.