Back
'm learning ethereum blockchain with Ruby and using this library:
https://github.com/EthWorks/ethereum.rb
I follow the guide and use the file greeter.sol here:
https://github.com/marekkirejczyk/ruby_ethereum_example/blob/master/contracts/greeter.sol
But I always got this error:
invalid argument 0: json: cannot unmarshal non-string into Go struct field SendTxArgs.from of type common.Address
This is my current code:
contract = Ethereum::Contract.create file: File.join(File.dirname(__FILE__), '../contracts/greeter.sol')address = contract.deploy_and_wait("Hello from ethereum.rb!")
contract = Ethereum::Contract.create file: File.join(File.dirname(__FILE__), '../contracts/greeter.sol')
address = contract.deploy_and_wait("Hello from ethereum.rb!")
Anyone can help me, I'm very new to this. Thanks.
Hi, you should specify the default_account for client(sender address).Something like this:
client = Ethereum::IpcClient.new("your path to .ipc", true)client.default_account = '0xa9db3f4efe....
then
contract = Ethereum::Contract.create( abi: abi, name: name, client:client, address: address)
Know the blockchain better through Blockchain Certification by Intellipaat.
31k questions
32.8k answers
501 comments
693 users