Closed cgarvie closed 6 years ago
@cgarvie can you provide an exact version. latest can be a bit ambiguous.
I ran pip install web3
root@ubuntu-geth:~# pip show web3
---
Metadata-Version: 2.0
Name: web3
Version: 3.16.5
Summary: Web3.py
Home-page: https://github.com/ethereum/web3.py
Author: Piper Merriam
Author-email: EMAIL@gmail.com
Installer: pip
License: MIT
Location: /usr/local/lib/python2.7/dist-packages
Requires: rlp, eth-tester, requests, pysha3, toolz, lru-dict, eth-utils, eth-abi, cytoolz
Classifiers:
Development Status :: 2 - Pre-Alpha
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Natural Language :: English
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Thanks for your help Piper
-32000 is the json-rpc spec, see 5.1, server error catch all and the rpc client's just passing that on. my encoding/decoding prowess sucks but just looking at the codec, it looks like turkish or thai to me. using TIS-620, i get ฤดd|าบs๗ษGไธุ which ol' google seems to think stands for i'm sorry. does that make any sense? well, at the very least, we now know that we're dealing with a worldly, polite, yet misunderstood rpc backend. looks like the github editor can't display that either ... try below to see the actual output in your editor/terminal:
# accounting for utf-8 wrapping/mangling TIS-620, you get a clean representation
>>> fixed_bstr = b'\xc4\xb4\x1f\x02d\x9d|\xd2\xbas\xf7\xc9\x9bG\xe4\xb8\x8e\x18\xd8'
>>> print(fixed_bstr.decode('TIS-620'))
is it possible that the encoding of the account strings, or your ide/editor, wasn't utf-8 ?
hmmm... I am indeed in Thailand and that is indeed Thai (it's gibberish though) but the server I am running this on is a digitalocean droplet rented in Singapore. Very strange. My full code is in the OP, and I'm not using any IDE. I'm just typing in the python2 terminal/console over ssh. The geth node is running on the same box (localhost).
What's the standard client that most people use web3py with? Is it geth? Should I be running geth with any special flags in order to expose the interface?
I'd recommend upgrading to use the v4 beta pip install --pre -U web3
which may fix some of the encoding issues. Prior to v4 we had some weird character encoding issues and inconsistencies that have largely been resolved.
I updated to the latest version using the command you gave, and I'm now using python3. same error.
No worries.
What is the 'reference implementation' .. What setup should this work on easily?
(py3env) root@ubuntu-geth:~# pip show web3
Name: web3
Version: 4.0.0b11
...
(py3env) root@ubuntu-geth:~# python --version
Python 3.5.2
sorry for initially mis-reading your issue.
It looks like you are trying to transaction from an account that testrpc doesn't know about. You generally will need to use an account fromweb3.eth.accounts
with testrpc.
And by the way. eth-testrpc-py
has been deprecated. You should look into switching over to the EthereumTesterProvider
which is backed by eth-tester
which is in active development.
my code:
The result:
Any idea how to fix this? Google returns nothing for error 32000, "is not in list", etc...