Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected EthB at eth_syncing (), couldn not be decoded. Value was: Array ( [currentBlock] => 0x3e3d94 [highestBlock] => 0x4d982d [knownStates] => 0x920f [pulledStates] => 0x5ecb [startingBlock] => 0x3e2db4 ) #16

Open
sunujacob opened this issue Feb 23, 2018 · 2 comments
Assignees

Comments

@sunujacob
Copy link

I cloned dev branch into public html and installed dependencies through composer. I want to to use this project to interact with my php7 website and a go-ethereum node running on amazon linux ec2-instance. I can interact with that using geth console and curl function in the terminal.

When I run ethereum-php/public/client-example.php, I get below error in browser. I have my node up and running at 127.0.0.1:8545. I tried with 127.0.0.1 instead if localhost also. But same error. Please help.

We have a problem:
Expected EthB at eth_syncing (), couldn not be decoded. Value was: Array ( [currentBlock] => 0x3e3d94 [highestBlock] => 0x4d982d [knownStates] => 0x920f [pulledStates] => 0x5ecb [startingBlock] => 0x3e2db4 )

#0 /var/www/html/plugins/ethereum/ethereum-php/src/Ethereum.php(203): Ethereum\Ethereum->createReturnValue(Array, 'EthB', 'eth_syncing')
#1 [internal function]: Ethereum\Ethereum->Ethereum{closure}()
#2 /var/www/html/plugins/ethereum/ethereum-php/src/Ethereum.php(221): call_user_func_array(Object(Closure), Array)
#3 /var/www/html/plugins/ethereum/ethereum-php/src/EthMethods.php(136): Ethereum\Ethereum->__call('eth_syncing', Array)
#4 /var/www/html/plugins/ethereum/ethereum-php/public/client-example.php(62): Ethereum\Ethereum->eth_syncing()
#5 /var/www/html/plugins/ethereum/ethereum-php/public/client-example.php(33): status(Object(Ethereum\Ethereum))
#6 {main}

I want to interact with that node from my browser to create wallet public addresses for each user and do transactions and get wallet balance. Are these functions possible with this plugin.?

@digitaldonkey
Copy link
Owner

Regarding eth_syncing()
The main problem is that Ethereum has multiple return types (Bool/Array) varying dependend on the client. I need to have a deeper look how to work around that. We might create a custom Data type for that.

public function eth_syncing(): EthB;

The Error is triggered because the return value is wrongly Boolean, while it should be

"eth_syncing": [[], "B|EthSyncing"],

Other questions

from my browser to create wallet public addresses

This is currently not in my scope, as I don't want to recommend unlocked Ethereum Nodes. But you are welcome to join. Please PM me if you want to discuss.

do transactions and get wallet balance

Currently working on calling TX. But my focus is first non-payable calls. But the way how it is designed I should work with an unlocked geth/parity and payable calls too.

@digitaldonkey
Copy link
Owner

digitaldonkey commented Mar 5, 2018

eth_syncing() needs a wrapper to include the Boolean and the status.

@digitaldonkey digitaldonkey reopened this Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants