Unable to unmarshal non-string into Go struct field SendTxArgs from of common.Address

0 votes

I'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!")

Anyone can help me, I'm very new to this.

Thanks.

Aug 27, 2018 in Blockchain by ariaholic
• 7,340 points
74 views

1 answer to this question.

0 votes

Probably you should specify the default_account for client(sender address).

In my case I have added it in this way:

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)
answered Aug 27, 2018 by Johnathon
• 9,080 points

Related Questions In Blockchain

+1 vote
1 answer

I am unable to change port of composer-rest-server. Please help!

Use full format for running a business ...READ MORE

answered Mar 27, 2018 in Blockchain by Christine
• 15,790 points
306 views
0 votes
1 answer

Updating data of struct to save in chaincode.

You can use a code similar to ...READ MORE

answered Jul 5, 2018 in Blockchain by slayer
• 29,170 points
169 views
0 votes
1 answer

How can I retrieve to and from address in transaction directly from blockchain?

The spending conditions, i.e., who is able ...READ MORE

answered Jul 11, 2018 in Blockchain by Shashank
• 10,350 points
83 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
169 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 26,550 points
4,353 views
0 votes
1 answer
0 votes
1 answer

How to check the data integrity logic in proof of work mining?

The proof of work is actually works ...READ MORE

answered May 7, 2018 in Blockchain by Johnathon
• 9,080 points
40 views
0 votes
1 answer

How do I get the total amount sent to an address?

If you are using web3JS you can ...READ MORE

answered Jul 18, 2018 in Blockchain by Johnathon
• 9,080 points
35 views