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 28, 2018 in Blockchain by aryya
• 7,460 points
2,185 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 28, 2018 by Johnathon
• 9,090 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
1,125 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,370 points
1,199 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,400 points
1,308 views
0 votes
1 answer
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
1,922 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,740 points
45,218 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
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 8, 2018 in Blockchain by Johnathon
• 9,090 points
802 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 19, 2018 in Blockchain by Johnathon
• 9,090 points
901 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP