Comments (4)
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.
@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.
@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.
@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)
- Problem loading Smart Contract HOT 1
- Insufficient ether for `rake ethereum:test:setup`? HOT 1
- Support for ruby 3? HOT 8
- Adding BSC Main and Testnet
- Adding BSC Main and Testnet HOT 1
- how to get balance of a contract based token HOT 2
- trying to use non-default sender to approve funds to transfer on ERC20 contract HOT 5
- OpenSSL 1.1.1 compatible? HOT 4
- Interacting with ERC20 proxy contracts HOT 3
- can transact on local ganache net, but not on ropsten net HOT 2
- question: how to increase gas on a transaction to speed it up HOT 1
- ethereum:node:test gives Invalid address: "--author" with author set to an address HOT 1
- undefined method `encode_tuple' HOT 1
- EIP 1559 support HOT 3
- Error installing ethereum.rb with ruby>=3 HOT 9
- error: max fee per gas less than block base fee HOT 1
- Need to add dependency for gem "ruby-eth".
- should allow pass "data" parameter when call "tranfer" method HOT 1
- Can't resolve ActiveSupport version if the project uses a version newer than 5.0.1 (for example RubyOnRails v7 projects) HOT 1
- Bets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum.rb.