Git Product home page Git Product logo

steem-python's Introduction

Official Python STEEM Library

steem-python is the official Steem library for Python. It comes with a BIP38 encrypted wallet and a practical CLI utility called steempy.

This library currently works on Python 2.7, 3.5 and 3.6. Python 3.3 and 3.4 support forthcoming.

Installation

With pip:

pip3 install steem      # pip install steem for 2.7

From Source:

git clone https://github.com/steemit/steem-python.git
cd steem-python
python3 setup.py install        # python setup.py install for 2.7

Homebrew Build Prereqs

If you're on a mac, you may need to do the following first:

brew install openssl
export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix openssl)/lib $LDFLAGS"

CLI tools bundled

The library comes with a few console scripts.

  • steempy:
    • rudimentary blockchain CLI (needs some TLC and more TLAs)
  • steemtail:
    • useful for e.g. steemtail -f -j | jq --unbuffered --sort-keys .

Documentation

Documentation is available at http://steem.readthedocs.io

Tests

Some tests are included. They can be run via:

  • python setup.py test

TODO

  • more unit tests
  • 100% documentation coverage, consistent documentation
  • migrate to click CLI library

Notice

This library is under development. Beware.

steem-python's People

Contributors

aaroncox avatar aditya-ramabadran avatar alexchien avatar bitphage avatar crokkon avatar e-d-a avatar economicstudio avatar fxnormaluser avatar goldibex avatar gwennelson avatar inertia186 avatar john-g-g avatar marneedear avatar metaperl avatar netherdrake avatar relativityboy avatar roadscape avatar sneak avatar theoreticalbts avatar wjashan 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  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

steem-python's Issues

stream_from: trailing head_block parameter

stream_from follows last irreversible block unless one uses b = Blockchain(mode='head').

In addition to these two modes, it would be very useful to have the ability to follow head_block - n.

orderbook subcommand is broken

sneak@rabotnik:~$ steempy orderbook -h
usage: steempy orderbook [-h] [--chart]

optional arguments:
  -h, --help  show this help message and exit
  --chart     Enable charting (requires matplotlib)
sneak@rabotnik:~$ steempy orderbook 
No valid command given
sneak@rabotnik:~$ steempy orderbook --chart
No valid command given
sneak@rabotnik:~$ 

[steem.wallet] get_key_references is not a reliable way to reverse lookup account names

The plugin seems to be unreliable.
Furthermore, multiple accounts could share the same keys.

Code in question:

    def getAccountFromPublicKey(self, pub):
        """ Obtain account name from public key
        """
        # FIXME, this only returns the first associated key.
        # If the key is used by multiple accounts, this
        # will surely lead to undesired behavior
        names = self.steemd.exec('get_key_references', [pub], api="account_by_key_api")[0]
        if not names:
            return None
        else:
            return names[0]

Potential Solution:
One way to solve this would be to ask users for the username of the account/private key are are importing. This is how Vessel does it.

steem.readthedocs.io does not reference this repo

I started reading the docs, on http://steem.readthedocs.io/ as suggested by README.md. That site says:

"steem-python is the official STEEM library for Python. It comes with a BIP38 encrypted wallet and a practical CLI utility called stemepy."

I wanted to submit a PR to change the typo stemepy, but I found (by clicking on the "Edit on GitHub" link) that the readthedocs site references the Netherdrake repo.

I propose one of the following two solutions:

  • (a) Change the readthedocs setup to point the steem.readthedocs.io URL to documentation generated from this repo (steemit/steem-python) instead of netherdrake/steem-python.
  • (b) If solution (a) is not possible, create a new documentation hosting URL for this repo (on readthedocs or otherwise). Then change the README.md in this repo to point to that URL.

Steempy Addkey

Learning my way around and getting the following error for the steem conductor Wallet installation

https://steemit.com/steem/@furion/introducing-conductor-a-simple-steem-witness-toolkit

root@steemWitness123:# steempy addkey
Traceback (most recent call last):
File "/usr/local/bin/steempy", line 9, in
load_entry_point('steem==0.18.93', 'console_scripts', 'steempy')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2229, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2235, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.5/dist-packages/steem/init.py", line 2, in
from .steem import Steem
File "/usr/local/lib/python3.5/dist-packages/steem/steem.py", line 1, in
from .commit import Commit
File "/usr/local/lib/python3.5/dist-packages/steem/commit.py", line 20, in
from .account import Account
File "/usr/local/lib/python3.5/dist-packages/steem/account.py", line 8, in
from funcy.simple_funcs import rpartial
ImportError: No module named 'funcy.simple_funcs'
root@steemWitness1223:
#

Should fail gracefully without write access to disk

Not all library operations require keys and/or a wallet, eg, streaming blocks from blockchain.

hive_1   | Traceback (most recent call last):                                      
hive_1   |   File "/app/hive/server/serve.py", line 13, in <module>                
hive_1   |     from hive.indexer.core import db_last_block, head_state             
hive_1   |   File "/app/hive/indexer/core.py", line 11, in <module>                
hive_1   |     from steem.blockchain import Blockchain                             
hive_1   |   File "/usr/local/lib/python3.5/dist-packages/steem/__init__.py",   
line 2, in <module>                                                                
hive_1   |     from .steem import Steem                                            
hive_1   |   File "/usr/local/lib/python3.5/dist-packages/steem/steem.py", line 
1, in <module>                                                                     
hive_1   |     from .commit import Commit                                          
hive_1   |   File "/usr/local/lib/python3.5/dist-packages/steem/commit.py",        
line 18, in <module>                                                               
hive_1   |     from steembase.storage import configStorage                         
hive_1   |   File                                                                  
"/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 459, in        
<module>                                                                           
hive_1   |     keyStorage = Key()                                                  
hive_1   |   File                                                                  
"/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 114, in        
__init__                                                                           
hive_1   |     super(Key, self).__init__()                                         
hive_1   |   File                                                                  
"/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 51, in         
__init__                                                                           
hive_1   |     self.mkdir_p()                                                      
hive_1   |   File                                                                  
"/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 61, in         
mkdir_p                                                                            
hive_1   |     os.makedirs(self.data_dir)                                          
hive_1   |   File "/usr/lib/python3.5/os.py", line 231, in makedirs                
hive_1   |     makedirs(head, mode, exist_ok)                                      
hive_1   |   File "/usr/lib/python3.5/os.py", line 231, in makedirs                
hive_1   |     makedirs(head, mode, exist_ok)                                      
hive_1   |   File "/usr/lib/python3.5/os.py", line 231, in makedirs                
hive_1   |     makedirs(head, mode, exist_ok)                                      
hive_1   |   File "/usr/lib/python3.5/os.py", line 241, in makedirs                
hive_1   |     mkdir(name, mode)                                                   
hive_1   | PermissionError: [Errno 13] Permission denied: '/nonexistent'   

Random Error?

I seem to randomly get the error below.

Example:
now < trx.expiration:
{"now":"2017-09-18T00:44:00","trx.exp":"2017-09-18T00:43:34"}
th_a database.cpp:2857 _apply_transaction

I've had it happen during submitting a post, attempting an upvote, and transferring funds.

It appears that my VPS is at least 26 seconds off but it is not.

Is there something that I can adjust and extend the transaction expiration?

TIA
Ric

missing required feature: account recovery

The following three commands:

    (request_account_recovery)
    (recover_account)
    (change_recovery_account)

If this is going to replace cli_wallet (looks like it is), it needs to fully support account recovery.

Voting Power does not update until a new vote is cast.

The value in "voting_power" returned from steemd.get_account("myaccount") does not update until after I make a new vote on steemit.com. The value will update to the correct "Voting Power" after I cast a new vote, however it does not update again until I cast another vote. It appears to not take into account the replenishing of the Voting Power until a new vote is cast under your account. Steemd.com appears to have the correct value. Any ideas what is going on, it seems steemdb.com has the same lag. Thanks!

steem.post() doesn't work when contains single quotes in body

I encountered some problems when I tried to use python-steem to post on steemit.
I will simplify the problem into the following code

from steem import Steem

tags=['test', 'spam']

content1 = "Test only, don't upvote"
content2 = "Test only, dont upvote"

steem=Steem()
steem.post(title='test only', body=content1, author='oflyhigh', tags=tags)
print("Done!")

The content1 doesn't work but content2 works well.
And all of them work well under piston.

So, what's wrong?


Error message:

ValueError: Invalid TransactionBuilder Format

Why not create newaccount?

I have error:

Traceback (most recent call last):
  File "/usr/local/bin/steempy", line 11, in <module>
    sys.exit(legacy())
  File "/usr/local/lib/python3.5/dist-packages/steem/cli.py", line 1282, in legacy
    delegation_fee_steem=args.fee,
  File "/usr/local/lib/python3.5/dist-packages/steem/commit.py", line 484, in create_account
    self.wallet.addPrivateKey(active_privkey)
  File "/usr/local/lib/python3.5/dist-packages/steem/wallet.py", line 212, in addPrivateKey
    self.keyStorage.add(self.encrypt_wif(wif), pub)
  File "/usr/local/lib/python3.5/dist-packages/steem/wallet.py", line 151, in encrypt_wif
    self.unlock()
  File "/usr/local/lib/python3.5/dist-packages/steem/wallet.py", line 100, in unlock
    masterpwd = self.MasterPassword(pwd)
  File "/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 401, in __init__
    self.decryptEncryptedMaster()
  File "/usr/local/lib/python3.5/dist-packages/steembase/storage.py", line 413, in decryptEncryptedMaster
    raise WrongMasterPasswordException
steembase.storage.WrongMasterPasswordException

I tested command:

steempy newaccount divali8 --account furion --fee "9 STEEM"

steempy newaccount divali888 --account steemy

steempy newaccount divali888

I used pass example
P5KQK4iogQypqYAzXbHWmhbwxddVFz8Xhg69czjKLDVhKwEQT2KY - use online generate
mp903804124

My OS
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Python
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)

Please help me
))

Lack of dependency. (ImportError: No module named 'datashape')

After installing on clean Ubuntu 16.04 LTS
steempy
results in:

Traceback (most recent call last):
  File "/usr/local/bin/steempy", line 7, in <module>
    from steem.cli import legacy
  File "/usr/local/lib/python3.5/dist-packages/steem/cli.py", line 10, in <module>
    from datashape import json
ImportError: No module named 'datashape'

workaround:
pip3 install -U datashape

Update requirements; funcy v1.9 not compatible

In the funcy module (currently at v1.9), they moved functions from funcy.simple_funcs to funcy.funcs:

Traceback (most recent call last):
  File "./test.py", line 5, in <module>
    from steem.blockchain import Blockchain
  File "/Users/ben/.pyenv/versions/steemit-test/lib/python3.6/site-packages/steem/__init__.py", line 2, in <module>
    from .steem import Steem
  File "/Users/ben/.pyenv/versions/steemit-test/lib/python3.6/site-packages/steem/steem.py", line 1, in <module>
    from .commit import Commit
  File "/Users/ben/.pyenv/versions/steemit-test/lib/python3.6/site-packages/steem/commit.py", line 20, in <module>
    from .account import Account
  File "/Users/ben/.pyenv/versions/steemit-test/lib/python3.6/site-packages/steem/account.py", line 8, in <module>
    from funcy.simple_funcs import rpartial
ModuleNotFoundError: No module named 'funcy.simple_funcs'

Please update account.py to use the new import path or fix version dependency to funcy==1.8.

Invalid permission on claim_reward_balance

I'm getting an error using this method with the proper account/wif combo:

Traceback (most recent call last):
  File "/src/test.py", line 11, in <module>
    s.commit.claim_reward_balance(account=account)
  File "/usr/local/lib/python3.5/site-packages/steem/commit.py", line 813, in claim_reward_balance
    return self.finalizeOp(op, account, "posting")
  File "/usr/local/lib/python3.5/site-packages/steem/commit.py", line 125, in finalizeOp
    tx.appendSigner(account, permission)
  File "/usr/local/lib/python3.5/site-packages/steem/transactionbuilder.py", line 45, in appendSigner
    assert permission in ["active", "owner", "poster"], "Invalid permission"
AssertionError: Invalid permission

To reproduce this issue, use the following code and environmental variables:

from steem import Steem
import os

account        = os.environ['steem_account']
wif            = os.environ['steem_wif']

print(account)
print(wif)

s = Steem(keys=[wif])
s.commit.claim_reward_balance(account=account)

I'm not sure why this occurs, but my account does have 2 unusual things which may not have been considered:

  • My WIF key is used on multiple accounts, jesta and greymass
  • I have a posting authority set to streemian

These two things have caused issues in the past, so I figured I'd mention them.

Any ideas?

'promoted' category not present in 'sort' param of 'get_post' function

While executing following function,
steem.get_posts(limit=self.no_of_post, sort="promoted", category=self.cat_c)
I got following exception
raise Exception("Invalid choice of '--sort'!")

Looking into the code, I came across following observation
get_post function supports parameter sort which is being checked against following list

if sort not in ["trending", "created", "active", "cashout",
                        "payout", "votes", "children", "hot"]:

'promoted' is not present in the list while get_discussions_by_promoted( ) is already present further in the code.
Is there a specific reason why 'promoted' is not included in the list?

beneficiaries: missing posting authority ?

The beneficiaries argument in post doesn't work for me.

steembase.exceptions.RPCError: 3030000 tx_missing_posting_auth: missing required posting authority

I'm using a dictionary for beneficiaries like this:

[{'account': 'account1', 'weight': 5000}, {'account': 'account2', 'weight': 5000}]

Even if I set only the posting account as beneficiary, it returns the same error.

pip is no longer installing

This is due to the weird stuff with setup.py (my own work, intended to allow keeping track of dependencies in only one place).

pip requires an "egginfo" subcommand in setup.py and fails to install without it:
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpbpllscr_build/steem/

To reproduce, do "pip install steem" in a clean environment

Improve Error Messaging for newaccount fee in cli.

sneak@rabotnik:~$ steempy newaccount --account creatoraccount --fee 6 newaccountname
New Account Passphrase: 
Confirm New Account Passphrase: 
Passphrase: 
Traceback (most recent call last):
  File "/Users/sneak/Library/Homebrew/bin/steempy", line 4, in <module>
    __import__('pkg_resources').run_script('steem==0.18.9', 'steempy')
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/EGG-INFO/scripts/steempy", line 7, in <module>
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/cli.py", line 1309, in legacy
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/commit.py", line 528, in create_account
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/amount.py", line 11, in __init__
ValueError: not enough values to unpack (expected 2, got 1)
sneak@rabotnik:~$ 

Streaming blocks throws an exception when global props fail to return

Traceback (most recent call last):
  File "bot.py", line 57, in <module>
    for block in b.stream_from(batch_operations=True):
  File "/usr/local/lib/python3.5/dist-packages/steem/blockchain.py", line 72, in stream_from
    head_block = self.get_current_block_num()
  File "/usr/local/lib/python3.5/dist-packages/steem/blockchain.py", line 40, in get_current_block_num
    return self.info().get(self.mode)
AttributeError: 'NoneType' object has no attribute 'get'

I've been experimenting with a voting bot and at least once a day this is crashing the script.

I'd be willing to fix this myself - but I'm not sure what the preferred approach would be. Should the info call be prevented from returning a NoneType object, or should there be a retry of fetching the info, or finally should there just be an if statement to ensure it's a dict before it calls get on it.

calls to steemd are not robust in the face of timeouts

sneak@rabotnik:~$ steempy listaccounts
Traceback (most recent call last):
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 383, in _make_request
    httplib_response = conn.getresponse()
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1331, in getresponse
    response.begin()
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 297, in begin
    version, status, reason = self._read_status()
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 258, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 586, in readinto
    return self._sock.recv_into(b)
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1002, in recv_into
    return self.read(nbytes, buffer)
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 865, in read
    return self._sslobj.read(len, buffer)
  File "/Users/sneak/Library/Homebrew/Cellar/python3/3.6.0_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 625, in read
    v = self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steembase/http_client.py", line 146, in exec
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/poolmanager.py", line 321, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/util/retry.py", line 357, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/packages/six.py", line 686, in reraise
    raise value
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 389, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/urllib3/connectionpool.py", line 309, in _raise_timeout
    raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value)
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='steemd.steemit.com', port=443): Read timed out. (read timeout=60)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sneak/Library/Homebrew/bin/steempy", line 4, in <module>
    __import__('pkg_resources').run_script('steem==0.18.9', 'steempy')
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/EGG-INFO/scripts/steempy", line 7, in <module>
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/cli.py", line 1137, in legacy
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/wallet.py", line 368, in getAccounts
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/wallet.py", line 331, in getAccount
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/wallet.py", line 322, in getAccountFromPublicKey
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steembase/http_client.py", line 167, in exec
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steembase/http_client.py", line 186, in exec
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steembase/http_client.py", line 206, in _return
steembase.exceptions.RPCError: 10 assert_exception: Assert Exception
false: database_api::get_key_references has been deprecated. Please use account_by_key_api::get_key_references instead.
    {}
    th_a  database_api.cpp:402 get_key_references

    {"call.method":"get_key_references","call.params":[["STM...redacted..."]]}
    th_a  websocket_api.cpp:124 on_message
sneak@rabotnik:~$ 

package installed via `pip install steem` has funcy import errors

System: Ubuntu 16.04 x64 minimal
Python: 3.5.2
Command: steempy addkey
Error output:

"stdout": "Traceback (most recent call last):
  File \"/usr/local/bin/steempy\", line 7, in <module>
   from steem.cli import legacy
  File \"/usr/local/lib/python3.5/dist-packages/steem/__init__.py\", line 2, in <module>
   from .steem import Steem
  File \"/usr/local/lib/python3.5/dist-packages/steem/steem.py\", line 1, in <module>
    from .commit import Commit
  File \"/usr/local/lib/python3.5/dist-packages/steem/commit.py\", line 20, in <module>
    from .account import Account
  File \"/usr/local/lib/python3.5/dist-packages/steem/account.py\", line 8, in <module>
    from funcy.simple_funcs import rpartial
ImportError: No module named 'funcy.simple_funcs'",
    "stdout_lines": [
        "Traceback (most recent call last):",
        "  File \"/usr/local/bin/steempy\", line 7, in <module>",
        "    from steem.cli import legacy",
        "  File \"/usr/local/lib/python3.5/dist-packages/steem/__init__.py\", line 2, in <module>",
        "    from .steem import Steem",
        "  File \"/usr/local/lib/python3.5/dist-packages/steem/steem.py\", line 1, in <module>",
        "    from .commit import Commit",
        "  File \"/usr/local/lib/python3.5/dist-packages/steem/commit.py\", line 20, in <module>",
        "    from .account import Account",
        "  File \"/usr/local/lib/python3.5/dist-packages/steem/account.py\", line 8, in <module>",
        "    from funcy.simple_funcs import rpartial",
        "ImportError: No module named 'funcy.simple_funcs'"
    ]

I believe the solution here is to release the latest patches to pypi.

[Errno -5] No address associated with hostname',)'

WARNING:urllib3.connectionpool:Retrying (Retry(total=3, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2f8bba9160>: Failed to establish a new connection: [Errno -5] No address associated with hostname',)': /
WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2f8bba9278>: Failed to establish a new connection: [Errno -5] No address associated with hostname',)': /
WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2f8bba9390>: Failed to establish a new connection: [Errno -5] No address associated with hostname',)': /
WARNING:urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=0, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2f8bba97f0>: Failed to establish a new connection: [Errno -5] No address associated with hostname',)': /
root@watchdog:~# steempy config
+-----+-------+
| Key | Value |
+-----+-------+
+-----+-------+

Create Post

Learning my way around and getting the following error:

$ python
from steem import Steem
steem = Steem(wif='private_posting_key')
steem.post(title="Test", body="blank", author="pennterra", tags=['spam','test'], self_vote=False)
Traceback (most recent call last):
File "", line 1, in
File "/home/ric/python/lib/python3.6/site-packages/steem/commit.py", line 325, in post
return self.finalizeOp(ops, author, "posting")
File "/home/ric/python/lib/python3.6/site-packages/steem/commit.py", line 126, in finalizeOp
tx.sign()
File "/home/ric/python/lib/python3.6/site-packages/steem/transactionbuilder.py", line 108, in sign
raise MissingKeyError
steembase.exceptions.MissingKeyError
quit()

Am I missing something? or is this an issue?

Thanks
Ric

should provide a subcommand for showing pubkeys or privkeys given an account+passphrase like cli_wallet does

i attempted to newaccount and it added the keys to the local keyring using the new account's provided passphrase... but then failed when creating the account, leaving the keys in the wallet but no account created on the blockchain.

now, i've fixed that failure (now specifying the fee as a string and not an int) but the keys are already imported into the keyring (i don't know which, so i can't remove them) so it won't actually do the create now, it fails when attempting to re-import the passphrase-derived keys for the new account (which doesn't exist on the blockchain yet).

this would also be fixed by fixing #56 but such a helper command would be useful regardless. perhaps tying into importwif, but emulating the cli_wallet command get_private_key_from_password:

           pair<public_key_type, string> get_private_key_from_password(string account, string role, st
ring password)

Add circleci circle.yml file for CI

  • either version 1 or 2
  • At very least, should build docker image, but really it should run all tests, preferably inside built docker container

Voting not possible on posts, which has no votes

I get an exception of:
<class 'steembase.exceptions.VotingInvalidOnArchivedPost'>

While voting on a post, which has right now no votes at all.

According to the code "net_rshares = 0" is an indication for a test post. But also for a fresh one.

`

    def vote(self, weight, voter=None):
    """ Vote the post

        :param float weight: Weight for posting (-100.0 - +100.0)
        :param str voter: Voting account
    """
    # Test if post is archived, if so, voting is worthless but just
    # pollutes the blockchain and account history
    if not self.get('net_rshares'):
        raise VotingInvalidOnArchivedPost
    return self.commit.vote(self.identifier, weight, account=voter)`

Not Compatible On Windows 7

Either steem-python or a dependency is using linux-only .h files, including getopt.h and unistd.h.

I have not been able to create a work-around to get this to run on windows. It would have been nice if somewhere in the documentation it said, "This does not run on windows" prior to me going through all these weird work arounds.

"key already in storage" should be a warning, not a fatal, and should not stop execution of the task

sneak@rabotnik:~$ steempy importaccount REDACTED --roles owner active posting memo
Account Passphrase: 
Importing owner key!
Passphrase: 
Importing active key!
Traceback (most recent call last):
  File "/Users/sneak/Library/Homebrew/bin/steempy", line 4, in <module>
    __import__('pkg_resources').run_script('steem==0.18.9', 'steempy')
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/EGG-INFO/scripts/steempy", line 7, in <module>
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/cli.py", line 1334, in legacy
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steem/wallet.py", line 212, in addPrivateKey
  File "/Users/sneak/Library/Homebrew/lib/python3.6/site-packages/steem-0.18.9-py3.6.egg/steembase/storage.py", line 192, in add
ValueError: Key already in storage
sneak@rabotnik:~$ 

stream_from occasionally returns None

Example:

from steem.blockchain import Blockchain
from steem.steemd import Steemd

steemd = Steemd()
b = Blockchain(mode='head')
h = b.stream_from(
    start_block=14500000,
    full_blocks=True,
)
for block in h:
    if not block or 'block_id' not in block:
        raise Exception("invalid block: {}".format(block))

    num = int(block['block_id'][:8], base=16)
    print("Got block {} at {} with {} txs -- ".format(num,
        block['timestamp'], len(block['transactions'])))

Will sometimes fail like:

Got block 14577978 at 2017-08-14T21:41:36 with 19 txs
Got block 14577979 at 2017-08-14T21:41:39 with 17 txs
Got block 14577980 at 2017-08-14T21:41:42 with 15 txs
Traceback (most recent call last):
  File "hive/indexer/core.py", line 412, in <module>
    run()
  File "hive/indexer/core.py", line 400, in run
    listen_steemd()
  File "hive/indexer/core.py", line 354, in listen_steemd
    raise Exception("stream returned invalid block: {}".format(block))
Exception: stream returned invalid block: None

stream_from should never return None. If there is some issue it should throw an exception.

Output from the node indicates this case may have been due to double-production:

2502307ms th_a       application.cpp:507           handle_block         ] Got 15 transactions on block 14577980 by xeldal -- latency: 307 ms
2503812ms th_a       websocket_api.cpp:88          on_message           ] message: {"jsonrpc": "2.0", "id": 0, "params": ["database_api", "get_dynamic_global_properties", []]
2503813ms th_a       websocket_api.cpp:88          on_message           ] message: {"jsonrpc": "2.0", "id": 0, "params": ["database_api", "get_block", [14577980]], "method": "call"}
2505942ms th_a       application.cpp:507           handle_block         ] Got 20 transactions on block 14577981 by fubar-bdhr -- latency: 942 ms
2505995ms th_a       database.cpp:538              _maybe_warn_multiple ] Encountered block num collision at block 14577981 due to a fork, witnesses are: [["fubar-bdhr","2017-08-14T21:41:45"],["fubar-bdhr","2017-08-14T21:41:45"]]
2505996ms th_a       application.cpp:507           handle_block         ] Got 20 transactions on block 14577981 by fubar-bdhr -- latency: 996 ms
2506977ms th_a       websocket_api.cpp:88          on_message           ] message: {"jsonrpc": "2.0", "id": 0, "params": ["database_api", "get_dynamic_global_properties", []], "method": "call"}
2506978ms th_a       websocket_api.cpp:88          on_message           ] message: {"jsonrpc": "2.0", "id": 0, "params": ["database_api", "get_block", [14577981]], "method": "call"}

AttributeError: 'Post' object has no attribute 'post'

Has anyone this issue yet when editing an existing post?

File "edit_post.py", line 49, in post_steem
returncode = p.edit(body=body)
File "/testenv/lib/python3.6/site-packages/steem/post.py", line 288, in edit
return self.post(
File "/testenv/lib/python3.6/site-packages/steem/post.py", line 123, in ge
attr

return object.getattribute(self, key)
AttributeError: 'Post' object has no attribute 'post'

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.