Skip to content

Commit

Permalink
Pushed to production
Browse files Browse the repository at this point in the history
  • Loading branch information
JaredRiceSr committed Sep 17, 2018
1 parent 09018d0 commit 7d0e7ba
Show file tree
Hide file tree
Showing 34 changed files with 273 additions and 649 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ before transmitting the packed file. Please check the hash-sum after downloading

Changelog
=========
0.01.04
-------
* Added dPay Node Running On Appbase (0.20.0) {Moved from Dev network} [d.dpays.io]
* Fixed "invalid reward fund" bug
* Cleaned up typos and typos in docs

0.01.03
-------
* Updated for the dPay network
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ You can see all available commands with ``dpay --help``

Options:
-n, --node TEXT URL for public dPay API (e.g.
https://dpayapi.com)
wss://dpayd.dpays.io)
-o, --offline Prevent connecting to network
-d, --no-broadcast Do not broadcast
-p, --no-wallet Do not load the wallet
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# The short X.Y version.
version = '0.1'
# The full version, including alpha/beta/rc tags.
release = '0.01.03'
release = '0.01.04'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
22 changes: 11 additions & 11 deletions docs/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ It is also possible to access the configuration with the commandline tool `dpayg

.. code-block:: bash
dpaygo config
dpay config
API node URLs
-------------
Expand All @@ -54,15 +54,15 @@ dpaygo can also be used to set nodes:

.. code-block:: bash
dpaygo set nodes wss://dpayd.dpays.io
dpaygo set nodes "['wss://dpayd.dpays.io', 'wss://testnet.dpays.io:6620']"
dpay set nodes wss://dpayd.dpays.io
dpay set nodes "['wss://dpayd.dpays.io', 'wss://testnet.dpays.io:6620']"
The default nodes can be resetted to the default value. When the first node does not
answer, dPay should be set to the offline mode. This can be done by:

.. code-block:: bash
dpaygo -o set nodes ""
dpay -o set nodes ""
or

Expand All @@ -89,7 +89,7 @@ or by dpaygo with

.. code-block:: bash
dpaygo set default_account test
dpay set default_account test
Default voting weight
---------------------
Expand All @@ -106,7 +106,7 @@ or by dpaygo with

.. code-block:: bash
dpaygo set default_vote_weight 100
dpay set default_vote_weight 100
Setting password_storage
Expand All @@ -119,8 +119,8 @@ The password_storage can be set to:

.. code-block:: bash
dpaygo set password_storage environment
dpaygo set password_storage keyring
dpay set password_storage environment
dpay set password_storage keyring
Expand All @@ -142,13 +142,13 @@ It also possible to change the password in the keyring by

.. code-block:: bash
python -m keyring set dpaygo wallet
python -m keyring set dpay wallet
The stored master password can be displayed in the terminal by

.. code-block:: bash
python -m keyring get dpaygo wallet
python -m keyring get dpay wallet
When keyring is set as `password_storage` and the stored password in the keyring
is identically to the set master password of the wallet, the wallet is automatically
Expand All @@ -170,6 +170,6 @@ It can also tested by dpaygo with

.. code-block:: bash
dpaygo walletinfo --test-unlock
dpay walletinfo --test-unlock
When no password prompt is shown, unlocking with keyring or the `UNLOCK` variable works.
4 changes: 2 additions & 2 deletions docs/dpaygo.conveyor.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dpaygo\.dsiteapi
dpaygo\.conveyor
==============

.. automodule:: dpaygo.dsiteapi
.. automodule:: dpaygo.conveyor
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dPayGo Modules
dpaygo.blockchain
dpaygo.blockchainobject
dpaygo.comment
dpaygo.dsiteapi
dpaygo.conveyor
dpaygo.discussions
dpaygo.exceptions
dpaygo.imageuploader
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ the complete queue is sended at once to the node. The result is a list with repl
.. code-block:: python
from dpaygo import DPay
stm = DPay("https://dpayapi.com)
stm = DPay("wss://dpayd.dpays.io)
stm.rpc.get_config(add_to_queue=True)
stm.rpc.rpc_queue
Expand Down Expand Up @@ -241,8 +241,8 @@ Lets calculate the curation reward from the last 7 days:
reward_vests = Amount("0 VESTS")
for reward in acc.history_reverse(stop=stop, only_ops=["curation_reward"]):
reward_vests += Amount(reward['reward'])
curation_rewards_SP = acc.dpay.vests_to_sp(reward_vests.amount)
print("Rewards are %.3f SP" % curation_rewards_SP)
curation_rewards_BP = acc.dpay.vests_to_bp(reward_vests.amount)
print("Rewards are %.3f BP" % curation_rewards_BP)
Lets display all Posts from an account:
Expand Down
30 changes: 15 additions & 15 deletions dpaygo/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def rep(self):
return self.get_reputation()

@property
def sp(self):
def bp(self):
""" Returns the accounts BEX Power
"""
return self.get_dpay_power()
Expand Down Expand Up @@ -312,7 +312,7 @@ def print_info(self, force_refresh=False, return_str=False, use_table=False, **k
ret += " VP = %.2f $\n" % (self.get_voting_value_BBD())
ret += "full in %s \n" % (self.get_recharge_time_str())
ret += "--- Balance ---\n"
ret += "%.2f SP, " % (self.get_dpay_power())
ret += "%.2f BP, " % (self.get_dpay_power())
ret += "%s, %s\n" % (str(self.balances["available"][0]), str(self.balances["available"][1]))
if bandwidth["allocated"] > 0:
ret += "--- Bandwidth ---\n"
Expand Down Expand Up @@ -357,22 +357,22 @@ def get_dpay_power(self, onlyOwnSP=False):
vests = (self["vesting_shares"])
if not onlyOwnSP and "delegated_vesting_shares" in self and "received_vesting_shares" in self:
vests = vests - (self["delegated_vesting_shares"]) + (self["received_vesting_shares"])
return self.dpay.vests_to_sp(vests)
return self.dpay.vests_to_bp(vests)

def get_voting_value_BBD(self, voting_weight=100, voting_power=None, dpay_power=None, not_broadcasted_vote=True):
""" Returns the account voting value in BBD
"""
if voting_power is None:
voting_power = self.get_voting_power()
if dpay_power is None:
sp = self.get_dpay_power()
bp = self.get_dpay_power()
else:
sp = dpay_power
bp = dpay_power

VoteValue = self.dpay.sp_to_bbd(sp, voting_power=voting_power * 100, vote_pct=voting_weight * 100, not_broadcasted_vote=not_broadcasted_vote)
VoteValue = self.dpay.bp_to_bbd(bp, voting_power=voting_power * 100, vote_pct=voting_weight * 100, not_broadcasted_vote=not_broadcasted_vote)
return VoteValue

def get_vote_pct_for_BBD(self, bbd, voting_power=None, dpay_power=None, not_broadcasted_vote=True):
def get_vote_pct_for_bbd(self, bbd, voting_power=None, dpay_power=None, not_broadcasted_vote=True):
""" Returns the voting percentage needed to have a vote worth a given number of BBD.
If the returned number is bigger than 10000 or smaller than -10000,
Expand Down Expand Up @@ -1415,7 +1415,7 @@ def get_curation_reward(self, days=7):
reward_vests = Amount("0 VESTS", dpay_instance=self.dpay)
for reward in self.history_reverse(stop=stop, use_block_num=False, only_ops=["curation_reward"]):
reward_vests += Amount(reward['reward'], dpay_instance=self.dpay)
return self.dpay.vests_to_sp(reward_vests.amount)
return self.dpay.vests_to_bp(reward_vests.amount)

def curation_stats(self):
"""Returns the curation reward of the last 24h and 7d and the average
Expand Down Expand Up @@ -2310,7 +2310,7 @@ def claim_reward_balance(self,

def delegate_vesting_shares(self, to_account, vesting_shares,
account=None, **kwargs):
""" Delegate SP to another account.
""" Delegate BP to another account.
:param str to_account: Account we are delegating shares to
(delegatee).
Expand Down Expand Up @@ -2830,7 +2830,7 @@ def print_summarize_table(self, tag_type="Follower", return_str=False, **kwargs)
t.align = "r"
t.add_row([tag_type + " count", str(len(self))])
own_mvest = []
eff_sp = []
eff_bp = []
rep = []
last_vote_h = []
last_post_d = []
Expand All @@ -2839,7 +2839,7 @@ def print_summarize_table(self, tag_type="Follower", return_str=False, **kwargs)
for f in self:
rep.append(f.rep)
own_mvest.append(f.balances["available"][2].amount / 1e6)
eff_sp.append(f.get_dpay_power())
eff_bp.append(f.get_dpay_power())
last_vote = addTzInfo(datetime.utcnow()) - (f["last_vote_time"])
if last_vote.days >= 365:
no_vote += 1
Expand All @@ -2855,10 +2855,10 @@ def print_summarize_table(self, tag_type="Follower", return_str=False, **kwargs)
if (len(rep) > 0):
t.add_row(["Mean Rep.", "%.2f" % (sum(rep) / len(rep))])
t.add_row(["Max Rep.", "%.2f" % (max(rep))])
if (len(eff_sp) > 0):
t.add_row(["Summed eff. SP", "%.2f" % sum(eff_sp)])
t.add_row(["Mean eff. SP", "%.2f" % (sum(eff_sp) / len(eff_sp))])
t.add_row(["Max eff. SP", "%.2f" % max(eff_sp)])
if (len(eff_bp) > 0):
t.add_row(["Summed eff. BP", "%.2f" % sum(eff_bp)])
t.add_row(["Mean eff. BP", "%.2f" % (sum(eff_bp) / len(eff_bp))])
t.add_row(["Max eff. BP", "%.2f" % max(eff_bp)])
if (len(last_vote_h) > 0):
t.add_row(["Mean last vote diff in hours", "%.2f" % (sum(last_vote_h) / len(last_vote_h))])
if len(last_post_d) > 0:
Expand Down
Loading

0 comments on commit 7d0e7ba

Please sign in to comment.