davebryson / py-tendermint Goto Github PK
View Code? Open in Web Editor NEWA Python microframework for building blockchain applications with Tendermint
License: Other
A Python microframework for building blockchain applications with Tendermint
License: Other
I'm running tendermint version 0.11.1.
I started a tendermint node and the example counter app from the readme.
Then I tried to send a transaction with curl:
curl "http://localhost:46657/broadcast_tx_commit?tx=0x01"
but got this error:
Traceback (most recent call last):
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/rlp-0.4.7-py3.6.egg/rlp/sedes/lists.py", line 239, in deserialize
values = cls.get_sedes().deserialize(serial)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/rlp-0.4.7-py3.6.egg/rlp/sedes/lists.py", line 66, in deserialize
raise ListDeserializationError('Can only deserialize sequences', serial)
rlp.exceptions.ListDeserializationError: Can only deserialize sequences
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/gevent-1.2.2-py3.6-linux-x86_64.egg/gevent/greenlet.py", line 536, in run
result = self._run(*self.args, **self.kwargs)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/gevent-1.2.2-py3.6-linux-x86_64.egg/gevent/baseserver.py", line 26, in _handle_and_close_when_done
return handle(*args_tuple)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/vanilla-0.1.1-py3.6.egg/vanilla/app.py", line 330, in __handle_connection
result = self.__handle_abci_call(req_type, req)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/vanilla-0.1.1-py3.6.egg/vanilla/app.py", line 188, in __handle_abci_call
return handler(req)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/vanilla-0.1.1-py3.6.egg/vanilla/app.py", line 220, in check_tx
decoded_tx = self.__decode_incoming_tx(req.check_tx.tx)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/vanilla-0.1.1-py3.6.egg/vanilla/app.py", line 217, in __decode_incoming_tx
return Transaction.decode(rawtx)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/vanilla-0.1.1-py3.6.egg/vanilla/transactions.py", line 61, in decode
outer = rlp.decode(bits, sedes=cls)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/rlp-0.4.7-py3.6.egg/rlp/codec.py", line 216, in decode
obj = sedes.deserialize(item, **kwargs)
File "/home/zaibon/dev/go/src/github.com/incubaid/blockchain_research/tendermint/pocs/kvs/.env/lib/python3.6/site-packages/rlp-0.4.7-py3.6.egg/rlp/sedes/lists.py", line 241, in deserialize
raise ObjectDeserializationError(serial=serial, sedes=cls, list_exception=e)
rlp.exceptions.ObjectDeserializationError: Deserialization failed because of underlying list ("Can only deserialize sequences")
Fri Oct 27 11:50:36 2017 <Greenlet at 0x7f3fe010cc28: _handle_and_close_when_done(<bound method VanillaApp.__handle_connection of <v, <bound method StreamServer.do_close of <StreamServ, (<gevent._socket3.socket [closed] object, fd=-1, )> failed with ObjectDeserializationError
Need to update to the latest pyabci with support for recent Tendermint abci protobuf changes. Will do once pushed to pypi. In the meantime, Tendermint 0.13 should still be working
python3 examples/simpleapp_client.py check-status
Error:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 171, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 79, in create_connection
raise err
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/connection.py", line 69, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 196, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/dist-packages/urllib3/connection.py", line 180, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7fe26a656be0>: Failed to establish a new connection: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "/usr/local/lib/python3.6/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.6/dist-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=46657): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe26a656be0>: Failed to establish a new connection: [Errno 111] Connection refused',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "examples/simpleapp_client.py", line 36, in
cli()
File "/usr/local/lib/python3.6/dist-packages/Click-7.0-py3.6.egg/click/core.py", line 764, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/Click-7.0-py3.6.egg/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/Click-7.0-py3.6.egg/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/Click-7.0-py3.6.egg/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/Click-7.0-py3.6.egg/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "examples/simpleapp_client.py", line 16, in check_status
print(rpc.status())
File "/usr/local/lib/python3.6/dist-packages/tendermint-0.3.0-py3.6.egg/tendermint/client.py", line 72, in status
return self.call('status', [])
File "/usr/local/lib/python3.6/dist-packages/tendermint-0.3.0-py3.6.egg/tendermint/client.py", line 42, in call
timeout=3
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 559, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 513, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=46657): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fe26a656be0>: Failed to establish a new connection: [Errno 111] Connection refused',))
using python3 setup.py install
Need this diff to get it to work:
- 'rlp>=0.6.0',
- 'trie>=0.2.4',
+ 'rlp==0.4.7',
+ 'trie==0.2.4',
etherum-utils 0.6.2 kept throwing errors RuntimeError: Format missing, but need one (identified source as text as no file with that name was found).
and the working version is 0.6.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.