-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[API] Updates, fixes and Adding of 'stream'
- Loading branch information
Showing
8 changed files
with
343 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
*************************************************** | ||
Howto Monitor the blockchain for certain operations | ||
*************************************************** | ||
|
||
Operations in blocks can be monitored relatively easy by using the | ||
`block_stream` (for entire blocks) for `stream` (for specific | ||
operations) generators. | ||
|
||
The following example will only show ``transfer`` operations on the | ||
blockchain: | ||
|
||
.. code-block:: python | ||
from grapheneapi.grapheneclient import GrapheneClient | ||
from pprint import pprint | ||
class Config(): | ||
witness_url = "ws://testnet.bitshares.eu/ws" | ||
if __name__ == '__main__': | ||
client = GrapheneClient(Config) | ||
for b in client.ws.stream("transfer"): | ||
pprint(b) | ||
Note that you can define a starting block and instead of waiting for | ||
sufficient confirmations (irreversible blocks), you can also consider | ||
the real *head* block with: | ||
|
||
.. code-block:: python | ||
for b in client.ws.stream("transfer", start=199924, mode="head"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.