Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
c912b0b7
Commit
c912b0b7
authored
6 years ago
by
Holger Nahrstaedt
Browse files
Options
Downloads
Patches
Plain Diff
Improved Tutorial and Readme
Added Use nobroadcast for testing and Clear BlockchainObject Caching
parent
f5c1e790
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.rst
+11
-11
11 additions, 11 deletions
README.rst
beem/market.py
+8
-6
8 additions, 6 deletions
beem/market.py
docs/tutorials.rst
+73
-8
73 additions, 8 deletions
docs/tutorials.rst
with
92 additions
and
25 deletions
README.rst
+
11
−
11
View file @
c912b0b7
...
...
@@ -42,9 +42,11 @@ Current build status
:target: https://codeclimate.com/github/holgern/beem/test_coverage
:alt: Test Coverage
Support
=======
You may find help at https://discord.gg/4HM592V. The discord channel can also be used to discuss things about beem.
Support & Documentation
=======================
You may find help in the `discord-channel`_. The discord channel can also be used to discuss things about beem.
A complete library documentation is available at `beem-readthedocs-io`_.
Installation
============
...
...
@@ -116,15 +118,11 @@ Signing and Verify can be fasten (200 %) by installing cryptography::
conda install cryptography
CLI tool bundled
----------------
I started to work on a CLI tool::
beempy
CLI tool beempy
---------------
A command line tool is available. The help output shows the available commands:
Documentation
=============
Documentation is available at http://beem.readthedocs.io/en/latest/
beempy --help
Changelog
=========
...
...
@@ -310,3 +308,5 @@ Acknowledgements
.. _python-bitshares: https://github.com/xeroc/python-bitshares
.. _Python: http://python.org
.. _Anaconda: https://www.continuum.io
.. _beem-readthedocs-io: http://beem.readthedocs.io/en/latest/
.. _discord-channel: https://discord.gg/4HM592V
This diff is collapsed.
Click to expand it.
beem/market.py
+
8
−
6
View file @
c912b0b7
...
...
@@ -121,12 +121,14 @@ class Market(dict):
.. code-block:: js
{
'
highest_bid
'
: 0.30100226633322913,
'
latest
'
: 0.0,
'
lowest_ask
'
: 0.3249636958897082,
'
percent_change
'
: 0.0,
'
sbd_volume
'
: 108329611.0,
'
steem_volume
'
: 355094043.0}
{
'
highest_bid
'
: 0.30100226633322913,
'
latest
'
: 0.0,
'
lowest_ask
'
: 0.3249636958897082,
'
percent_change
'
: 0.0,
'
sbd_volume
'
: 108329611.0,
'
steem_volume
'
: 355094043.0
}
"""
data
=
{}
...
...
This diff is collapsed.
Click to expand it.
docs/tutorials.rst
+
73
−
8
View file @
c912b0b7
...
...
@@ -10,6 +10,7 @@ transactions. This can be used to do a multi-send (one sender, multiple
receivers), but it also allows to use any other kind of operation. The
advantage here is that the user can be sure that the operations are
executed in the same order as they are added to the transaction.
A block can only include one vote operation and
one comment operation from each sender.
...
...
@@ -21,19 +22,18 @@ one comment operation from each sender.
from beem.comment import Comment
from beem.instance import set_shared_steem_instance
#
Only for testing
not a real working key
# not a real working key
wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"
# set nobroadcast always to True, when testing
testnet = Steem(
nobroadcast=True,
bundle=True,
stm = Steem(
bundle=True, # Enable bundle broadcast
# nobroadcast=True, # Enable this for testing
keys=[wif],
)
# Set
testnet
as shared instance
set_shared_steem_instance(
testnet
)
# Set
stm
as shared instance
set_shared_steem_instance(
stm
)
# Account and Comment will use now
testnet
# Account and Comment will use now
stm
account = Account("test")
# Post
...
...
@@ -48,6 +48,71 @@ one comment operation from each sender.
pprint(testnet.broadcast())
Use nobroadcast for testing
---------------------------
When using `nobroadcast=True` the transaction is not broadcasted but printed.
.. code-block:: python
from pprint import pprint
from beem import Steem
from beem.account import Account
from beem.instance import set_shared_steem_instance
# Only for testing not a real working key
wif = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"
# set nobroadcast always to True, when testing
testnet = Steem(
nobroadcast=True, # Set to false when want to go live
keys=[wif],
)
# Set testnet as shared instance
set_shared_steem_instance(testnet)
# Account will use now testnet
account = Account("test")
pprint(account.transfer("test1", 1, "STEEM"))
When excecuting the script above, the output will be similar to the following:
.. code-block:: js
Not broadcasting anything!
{'expiration': '2018-05-01T16:16:57',
'extensions': [],
'operations': [['transfer',
{'amount': '1.000 STEEM',
'from': 'test',
'memo': '',
'to': 'test1'}]],
'ref_block_num': 33020,
'ref_block_prefix': 2523628005,
'signatures': ['1f57da50f241e70c229ed67b5d61898e792175c0f18ae29df8af414c46ae91eb5729c867b5d7dcc578368e7024e414c237f644629cb0aa3ecafac3640871ffe785']}
Clear BlockchainObject Caching
------------------------------
Each BlockchainObject (Account, Comment, Vote, Witness, Amount, ...) has a glocal cache. This cache
stores all objects and could lead to increased memory consumption. The global cache can be cleared
with a `clear_cache()` call from any BlockchainObject.
.. code-block:: python
from pprint import pprint
from beem.account import Account
account = Account("test")
pprint(str(account._cache))
account1 = Account("test1")
pprint(str(account._cache))
pprint(str(account1._cache))
account.clear_cache()
pprint(str(account._cache))
pprint(str(account1._cache))
Simple Sell Script
------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment