Giter Club home page Giter Club logo

eospy's People

Contributors

brentdouglasb1 avatar deckb avatar irvingyao avatar joshpurvis avatar pixelnoob avatar rossem avatar silvercondor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eospy's Issues

action data to long cause sign error

action contain a array like this
[2253740590, 2918125427, 2918125430, 2917927911, 2917993971, 2917993703, 2917927918, 2917928940, 2917927652, 2917927662, 2918058734, 2918059767, 2917928182, 2917928160, 2918125282, 2918058993, 2917993203, 2917993709, 2917993967, 2917928182, 2917928178, 2917928684, 2918125282, 2918059250, 2917928178, 2917994217, 2917928417, 2917928420, 2918125282, 2917994480, 2918060008, 2917928931, 2917993189, 2918125282, 2917927653, 2917928175, 2918059748, 2918124007]
when array length is longer than 30 then it will cause an error ,the error is as below,but the array length is less than 30,push action is ok,so I think it maybe a bug about sign long action。


{u'message': u'Internal Service Error', u'code': 500, u'error': {u'what': u'Provided keys, permissions, and delays do not satisfy declared authorizations', u'code': 3090003, u'name': u'unsatisfied_authorization', u'details': [{u'line_number': 517, u'message': u'transaction declares authority '{"actor":"MY_EOS_ACCOUNT","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys ["EOS6NByHMr36oYERbq34skxd3BDE9vuFUtMw8TDYXxfspUd94oJR3"], and a delay max limit of 3888000000 ms', u'method': u'check_authorization', u'file': u'authorization_manager.cpp'}]}}


my environment is
py2.7
linux ubuntu 18.04
eospy 1.1.7

Can't import any sub-modules from eospy

Recreating

  1. Made a new virtualenv running python3.6

  2. Ran pip install pip install git+https://github.com/eosnewyork/[email protected]

which reported

Collecting git+https://github.com/eosnewyork/[email protected]
  Cloning https://github.com/eosnewyork/eospy.git (to revision v1.1.10) to /tmp/pip-req-build-0omunv9h
Requirement already satisfied: pip in /home/itq/.virtualenvs/gyftie/lib/python3.6/site-packages (19.0.3)
Collecting install
  Could not find a version that satisfies the requirement install (from versions: )
No matching distribution found for install
  1. Ran

pip install libeospy which ran without errors and reported

Successfully built libeospy pyyaml
Installing collected packages: idna, urllib3, certifi, chardet, requests, base58, ecdsa, iso8601, translationstring, colander, pytz, six, pyyaml, libeospy
Successfully installed base58-1.0.3 certifi-2019.3.9 chardet-3.0.4 colander-1.7.0 ecdsa-0.13 idna-2.8 iso8601-0.1.12 libeospy-1.1.10 pytz-2018.9 pyyaml-5.1 requests-2.21.0 six-1.12.0 translationstring-1.3
urllib3-1.24.1
  1. Tried to run

from eospy.types import Abi which reported

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'Abi'

Notes

I'm not sure why it's behaving this way. Navigating into the site-packages/eospy in .virtualenvs shows that I have the following files:

cleos.py  
command_line.py  
dynamic_url.py  
exceptions.py  
__init__.py 
 keys.py  
__pycache__  
schema.py  
testeos.py  
types.py  
utils.py 
 __version__.py

example `push_transaction.py`doesn't work. python3.7

I've just install lib through pip and got error:

Traceback (most recent call last): File "/Users/chzchz/Documents/PycharmProjects/fastwin/test.py", line 53, in <module> push_transaction() File "/Users/chzchz/Documents/PycharmProjects/fastwin/test.py", line 39, in push_transaction resp = ce.push_transaction(trx, key, broadcast=True) File "/Users/chzchz/Documents/PycharmProjects/fastwin/venv/lib/python3.7/site-packages/eospy/cleos.py", line 169, in push_transaction return self.post('chain.push_transaction', params=None, data=data, timeout=timeout) File "/Users/chzchz/Documents/PycharmProjects/fastwin/venv/lib/python3.7/site-packages/eospy/cleos.py", line 31, in post return cmd.post_url(url, **kwargs) File "/Users/chzchz/Documents/PycharmProjects/fastwin/venv/lib/python3.7/site-packages/eospy/dynamic_url.py", line 43, in post_url raise requests.exceptions.HTTPError('Error: {}'.format(r.json())) requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3090003, 'name': 'unsatisfied_authorization', 'what': 'Provided keys, permissions, and delays do not satisfy declared authorizations', 'details': [{'message': 'transaction declares authority \'{"actor":"eosio","permission":"active"}\', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys ["EOS6E8LytbBDmgA81kdfsacZCJ4sfXx5nRrVAoZTEj2kA6oUx5vGhn4"], and a delay max limit of 3888000000 ms', 'file': 'authorization_manager.cpp', 'line_number': 520, 'method': 'check_authorization'}]}}

but it works with old version of lib

why push_transaction is very slow

        actions = []
        t1 = time.time()
        for bet in bet_list:
            betid = bet['id']
            server_seed = bet['server_seed']
            act = make_push_data(ce, from_, betid, server_seed)
            actions.append(act)

        trx = {"actions": actions}
        key = 'xxx'
        t2 = time.time()
        resp = ce.push_transaction(trx, key, broadcast=True)
        t3 = time.time()
        logger.info("testpush t1 %f t2 %f, len %d ,%s " % (t2-t1, t3-t2, len(bet_list), consts.chain_url))

log: http://172.31.129.125:8888 is my localhost ip.


cron_2018_10_22_20.log:2018-10-22 12:52:21,441 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.113391 t2 1.053547, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:52:40,241 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.023461 t2 1.105462, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:52:48,445 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.010504 t2 1.122615, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:14,952 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.052556 t2 0.926066, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:24,333 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.296603 t2 1.130232, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:33,696 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.028622 t2 0.687707, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:44,111 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.113310 t2 2.136775, len 1 ,http://172.3

example push_transaction.py doesn't work

This is my code.


ce = eospy.cleos.Cleos(url="http://107.182.23.236:8888")
# ce = eospy.cleos.Cleos(url='http://api.pennstation.eosnewyork.io:7001')

arguments = {
            "from": "eosio",  # sender
            "to": "bob123451234",  # receiver
            "quantity": '1.0000 EOS',  # In EOS
            "memo": "EOS to the moon",
        }
payload = {
        "account": "eosio.token",
        "name": "transfer",
        "authorization": [{
            "actor": "eosio",
            "permission": "active",
        }],
    }
#Converting payload to binary
data=ce.abi_json_to_bin(payload['account'],payload['name'],arguments)
#Inserting payload binary form as "data" field in original payload
payload['data']=data['binargs']
#final transaction formed
trx = {"actions": [payload]}

# use a string or EOSKey for push_transaction
key = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"
# use EOSKey:
# import eospy.keys
# key = eospy.keys.EOSKey('5HuaTWKeGzZhqyzuzFAjjFjPnnnjdgcp562oBSS8Wv1qgDSkR2W')
resp = ce.push_transaction(trx, key, broadcast=True)
print('------------------------------------------------')
print(resp)
print('------------------------------------------------')

I tried multiple endpoints but always got same errors.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/eospy/dynamic_url.py", line 41, in post_url
    r.raise_for_status()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 935, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://107.182.23.236:8888/v1/chain/push_transaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 34, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "/usr/local/lib/python3.6/site-packages/eospy/cleos.py", line 173, in push_transaction
    return self.post('chain.push_transaction', params=None, data=data, timeout=timeout)
  File "/usr/local/lib/python3.6/site-packages/eospy/cleos.py", line 33, in post
    return cmd.post_url(url, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/eospy/dynamic_url.py", line 43, in post_url
    raise requests.exceptions.HTTPError('Error: {}'.format(r.json()))
requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3090003, 'name': 'unsatisfied_authorization', 'what': 'Provided keys, permissions, and delays do not satisfy declared authorizations', 'details': [{'message': 'transaction declares authority \'{"actor":"eosio","permission":"active"}\', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys ["EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV"], and a delay max limit of 3888000000 ms', 'file': 'authorization_manager.cpp', 'line_number': 520, 'method': 'check_authorization'}]}}

getting disconnected on regular basis

I am getting disconnceted with below error on regular basis. How to avoid this and keep connections on

Traceback (most recent call last):
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 839, in validate_conn
conn.connect()
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connection.py", line 344, in connect
ssl_context=context)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\util\ssl
.py", line 344, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 817, in init
self.do_handshake()
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python36\lib\ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
socket.timeout: _ssl.c:835: The handshake operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\util\retry.py", line 367, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\packages\six.py", line 686, in reraise
raise value
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 346, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\urllib3\connectionpool.py", line 306, in _raise_timeout
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='proxy.eosnode.tools', port=443): Read timed out. (read timeout=30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/R.K Tyagi/Documents/VulturesPick/EOS/EOSbetdiceadminPredictorandTrader.py", line 482, in
whl(keyset,accountset,datafileP,datafilePTemp,count,countT,betvalue,newbetvalue,maxbet,nobtr,n_lags,nooutput,action)
File "C:/Users/R.K Tyagi/Documents/VulturesPick/EOS/EOSbetdiceadminPredictorandTrader.py", line 424, in whl
rollahead = rollaheadme()
File "C:/Users/R.K Tyagi/Documents/VulturesPick/EOS/EOSbetdiceadminPredictorandTrader.py", line 192, in rollaheadme
timeout=30)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\cleos.py", line 132, in get_table
return self.post('chain.get_table_rows', params=None, json=json, timeout=timeout)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\cleos.py", line 33, in post
return cmd.post_url(url, **kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\dynamic_url.py", line 39, in post_url
r = requests.post(url,params=params, json=json, data=data, timeout=timeout)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='proxy.eosnode.tools', port=443): Read timed out. (read timeout=30)

Process finished with exit code 1

Set Contract

Have you looked at adding set contract to eospy?

ps. Thank you for developing this library. I use it alot.

Transaction can not be pushed

I tried to send my transaction to "dice" token but it fails with below message

Traceback (most recent call last):
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\connection.py", line 80, in create_connection
raise err
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\connection.py", line 70, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 600, in urlopen
chunked=chunked)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1016, in _send_output
self.send(msg)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 956, in send
self.connect()
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 181, in connect
conn = self._new_conn()
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000001E909F86630>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='api.pennstation.eosnewyork.io', port=7001): Max retries exceeded with url: /v1/chain/abi_json_to_bin (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E909F86630>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/R.K Tyagi/Documents/VulturesPick/EOS/eos.py", line 21, in
data=ce.abi_json_to_bin(payload['account'],payload['name'],arguments)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\eospy\cleos.py", line 192, in abi_json_to_bin
return self.post('chain.abi_json_to_bin', params=None, json=json, timeout=timeout)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\eospy\cleos.py", line 33, in post
return cmd.post_url(url, **kwargs)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\eospy\dynamic_url.py", line 39, in post_url
r = requests.post(url,params=params, json=json, data=data, timeout=timeout)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 116, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\R.K Tyagi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='api.pennstation.eosnewyork.io', port=7001): Max retries exceeded with url: /v1/chain/abi_json_to_bin (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001E909F86630>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

Process finished with exit code 1

how to remove time in keys.sign()

k = ecdsa.rfc6979.generate_k(self._sk.curve.generator.order(), self._sk.privkey.secret_multiplier, hashlib.sha256, bytearray(sha256(digest + struct.pack('d', time.time())), 'utf-8') # use time to randomize )
hi!
if i do'nt want to use time to randomize ,how to modify?

get transaction is failing?

Trying to execute "get transaction --transaction TRANSACTION" command by receive the following errors:

Traceback (most recent call last): File "/home/chitrarth/envs/eospy/bin/pycleos", line 11, in <module> sys.exit(cleos()) File "/home/chitrarth/envs/eospy/local/lib/python2.7/site-packages/eospy/command_line.py", line 123, in cleos console_print(ce.get_transaction(args.transaction, timeout=args.timeout)) File "/home/chitrarth/envs/eospy/local/lib/python2.7/site-packages/eospy/cleos.py", line 122, in get_transaction return self.post('history.get_transaction', params=None, json={'id': trans_id}, timeout=timeout) File "/home/chitrarth/envs/eospy/local/lib/python2.7/site-packages/eospy/cleos.py", line 31, in post return cmd.post_url(url, **kwargs) File "/home/chitrarth/envs/eospy/local/lib/python2.7/site-packages/eospy/dynamic_url.py", line 43, in post_url raise requests.exceptions.HTTPError('Error: {}'.format(r.json())) requests.exceptions.HTTPError: Error: {u'message': u'Not Found', u'code': 404, u'error': {u'what': u'unspecified', u'code': 0, u'name': u'exception', u'details': [{u'line_number': 298, u'message': u'Unknown Endpoint', u'method': u'handle_http_request', u'file': u'http_plugin.cpp'}]}}

Request: Output json from CLI

With json output instead of Python dictionaries, one could pipe the results into other CLI tools such as jq or gron.

EOSKey sign is very slow,

it take more then 0.5s,more slow than bitcoin sign.

from bitcoin.wallet import CBitcoinSecret
from bitcoin.signmessage import BitcoinMessage, VerifyMessage, SignMessage
import sys
import os
import json
import time
def test_sign_message_simple():

    t0 = time.time()
    key = 'xxxx'
    key1 = CBitcoinSecret(key)
    address = "1F26pNMrywyZJdr22jErtKcjF8R3Ttt55G"
    message = address

    message = BitcoinMessage(message)
    signature = SignMessage(key1, message)

    print(signature)
    t1 = time.time()
    print(VerifyMessage(address, message, signature))
    import struct

    # encode
    from eospy.keys import EOSKey, check_wif
    import hashlib

    address = "1F26pNMrywyZJdr22jErtKcjF8R3Ttt55G"
    t2 = time.time()
    k = EOSKey(key)
    #print("hash data :", data)
    data = address
    digest = hashlib.sha256(data.encode('utf-8')).hexdigest()
    #print("hash 256 :", digest)
    sig = k.sign(digest)
    t3 = time.time()
    print(sig)
    print(len(digest))
    print('eos key time %r %r %r ' % (t3-t2, t2-t1, t1- t0))
    #print("sig:", sig)

test_sign_message_simple()
b'G32RQdgYlyAOOPaitFD3qW/X+iX6cjHR6RMU1yN3Q4HcdG0Jen73XqsVQ28utWJoVbaijpWsWcn7kjln1ZSsf/I='
False
SIG_K1_KdkeDLaAHzAnTrx14obQWpfGGCyTYsV3dQbY3JXEcQjj1Xyib66avhfZppj1w3fe1vdvhzf5RF3bawXdSvVAzi2Ae8fJiL
64
eos key time 0.7665700912475586 0.02545309066772461 0.26550722122192383

Missing changelog

Howdy,

Is there a changelog anywhere that I could take a look at? I want to update from 2.0.1 to 2.1.0 but I am not super familiar with this library and what has been going on.

Thanks

AttributeError: 'str' object has no attribute 'decode'

OS: MacOS 10.13.6
Python 3.6.5

$wget https://raw.githubusercontent.com/eosnewyork/eospy/master/examples/push_transaction.py
$python3 push_transaction.py
Traceback (most recent call last):
  File "push_transaction.py", line 35, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "/usr/local/lib/python3.6/site-packages/eospy/cleos.py", line 159, in push_transaction
    signatures.append(k.sign(digest))
  File "/usr/local/lib/python3.6/site-packages/eospy/keys.py", line 187, in sign
    return 'SIG_K1_' + self._check_encode(hexlify(sigstr), 'K1').decode()
AttributeError: 'str' object has no attribute 'decode'

verify function in EOSKey may always get a "True" result

The "verify" function in eospy/keys.py uses the "recovered" public key from signature to verify the signature itself. This means we will always get a True result no matter the signature was generated from which private key.

I think that your intention here is to use the VerifyKey from EOSKey itself to verify the digest.

def verify(self, encoded_sig, digest) :
    ''' '''
    # remove SIG_ prefix
    encoded_sig = encoded_sig[4:]
    # remove curve prefix
    curvePre = encoded_sig[:3].strip('_')
    if curvePre != 'K1' :
        raise TypeError('Unsupported curve prefix {}'.format(curvePre))

    decoded_sig = self._check_decode(encoded_sig[3:], curvePre)
    # use sig
    sig = decoded_sig[2:]
    # verify sig
    return self._vk.verify_digest(unhexlify(sig), unhexlify(digest), sigdecode=ecdsa.util.sigdecode_string)

AttributeError in example/push_transaction

When using example/push_transaction.py, the prog shows error as follows,

$  python3 push_transaction.py
>  File "push_transaction.py", line 130, in <module>
>    vote_data = sys_abi.json_to_bin(vote_payload['name'], vote_params)
> AttributeError: 'Abi' object has no attribute 'json_to_bin'

(you can see in VOTE part)

However in sys_abi (in eospy/types.py), there is json_to_bin function. What's happening? Can anyone help me?

Internal Service Error, unsatisfied_authorization

Hi, I use a private key string in the main net to transfer and get below error.
I double check the private key string , the from account ,and to account , there is no typo error. Is there any advise?

import eospy.cleos
import pytz   
import datetime as dt 
import eospy.keys 
def tran():
    ce = eospy.cleos.Cleos(url='https://api.eosnewyork.io') 
    arguments = { "from": "XXXXXXXX",
                  "to": "YYYYYYYY", 
                  "quantity": '0.1 EOS', 
                  "memo": "",
                 }
    payload = {
        "account": "eosio.token",
        "name": "transfer",
        "authorization": [{
            "actor": "eosio",
            "permission": "active",
        }],
    }
    data=ce.abi_json_to_bin(payload['account'],payload['name'],arguments)
     #Inserting payload binary form as "data" field in original payload
    payload['data']=data['binargs']
     #final transaction formed
    trx = {"actions": [payload]}
    trx['expiration'] = str((dt.datetime.utcnow() + dt.timedelta(seconds=60)).replace(tzinfo=pytz.UTC))
    key ="5XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    resp = ce.push_transaction(trx, key, broadcast=True)
    print('------------------------------------------------')
    print(resp)
    print('------------------------------------------------')
if __name__ == "__main__":
    tran()

===================================
Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3090003, 'name': 'unsatisfied_authorization', 'what': 'Provided keys, permissions, and delays do not satisfy declared authorizations', 'details': [{'message': 'transaction declares authority \'{"actor":"eosio","permission":"active"}\', but does not have signatures for it under a provided delay of 0 ms, provided permissions [], provided keys ["EOS7XXXXXXXXXXXXXXXXXXXXXXXXX"], and a delay max limit of 3888000000 ms', 'file': 'authorization_manager.cpp', 'line_number': 520, 'method': 'check_authorization'}]}}

ImportError: cannot import name 'InvalidKeyFile'

  File "/usr/local/lib/python3.6/site-packages/eospy/cleos.py", line 6, in <module>
    from .keys import EOSKey, check_wif
  File "/usr/local/lib/python3.6/site-packages/eospy/keys.py", line 6, in <module>
    from .utils import sha256, ripemd160, str_to_hex, hex_to_int
  File "/usr/local/lib/python3.6/site-packages/eospy/utils.py", line 5, in <module>
    from .exceptions import InvalidKeyFile

Can't sign transaction with key.sign(digest)

I want to create script that signing transaction from json file. I used cleos utility for signing transactions and it works properly, but now I switched to eospy lib and I am trying to write implementation of signer on Python. What I have:

def sign_transaction(ce, trx, private_key):
    digest = sig_digest(trx.encode(), ce.get_chain_lib_info()[0]['chain_id'])
    signatures = []
    for key in [EOSKey(private_key)]:
        signatures.append(key.sign(digest))

    print(key.sign_string(trx))
    trx = json.loads(trx)
    trx["signatures"] = signatures
    trx["context_free_data"] = []
    trx = {'compression': 'none', 'transaction': trx, 'signatures': signatures}

    print(key.sign(digest))
    print("should be False: " + str(key.verify(signatures[0], digest)))

    return json.dumps(trx, cls=EOSEncoder)

This is signing transaction with wrong key. Right key I can gain from result of this command with the same transaction file. One file and two key results: from cleos -- right, from EOSpy -- wrong. Cleos command:
cleos sign mytransaction.json --private-key=5KY4h8ZhimenWNEb7D4Dn49pzw35bJSrvNi55MD4vaLgJHspMBS

Is there any error or mistake in EOSpy source code? Or what did I do wrong? Please help :-)

Bad Gateway for url: https://api.eosnewyork.io/v1/chain/get_info

Hi, I'm trying to use your library, using your examples.

OS : Ubuntu Linux
Python: 3.6.5

When I run pycleos --url https://api.eosnewyork.io get info
I get:

Traceback (most recent call last):
File "/home/paul/env/eos-playground/bin/pycleos", line 11, in
load_entry_point('eospy==1.0.3', 'console_scripts', 'pycleos')()
File "/home/paul/env/eos-playground/lib/python3.6/site-packages/eospy/command_line.py", line 73, in cleos
pp.pprint(ce.get_info())
File "/home/paul/env/eos-playground/lib/python3.6/site-packages/eospy/cleos.py", line 57, in get_info
return self.get('chain.get_info')
File "/home/paul/env/eos-playground/lib/python3.6/site-packages/eospy/cleos.py", line 23, in get
return cmd.get_url(url, **kwargs)
File "/home/paul/env/eos-playground/lib/python3.6/site-packages/eospy/dynamic_url.py", line 34, in get_url
r.raise_for_status()
File "/home/paul/env/eos-playground/lib/python3.6/site-packages/requests/models.py", line 939, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://api.eosnewyork.io/v1/chain/get_info

Can you update your examples with a working URL? Or publish a list where to get those URLs?

For the url, I tried to use one found at https://eosnodes.privex.io/

E.g. http://node1.eosnewyork.io:6987

(I tried also with https, but then it hangs, nothing happens, I have to kill the program).

Please update the readme with working examples and more info, thanks.

dublicate transaction

I would like to push transaction with a high frequency, near 20 transactions in 10 seconds. When I start push transaction I get error :

Traceback (most recent call last):
  File "/Users/user/Documents/bla/venv/lib/python3.7/site-packages/eospy/dynamic_url.py", line 41, in post_url
    r.raise_for_status()
  File "/Users/user/Documents/bla/venv/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 409 Client Error: Conflict for url: http://api.eosnewyork.io/v1/chain/push_transaction

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "main.py", line 38, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "/Users/user/Documents/bla/venv/lib/python3.7/site-packages/eospy/cleos.py", line 173, in push_transaction
    return self.post('chain.push_transaction', params=None, data=data, timeout=timeout)
  File "/Users/user/Documents/bla/venv/lib/python3.7/site-packages/eospy/cleos.py", line 33, in post
    return cmd.post_url(url, **kwargs)
  File "/Users/user/Documents/bla/venv/lib/python3.7/site-packages/eospy/dynamic_url.py", line 43, in post_url
    raise requests.exceptions.HTTPError('Error: {}'.format(r.json()))
requests.exceptions.HTTPError: Error: {'code': 409, 'message': 'Conflict', 'error': {'code': 3040008, 'name': 'tx_duplicate', 'what': 'Duplicate transaction', 'details': [{'message': 'duplicate transaction 2ada2e84a48aad72c6fcba7d3d014d40dd36b27079dd76d95b714f3cc0accf1d', 'file': 'producer_plugin.cpp', 'line_number': 409, 'method': 'process_incoming_transaction_async'}]}}

pushtransaction and concurent.futures doesn't work.

import eospy.cleos
import concurrent.futures
import time


ce = eospy.cleos.Cleos(url='http://api.eosnewyork.io')


def send_tx():
    arguments = {
        "from": "pete",  # sender
        "to": "dan",  # receiver
        "quantity": '0.1000000',  # In EOS
        "memo": "this is fake names",
    }

    payload = {
        "account": "eos.token",
        "name": "transfer",
        "authorization": [{
                "actor": "pete",
                "permission": "active",
        }],
    }

    # Converting payload to binary
    data = ce.abi_json_to_bin(
        payload['account'], payload['name'], arguments)

    # Inserting payload binary form as "data" field in original payload
    payload['data'] = data['binargs']

    # final transaction formed
    trx = {"actions": [payload]}

    # trx['expiration'] = str(
    #     (dt.datetime.utcnow() + dt.timedelta(seconds=60)).replace(tzinfo=pytz.UTC))
    # use a string or EOSKey for push_transaction

    key = "key here"
    resp = ce.push_transaction(trx, key, broadcast=True)
    return resp


def main():
    t0 = time.time()
    with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
        futures = [executor.submit(send_tx) for _ in range(4)]

        for trx in concurrent.futures.as_completed(futures):
            try:
                data = trx.result()
            except Exception as e:
                print(f'exception: {e}')
            else:
                print(data)

    t1 = time.time()

    print(f'duration: {t1 - t0}')


if __name__ == "__main__":
    main()

I got result only from 1 transaction.

run examples error

$ python push_transaction.py

$ python push_transaction.py
{'binargs': '0000000000ea3055408608850c110e3d102700000000000004454f53000000000474657374'}
actions: {'actions': [{'account': 'eosio.token', 'name': 'transfer', 'authorization': [{'actor': 'eosio', 'permission': 'active'}], 'data': '0000000000ea3055408608850c110e3d102700000000000004454f53000000000474657374'}]}
Traceback (most recent call last):
  File "push_transaction.py", line 18, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\cleos.py", line 146, in push_transaction
    encoded = trx.encode()
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 196, in encode
    hdr_buf = self._encode_hdr()
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 184, in _encode_hdr
    exp = self._encode_buffer(UInt32(exp_ts))
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 81, in _encode_buffer
    return EOSBuffer(value).encode()
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 248, in encode
    return self._write_number(val, 'I')
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 212, in _write_number
    le = convert_little_endian(val, format)
  File "C:\Users\nb\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 11, in convert_little_endian
    return struct.pack('<{}'.format(format), buf)
NameError: name 'struct' is not defined

Create multisig account

Hi,

I am trying to create multisig account, for that, we need 2 public and private key to import them into the wallet.

Do you have any plan to add multisig functionality if no can you help me to understand with the following questions:

  1. To create multisig account we need both public and private key and can be used as active and owner key, how to get the public and private keys (We can get the keys by using cleos command ./cleos create key --to-console) ?
  2. How to manage a wallet? As we have to import the private keys.

won't run on qpython3 for Android

when running setup.py i get

/data/user/0/org.qpython.qpy3/files/bin/qpython-android5.sh "/storage/emulated/0/qpython/projects3/eospy-1/0000000/eospy-1.1.8/.last_tmp.py" && exit
.1.8/.last_tmp.py" && exit <
Traceback (most recent call last):
File "/storage/emulated/0/qpython/projects3/eospy-1/0000000/eospy-1.1.8/.last_tmp.py", line 11, in
packages=find_packages(),
File "/data/user/0/org.qpython.qpy3/files/lib/python3.2/site-packages/setuptools-1.1-py3.2.egg/setuptools/init.py", line 38, in find_packages
OSError: [Errno 13] Permission denied: '.'

3.6.5 unsupported operand types for & 'float' and 'int'

@jerryfane this should be fixed in 1.1.7. Can you confirm that?

@plimerence I'm taking a look now. Hopefully should have a fix shortly.

I've just tried but I get this error every time I try to push a transaction now..

Traceback (most recent call last):
  File "pycleos.py", line 51, in <module>
    resp = ce.push_transaction(trx, key, broadcast=True)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\cleos.py", line 147, in push_transaction
    digest = sig_digest(trx.encode(), chain_info['chain_id'])
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 202, in encode
    actions = self._encode_buffer(self.actions)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 85, in _encode_buffer
    return EOSBuffer(value).encode()
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 266, in encode
    e_item = self.encode(item)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 262, in encode
    return val.encode()
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 109, in encode
    data_len = self._encode_buffer(VarUInt(len(self.data)/2))
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 85, in _encode_buffer
    return EOSBuffer(value).encode()
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 255, in encode
    return self._write_varuint(val)
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 229, in _write_varuint
    buf = vuint.encode()
  File "C:\Users\Jerry\AppData\Local\Programs\Python\Python36\lib\site-packages\eospy\types.py", line 56, in encode
    buf = int((val) & 0x7f)
TypeError: unsupported operand type(s) for &: 'float' and 'int'

I'm using Windows 10, python 3.6.5 and eospy 1.1.7 (just updated)

Originally posted by @jerryfane in #19 (comment)

push_transaction is very slow

my code :

        t1 = time.time()
         for bet in bet_list:
             betid = bet['id']
            server_seed = bet['server_seed']
             act = make_push_data(ce, from_, betid, server_seed)
             actions.append(act)

         trx = {"actions": actions}
         key = 'xxxx'
         t2 = time.time()
         resp = ce.push_transaction(trx, key, broadcast=True)
         t3 = time.time()
        logger.info("testpush t1 %f t2 %f, len %d ,%s " % (t2-t1, t3-t2, len(bet_list), consts.chain_url))


my log is:

cron_2018_10_22_20.log:2018-10-22 12:52:21,441 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.113391 t2 1.053547, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:52:40,241 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.023461 t2 1.105462, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:52:48,445 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.010504 t2 1.122615, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:14,952 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.052556 t2 0.926066, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:24,333 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.296603 t2 1.130232, len 1 ,http://172.31.129.125:8888
cron_2018_10_22_20.log:2018-10-22 12:53:33,696 cron [reveal3.py:208] [reveal3:reveal] [INFO]- testpush t1 0.028622 t2 0.687707, len 1 ,http://172.3

How to get the signature to send in memo

I need to send in signature and other fields in memo as provided by scatter to trigger trustdicewin contract. A typical memo from scatter for trustdicewin is

memo under-50-951d93bc7cb5ac1e480b991cac61348050e0faa831de337aaecef08eee6f7213-d142c9101ee4b569486d3c6e50e437f2c7c99410-1549217121-0-lynxtrustdic-SIG_K1_K4QdxaLFagCvwj7rFJqqNmzh272AyKbCdeh57uH8A5KsmpA4ikT4dao59XJAa55EJQrJQLbccGdtAynMAWp1rRfT6enTeJ

I tried to build memo for trustdicewin - but I get below error. How to do that please?

raise requests.exceptions.HTTPError('Error: {}'.format(r.json()))
requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3050003, 'name': 'eosio_assert_message_exception', 'what': 'eosio_assert_message assertion failure', 'details': [{'message': 'assertion failure with message: memo has more than 256 bytes', 'file': 'wasm_interface.cpp', 'line_number': 917, 'method': 'eosio_assert'}, {'message': 'pending console output: ', 'file': 'apply_context.cpp', 'line_number': 72, 'method': 'exec_one'}]}}

long sign time and eosjs verify

Dear EOSPY developers,

Your project is very important to me! Thanks for the great work on the ECC algo.

1, Sometimes sign is quick, while sometimes it takes long to sign. (minutes)
It will keep poping:
Still searching for a signature. Tried 10 times.
Still searching for a signature. Tried 10 times.
Still searching for a signature. Tried 10 times.

My recent occurence takes 4min to sign 4 strings.

Does it matter that time randomization is added or removed? I already removed it, before this I even got as long as 18mins to sign 10 strings.

2, is the signature algo same as eosjs-cc? The signature I got here seems to fail eosjs-cc verify. Not sure if they have any difference.

Thank you!

sign error with long memo

If memo's length is great then 95 , push_transaction would got error 'unsatisfied_authorization' .

Get Table function giving error

I am trying to get table information with below code
cd=ce.get_code("betdiceadmin")
rollahead=ce.get_table(code=cd["code_hash"],scope="betdiceadmin",table="bet",lower_bound=0,limit=5,timeout=30)

but It gives below error
Traceback (most recent call last):
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\dynamic_url.py", line 41, in post_url
r.raise_for_status()
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\requests\models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://eos.greymass.com:443/v1/chain/get_table_rows

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/R.K Tyagi/Documents/VulturesPick/EOS/EOSbetdiceadminPredictorandTrader.py", line 58, in
rollahead=ce.get_table(code=cd["wasm"],scope="betdiceadmin",table="bet",lower_bound=0,limit=5,timeout=30)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\cleos.py", line 132, in get_table
return self.post('chain.get_table_rows', params=None, json=json, timeout=timeout)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\cleos.py", line 33, in post
return cmd.post_url(url, **kwargs)
File "C:\Users\R.K Tyagi\PycharmProjects\MagicDice\venv\lib\site-packages\eospy\dynamic_url.py", line 43, in post_url
raise requests.exceptions.HTTPError('Error: {}'.format(r.json()))
requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3010001, 'name': 'name_type_exception', 'what': 'Invalid name', 'details': [{'message': 'Name is longer than 13 characters

Process finished with exit code 1

How to solve this?

'error': {'code': 3080004, 'name': 'tx_cpu_usage_exceeded'

My account has enough CPU but I am receving this message very often. How can I avoid this?

requests.exceptions.HTTPError: Error: {'code': 500, 'message': 'Internal Service Error', 'error': {'code': 3080004, 'name': 'tx_cpu_usage_exceeded', 'what': 'Transaction exceeded the current CPU usage limit imposed on the transaction', 'details': [{'message': 'billed CPU time (2139 us) is greater than the maximum billable CPU time for the transaction (0 us)', 'file': 'transaction_context.cpp', 'line_number': 520, 'method': 'validate_cpu_usage_to_bill'}]}}

"ImportError: cannot import name ABC"

OS: Mac 10.14.3, have both Python2.7 and Python3.x
library version: v2.0.0, installed with pip

run with python2

MacBook-Pro:examples oc$ python --version
Python 2.7.16
MacBook-Pro:examples oc$ python create_user.py 
Traceback (most recent call last):
  File "create_user.py", line 1, in <module>
    from eospy.cleos import Cleos
  File "/usr/local/lib/python2.7/site-packages/eospy/cleos.py", line 6, in <module>
    from .keys import EOSKey, check_wif
  File "/usr/local/lib/python2.7/site-packages/eospy/keys.py", line 7, in <module>
    from .signer import Signer
  File "/usr/local/lib/python2.7/site-packages/eospy/signer.py", line 1, in <module>
    from abc import ABC, abstractmethod
ImportError: cannot import name ABC

run with python3

MacBook-Pro:examples oc$ python3 --version
Python 3.7.3
MacBook-Pro:examples oc$ python3 create_user.py 
Traceback (most recent call last):
  File "create_user.py", line 1, in <module>
    from eospy.cleos import Cleos
ModuleNotFoundError: No module named 'eospy'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.