From b92c508c6910439a4a3cc96d512540ddaa3eeb83 Mon Sep 17 00:00:00 2001 From: John Gerlock Date: Mon, 13 Feb 2017 15:12:10 -0500 Subject: [PATCH] Add docs helpers --- LICENSE | 24 ++++ Makefile | 16 ++- README.rst | 106 ++++++++++++---- docs/Makefile | 9 +- docs/conf.py | 30 ++++- docs/index.rst | 3 +- docs/src/README.rst | 74 +++++++++++ docs/src/cli.rst | 7 ++ docs/src/modules.rst | 8 -- docs/src/sbds.checkpoint.rst | 10 -- docs/src/sbds.rst | 78 ------------ docs/src/sbds.storages.db.rst | 69 ---------- docs/src/sbds.storages.db.tables.rst | 38 ------ docs/src/sbds.storages.elasticsearch.rst | 22 ---- docs/src/sbds.storages.rst | 19 --- docs/src/sbds.storages.s3.rst | 22 ---- docs/src/setup.rst | 7 -- sbds/storages/db/cli.py | 10 +- setup.py | 9 +- tests/block_data/account_create.json | 51 ++++++++ tests/block_data/account_update.json | 5 + tests/block_data/account_witness_proxy.json | 19 +++ tests/block_data/account_witness_vote.json | 19 +++ tests/block_data/block.json | 118 ++++++++++++++++++ .../cancel_transfer_from_savings.json | 18 +++ tests/block_data/change_recovery_account.json | 5 + tests/block_data/comment.json | 23 ++++ tests/block_data/comment_options.json | 24 ++++ tests/block_data/convert.json | 21 ++++ tests/block_data/custom.json | 34 +++++ tests/block_data/custom_json.json | 35 ++++++ tests/block_data/delete_comment.json | 19 +++ tests/block_data/feed_publish.json | 23 ++++ tests/block_data/limit_order_cancel.json | 24 ++++ tests/block_data/limit_order_create.json | 24 ++++ tests/block_data/pow.json | 28 +++++ tests/block_data/pow2.json | 104 +++++++++++++++ tests/block_data/recover_account.json | 39 ++++++ .../block_data/request_account_recovery.json | 29 +++++ .../set_withdraw_vesting_route.json | 20 +++ tests/block_data/transaction.json | 110 ++++++++++++++++ tests/block_data/transfer.json | 20 +++ tests/block_data/transfer_from_savings.json | 21 ++++ tests/block_data/transfer_to_savings.json | 20 +++ tests/block_data/transfer_to_vesting.json | 19 +++ tests/block_data/vote.json | 20 +++ tests/block_data/withdraw_vesting.json | 18 +++ tests/block_data/witness_update.json | 28 +++++ 48 files changed, 1181 insertions(+), 318 deletions(-) create mode 100644 LICENSE create mode 100644 docs/src/README.rst create mode 100644 docs/src/cli.rst delete mode 100644 docs/src/modules.rst delete mode 100644 docs/src/sbds.checkpoint.rst delete mode 100644 docs/src/sbds.rst delete mode 100644 docs/src/sbds.storages.db.rst delete mode 100644 docs/src/sbds.storages.db.tables.rst delete mode 100644 docs/src/sbds.storages.elasticsearch.rst delete mode 100644 docs/src/sbds.storages.rst delete mode 100644 docs/src/sbds.storages.s3.rst delete mode 100644 docs/src/setup.rst create mode 100644 tests/block_data/account_create.json create mode 100644 tests/block_data/account_update.json create mode 100644 tests/block_data/account_witness_proxy.json create mode 100644 tests/block_data/account_witness_vote.json create mode 100644 tests/block_data/block.json create mode 100644 tests/block_data/cancel_transfer_from_savings.json create mode 100644 tests/block_data/change_recovery_account.json create mode 100644 tests/block_data/comment.json create mode 100644 tests/block_data/comment_options.json create mode 100644 tests/block_data/convert.json create mode 100644 tests/block_data/custom.json create mode 100644 tests/block_data/custom_json.json create mode 100644 tests/block_data/delete_comment.json create mode 100644 tests/block_data/feed_publish.json create mode 100644 tests/block_data/limit_order_cancel.json create mode 100644 tests/block_data/limit_order_create.json create mode 100644 tests/block_data/pow.json create mode 100644 tests/block_data/pow2.json create mode 100644 tests/block_data/recover_account.json create mode 100644 tests/block_data/request_account_recovery.json create mode 100644 tests/block_data/set_withdraw_vesting_route.json create mode 100644 tests/block_data/transaction.json create mode 100644 tests/block_data/transfer.json create mode 100644 tests/block_data/transfer_from_savings.json create mode 100644 tests/block_data/transfer_to_savings.json create mode 100644 tests/block_data/transfer_to_vesting.json create mode 100644 tests/block_data/vote.json create mode 100644 tests/block_data/withdraw_vesting.json create mode 100644 tests/block_data/witness_update.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2309f24 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2017 Steemit, Inc., and contributors. + +The following license applies to code contained within this repository that +is created by Steemit, Inc. Other copy right holders have licensed dependencies +under their own individual licenses. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +3. The currency symbols, 'STEEM' and 'SBD' are not changed and no new currency symbols are added. +4. The STEEMIT_INIT_PUBLIC_KEY_STR is not changed from STM8GC13uCZbP44HzMLV6zPZGwVQ8Nt4Kji8PapsPiNq1BK153XTX, +and the software is not modified in any way that would bypass the need for the corresponding private to start +a new blockchain. +5. The software is not used with any forks of the Steem blockchain that are not recognized by Steemit, Inc in writing. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/Makefile b/Makefile index fa6bfb4..b99f6e7 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ +ROOT_DIR := . +DOCS_DIR := $(ROOT_DIR)/docs +DOCS_BUILD_DIR := $(DOCS_DIR)/_build default: build .PHONY: test run -build: pep8 +build: pep8 README.rst docker build -t steemit/sbds . run: @@ -17,8 +20,9 @@ pep8-test: py.test --pep8 -m pep8 fmt: - yapf --recursive . - -pep8: - pep8 . - + yapf --recursive --in-place . + autopep8 --recursive --in-place . + +README.rst: docs/src/README.rst + cd docs + $(MAKE) README \ No newline at end of file diff --git a/README.rst b/README.rst index 31c7ae6..6242afb 100644 --- a/README.rst +++ b/README.rst @@ -1,61 +1,113 @@ -================= -README for SBDS -================= -# Notice +SBDS (Steem Blockchain Data Service) +************************************ -This is prerelease software, not yet suitable for production use. Proceed at your own risk. -# Steem Blockchain Data Service +Notice +====== + +This is prerelease software, not yet suitable for production use. +Proceed at your own risk. + Quickstart ========== -`sbds` is available on Docker Hub as `steemit/sbds`. +***sbds*** is available on Docker Hub as *steemit/sbds*. e.g. -`docker run -d steemit/sbds` +``docker run -d steemit/sbds`` + -## Overview +Overview +======== Stack: Python 3, SQLAlchemy, bottle. -`sbds` is a set of tool for querying the data of the Steem Blockchain. +**sbds** is a set of tool for querying the data of the Steem +Blockchain. + +While providing direct interfaces to several pluggable storage +architectures that may be used for querying the blockchain, **sbds** +may also be used as a lower level API upon which other applications +can be built. -While providing direct interfaces to several pluggable storage architectures that may be used for querying the blockchain, `sbds` may also be used as a lower level API upon which other applications can be built. Architecture ============ The system has three conceptual functions: -1. Interfacing with a `steemd` instance to provide access to blocks, ranges of blocks, or the continual stream of -blocks as they are published on the blockchain. +1. Interface with a *steemd* instance to provide access to blocks, +ranges of blocks, or the continual stream of blocks as they are +published on the blockchain. + +1. Ingest, prepare, store, and index blocks in one of two storage + backends (S3, SQL Database). -2. Ingest, prepare, store, and index blocks in one of 3 storage backends (S3, SQL Database, and/or Elasticsearch). +2. Querying indexed blocks. -3. Querying indexed blocks. Install ======= -`sbds` is an installable python 3 package, though it is currently not published on pipy, and must be installed using git: +**sbds** is an installable python 3 package, though it is currently +not published on pipy, and must be installed using git: + +``pip3 install -e git+git@github.com:steemit/sbds.git#egg=sbds`` + +Installation will (during early development) require mysql and +postgres development sources in order to build correctly. As an +alternative to installing those libraries, a *Dockerfile* is +available. + + +Usage +===== + +On initial use, blocks can be quickly loaded from "checkpoints" which +are gzipped text files that are 1M blocks in length and currently +hosted on S3 at ``s3://steemit-dev-sbds-checkpoints``. + +Once the storage is synced with all previous blocks, blocks can be +streamed to storage backends as they are confirmed. + +These blocks are not cryptographically assured in any way (and +**sbds** does not provide any cryptographic guarantees or verify +blockchain consensus state), so you may wish to regenerate these +checkpoints. + +**sbds** is designed to always be used in conjunction with a trusted +instance of *steemd* to validate all block data before **sbds** ever +receives it. This daemon **does not** implement any consensus rules. + + +CLI +==== + +The **sbds** package installs the ``sbds`` CLI. + +More information: -`pip3 install -e git+git@github.com:steemit/sbds.git#egg=sbds` +:: -Installation will (during early development) require mysql and postgres development sources in order to build -correctly. As an alternative to installing those libraries, a `Dockerfile` is available. + $ sbds --help + Usage: sbds [OPTIONS] COMMAND [ARGS]... -## Usage + The *sbds* CLI manages storage, retrieval, and querying of the Steem + blockchain. -On initial use, blocks can be quickly loaded from "checkpoints" which are gzipped text files that are 1M -blocks in length and currently hosted on S3 at `s3://steemit-dev-sbds-checkpoints`. + sbds has several commands, each of which has additional subcommands. -Once the storage is synced with all previous blocks, blocks can be streamed to storage backends as they are confirmed. + For more detailed information on a command and its flags, run: + sbds COMMAND --help -These blocks are not cryptographically assured in any way (and `sbds` does not provide any cryptographic guarantees -or verify blockchain consensus state), so you may wish to regenerate these checkpoints. + Options: + --help Show this message and exit. -`sbds` is designed to always be used in conjunction with a trusted instance of `steemd` to validate all block data before -`sbds` ever receives it. This daemon **does not** implement any consensus rules. \ No newline at end of file + Commands: + chain Query the Steem blockchain + checkpoints retrieve blocks from blockchain checkpoints + db Interact with an SQL storage backend + s3 Interact with an S3 storage backend diff --git a/docs/Makefile b/docs/Makefile index 93d437b..99d72f4 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -7,12 +7,19 @@ SPHINXBUILD = sphinx-build SPHINXPROJ = sbds SOURCEDIR = . BUILDDIR = _build +_README = ../README.rst # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -.PHONY: help Makefile +.PHONY: help Makefile README + +README: + $(MAKE) clean + $(MAKE) rst + cp "$(BUILDDIR)"/rst/src/README.rst .. + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/conf.py b/docs/conf.py index 728c737..a268459 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -16,12 +16,27 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# + + import os import sys sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('_themes')) +from recommonmark.parser import CommonMarkParser +from recommonmark.transform import AutoStructify + import sbds +# setup AutoStructify +def setup(app): + app.add_config_value('recommonmark_config', { + 'url_resolver': lambda url: github_doc_root + url, + 'auto_toc_tree_section': 'Contents', + }, True) + app.add_transform(AutoStructify) + + + + # -- General configuration ------------------------------------------------ @@ -32,11 +47,16 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx.ext.autodoc', +extensions = [ + + 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'sphinx.ext.githubpages'] + 'sphinx.ext.githubpages', + 'sphinxcontrib.programoutput', + 'sphinxcontrib.restbuilder', + ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -44,6 +64,10 @@ # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # +# https://github.com/rtfd/recommonmark +source_parsers = { + '.md': CommonMarkParser, +} source_suffix = ['.rst', '.md'] #source_suffix = '.rst' diff --git a/docs/index.rst b/docs/index.rst index 96c6da2..93853db 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,8 +9,7 @@ Welcome to sbds's documentation! .. toctree:: :maxdepth: 2 :caption: Contents: - :glob: - src/* + :glob: src/* Indices and tables diff --git a/docs/src/README.rst b/docs/src/README.rst new file mode 100644 index 0000000..9830c5e --- /dev/null +++ b/docs/src/README.rst @@ -0,0 +1,74 @@ +=============================================== +SBDS (Steem Blockchain Data Service) +=============================================== + +Notice +====== + +This is prerelease software, not yet suitable for production use. Proceed at your own risk. + + +Quickstart +========== + +***sbds*** is available on Docker Hub as `steemit/sbds`. + +e.g. + +``docker run -d steemit/sbds`` + +Overview +======== + +Stack: Python 3, SQLAlchemy, bottle. + +**sbds** is a set of tool for querying the data of the Steem Blockchain. + +While providing direct interfaces to several pluggable storage architectures that may be used for querying the blockchain, **sbds** may also be used as a lower level API upon which other applications can be built. + +Architecture +============ + +The system has three conceptual functions: + +1. Interfacing with a `steemd` instance to provide access to blocks, ranges of blocks, or the continual stream of +blocks as they are published on the blockchain. + +2. Ingest, prepare, store, and index blocks in one of two storage backends (S3, SQL Database, and/or Elasticsearch). + +3. Querying indexed blocks. + +Install +======= + +**sbds** is an installable python 3 package, though it is currently not published on pipy, and must be installed using git: + +``pip3 install -e git+git@github.com:steemit/sbds.git#egg=sbds`` + +Installation will (during early development) require mysql and postgres development sources in order to build +correctly. As an alternative to installing those libraries, a `Dockerfile` is available. + +Usage +===== + +On initial use, blocks can be quickly loaded from "checkpoints" which are gzipped text files that are 1M +blocks in length and currently hosted on S3 at ``s3://steemit-dev-sbds-checkpoints``. + +Once the storage is synced with all previous blocks, blocks can be streamed to storage backends as they are confirmed. + +These blocks are not cryptographically assured in any way (and **sbds** does not provide any cryptographic guarantees +or verify blockchain consensus state), so you may wish to regenerate these checkpoints. + +**sbds** is designed to always be used in conjunction with a trusted instance of `steemd` to validate all block data before +**sbds** ever receives it. This daemon **does not** implement any consensus rules. + +CLI +=== +The **sbds** package installs the ``sbds`` CLI. + +More information + +.. command-output:: sbds --help + + + diff --git a/docs/src/cli.rst b/docs/src/cli.rst new file mode 100644 index 0000000..b875e5a --- /dev/null +++ b/docs/src/cli.rst @@ -0,0 +1,7 @@ +.. command-output:: sbds chain --help + +.. command-output:: sbds chain block_height --help + +.. command-output:: sbds chain get-blocks --help + +.. command-output:: sbds chain stream-blocks --help \ No newline at end of file diff --git a/docs/src/modules.rst b/docs/src/modules.rst deleted file mode 100644 index 925d5ca..0000000 --- a/docs/src/modules.rst +++ /dev/null @@ -1,8 +0,0 @@ -sbds -==== - -.. toctree:: - :maxdepth: 4 - - sbds - setup diff --git a/docs/src/sbds.checkpoint.rst b/docs/src/sbds.checkpoint.rst deleted file mode 100644 index 66835e8..0000000 --- a/docs/src/sbds.checkpoint.rst +++ /dev/null @@ -1,10 +0,0 @@ -sbds.checkpoint package -======================= - -Module contents ---------------- - -.. automodule:: sbds.checkpoint - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.rst b/docs/src/sbds.rst deleted file mode 100644 index aaefd8d..0000000 --- a/docs/src/sbds.rst +++ /dev/null @@ -1,78 +0,0 @@ -sbds package -============ - -Subpackages ------------ - -.. toctree:: - - sbds.checkpoint - sbds.storages - -Submodules ----------- - -sbds.cli module ---------------- - -.. automodule:: sbds.cli - :members: - :undoc-members: - :show-inheritance: - -sbds.http_client module ------------------------ - -.. automodule:: sbds.http_client - :members: - :undoc-members: - :show-inheritance: - -sbds.http_server module ------------------------ - -.. automodule:: sbds.http_server - :members: - :undoc-members: - :show-inheritance: - -sbds.logging module -------------------- - -.. automodule:: sbds.logging - :members: - :undoc-members: - :show-inheritance: - -sbds.notify module ------------------- - -.. automodule:: sbds.notify - :members: - :undoc-members: - :show-inheritance: - -sbds.utils module ------------------ - -.. automodule:: sbds.utils - :members: - :undoc-members: - :show-inheritance: - -sbds.ws_client module ---------------------- - -.. automodule:: sbds.ws_client - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sbds - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.storages.db.rst b/docs/src/sbds.storages.db.rst deleted file mode 100644 index 61e4e52..0000000 --- a/docs/src/sbds.storages.db.rst +++ /dev/null @@ -1,69 +0,0 @@ -sbds.storages.db package -======================== - -Subpackages ------------ - -.. toctree:: - - sbds.storages.db.tables - -Submodules ----------- - -sbds.storages.db.cli module ---------------------------- - -.. automodule:: sbds.storages.db.cli - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.enums module ------------------------------ - -.. automodule:: sbds.storages.db.enums - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.events module ------------------------------- - -.. automodule:: sbds.storages.db.events - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.field_handlers module --------------------------------------- - -.. automodule:: sbds.storages.db.field_handlers - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.query_helpers module -------------------------------------- - -.. automodule:: sbds.storages.db.query_helpers - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.utils module ------------------------------ - -.. automodule:: sbds.storages.db.utils - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sbds.storages.db - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.storages.db.tables.rst b/docs/src/sbds.storages.db.tables.rst deleted file mode 100644 index 89e4cc4..0000000 --- a/docs/src/sbds.storages.db.tables.rst +++ /dev/null @@ -1,38 +0,0 @@ -sbds.storages.db.tables package -=============================== - -Submodules ----------- - -sbds.storages.db.tables.core module ------------------------------------ - -.. automodule:: sbds.storages.db.tables.core - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.tables.synthesized module ------------------------------------------- - -.. automodule:: sbds.storages.db.tables.synthesized - :members: - :undoc-members: - :show-inheritance: - -sbds.storages.db.tables.tx module ---------------------------------- - -.. automodule:: sbds.storages.db.tables.tx - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sbds.storages.db.tables - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.storages.elasticsearch.rst b/docs/src/sbds.storages.elasticsearch.rst deleted file mode 100644 index abd0bd4..0000000 --- a/docs/src/sbds.storages.elasticsearch.rst +++ /dev/null @@ -1,22 +0,0 @@ -sbds.storages.elasticsearch package -=================================== - -Submodules ----------- - -sbds.storages.elasticsearch.cli module --------------------------------------- - -.. automodule:: sbds.storages.elasticsearch.cli - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sbds.storages.elasticsearch - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.storages.rst b/docs/src/sbds.storages.rst deleted file mode 100644 index ed490bc..0000000 --- a/docs/src/sbds.storages.rst +++ /dev/null @@ -1,19 +0,0 @@ -sbds.storages package -===================== - -Subpackages ------------ - -.. toctree:: - - sbds.storages.db - sbds.storages.elasticsearch - sbds.storages.s3 - -Module contents ---------------- - -.. automodule:: sbds.storages - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/sbds.storages.s3.rst b/docs/src/sbds.storages.s3.rst deleted file mode 100644 index 61f114d..0000000 --- a/docs/src/sbds.storages.s3.rst +++ /dev/null @@ -1,22 +0,0 @@ -sbds.storages.s3 package -======================== - -Submodules ----------- - -sbds.storages.s3.cli module ---------------------------- - -.. automodule:: sbds.storages.s3.cli - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: sbds.storages.s3 - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/src/setup.rst b/docs/src/setup.rst deleted file mode 100644 index 31789b1..0000000 --- a/docs/src/setup.rst +++ /dev/null @@ -1,7 +0,0 @@ -setup module -============ - -.. automodule:: setup - :members: - :undoc-members: - :show-inheritance: diff --git a/sbds/storages/db/cli.py b/sbds/storages/db/cli.py index 6b1a8eb..9790d89 100644 --- a/sbds/storages/db/cli.py +++ b/sbds/storages/db/cli.py @@ -78,7 +78,7 @@ def test(ctx): @click.argument('blocks', type=click.File('r', encoding='utf8'), default='-') @click.pass_context def insert_blocks(ctx, blocks): - """Insert blocks in the database, accepts "-" for STDIN (default)""" + """Insert blocks into the database""" engine = ctx.obj['engine'] metadata = ctx.obj['metadata'] @@ -97,7 +97,7 @@ def insert_blocks(ctx, blocks): @click.option('--chunksize', type=click.INT, default=1000) @click.pass_context def bulk_add_blocks(ctx, blocks, chunksize): - """Insert blocks in the database, accepts "-" for STDIN (default)""" + """Insert many blocks in the database""" engine = ctx.obj['engine'] metadata = ctx.obj['metadata'] @@ -144,7 +144,7 @@ def reset_db_tables(ctx): @db.command(name='last-block') @click.pass_context def last_block(ctx): - """Create any missing tables on the database""" + """Return the highest block stored in the database""" engine = ctx.obj['engine'] metadata = ctx.obj['metadata'] @@ -162,7 +162,7 @@ def last_block(ctx): @db.command(name='find-missing-blocks') @click.pass_context def find_missing_blocks(ctx): - """Ouput JSON array of block_nums from missing blocks""" + """Return JSON array of block_nums from missing blocks""" engine = ctx.obj['engine'] metadata = ctx.obj['metadata'] @@ -197,7 +197,7 @@ def add_missing_posts_and_comments(ctx): @db.command(name='find-missing-posts-and-comments') @click.pass_context def find_missing_posts_and_comments(ctx): - """Ouput JSON array of block_nums from missing post and comment blocks""" + """Return JSON array of block_nums from missing post and comment blocks""" engine = ctx.obj['engine'] metadata = ctx.obj['metadata'] diff --git a/setup.py b/setup.py index 705a84b..0ffd218 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,14 @@ version='0.1', packages=find_packages(), setup_requires=['pytest-runner'], - tests_require=['pytest', 'pep8', 'pytest-pep8', 'yapf'], + tests_require=['pytest', + 'pep8', + 'pytest-pep8', + 'yapf', + 'sphinx', + 'recommonmark', + 'sphinxcontrib-restbuilder', + 'sphinxcontrib-programoutput'], install_requires=[ 'Click', 'steem-piston==0.4.1', diff --git a/tests/block_data/account_create.json b/tests/block_data/account_create.json new file mode 100644 index 0000000..53d9f96 --- /dev/null +++ b/tests/block_data/account_create.json @@ -0,0 +1,51 @@ +{ + "ref_block_prefix": 3620775392, + "expiration": "2016-03-30T07:05:03", + "operations": [ + [ + "account_create", + { + "owner": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "STM8MN3FNBa8WbEpxz3wGL3L1mkt6sGnncH8iuto7r8Wa3T9NSSGT", + 1 + ] + ] + }, + "memo_key": "STM6Gkj27XMkoGsr4zwEvkjNhh4dykbXmPFzHhT8g86jWsqu3U38X", + "active": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "STM8HCf7QLUexogEviN8x1SpKRhFwg2sc8LrWuJqv7QsmWrua6ZyR", + 1 + ] + ] + }, + "new_account_name": "fabian", + "posting": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "STM8EhGWcEuQ2pqCKkGHnbmcTNpWYZDjGTT7ketVBp4gUStDr2brz", + 1 + ] + ] + }, + "creator": "hello", + "json_metadata": "{}", + "fee": "0.000 STEEM" + } + ] + ], + "signatures": [ + "2051b9c61cdd9df1f04e5d37529a72c9d4419c1e0b466d78c156c383aa951b21eb3f13b5bcbe9d0caf883143a15ff911c2d2cac9c466a7f619618bb3b4d24612b5" + ], + "ref_block_num": 29707, + "extensions": [] +} diff --git a/tests/block_data/account_update.json b/tests/block_data/account_update.json new file mode 100644 index 0000000..88e66c0 --- /dev/null +++ b/tests/block_data/account_update.json @@ -0,0 +1,5 @@ +{ + "account_to_recover": "barrie", + "extensions": [], + "new_recovery_account": "boombastic" +} diff --git a/tests/block_data/account_witness_proxy.json b/tests/block_data/account_witness_proxy.json new file mode 100644 index 0000000..b15ff73 --- /dev/null +++ b/tests/block_data/account_witness_proxy.json @@ -0,0 +1,19 @@ +{ + "ref_block_prefix": 2749880717, + "operations": [ + [ + "account_witness_proxy", + { + "proxy": "abit", + "account": "puppies" + } + ] + ], + "signatures": [ + "2066825bf5033b1a85b3f26c43bc853aa2e1e57ecdd400f61ea0ed444906836c323345c6b04cdbbb39637ed180ddf7a8eacc9d36086158140d1dec5788b73a01b4" + ], + "ref_block_num": 31712, + "expiration": "2016-04-08T15:47:00", + "extensions": [] +} + diff --git a/tests/block_data/account_witness_vote.json b/tests/block_data/account_witness_vote.json new file mode 100644 index 0000000..5b3ce11 --- /dev/null +++ b/tests/block_data/account_witness_vote.json @@ -0,0 +1,19 @@ +{ + "ref_block_prefix": 575883867, + "operations": [ + [ + "account_witness_vote", + { + "witness": "berniesanders", + "account": "donalddrumpf", + "approve": true + } + ] + ], + "signatures": [ + "1f7782f6c379d14c97718489b5ebca68fa25b3042e781d2f620ccc4927fbf4d3f30e60ba424cd906eb75b87cd4002bf982bc2ba9dc0f2c7b136b566de7416a170b" + ], + "ref_block_num": 57831, + "expiration": "2016-03-28T23:43:36", + "extensions": [] +} diff --git a/tests/block_data/block.json b/tests/block_data/block.json new file mode 100644 index 0000000..6a4283e --- /dev/null +++ b/tests/block_data/block.json @@ -0,0 +1,118 @@ +{ + "extensions": [], + "timestamp": "2016-08-11T22:00:09", + "transaction_merkle_root": "57e17f40cfa97c260eef365dc599e06acdba8591", + "previous": "003d0900c38ca36625f50fc6724cbb9d82a9a93e", + "witness": "roadscape", + "transactions": [ + { + "signatures": [ + "1f7f99b4e98878ecd2b65bc9e6c8e2fc3a929fdb766411e89b6df2accddf326b901e8bc10c0d0f47738c26c6fdcf15f76a11eb69a12058e96820b2625061d6aa96" + ], + "extensions": [], + "expiration": "2016-08-11T22:00:18", + "ref_block_num": 2203, + "operations": [ + [ + "comment", + { + "body": "@@ -154,16 +154,17 @@\n at coffe\n+e\n deliver\n", + "title": "", + "author": "mindfreak", + "parent_author": "einsteinpotsdam", + "permlink": "re-einsteinpotsdam-tutorial-for-other-shop-owners-how-to-accept-steem-and-steem-usd-payments-setup-time-under-2-minutes-android-20160811t215904898z", + "parent_permlink": "tutorial-for-other-shop-owners-how-to-accept-steem-and-steem-usd-payments-setup-time-under-2-minutes-android", + "json_metadata": "{\"tags\":[\"steemit\"]}" + } + ] + ], + "ref_block_prefix": 3949810370 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "witness_update", + { + "url": "http://fxxk.com", + "props": { + "maximum_block_size": 65536, + "account_creation_fee": "1.000 STEEM", + "sbd_interest_rate": 1000 + }, + "block_signing_key": "STM5b3wkzd5cPuW8tYbHpsM6qo26R5eympAQsBaoEfeMDxxUCLvsY", + "fee": "0.000 STEEM", + "owner": "supercomputing06" + } + ] + ], + "ref_block_prefix": 1721994435 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "account_update", + { + "json_metadata": "", + "account": "supercomputing06", + "memo_key": "STM7myUzFgMrc5w2jRc3LH2cTwcs96q74Kj6GJ3DyKHyrHFPDP96N", + "active": { + "key_auths": [ + [ + "STM5sP9GUuExPzK35F1MLjN2dTY7fqqP7dSpMWqnzCoU3je64gm6q", + 2 + ], + [ + "STM7t97bmNzbVruhH3yGQ7yFR58UJyPTb7Jh6ugmPfH1zqzJpngQH", + 1 + ] + ], + "weight_threshold": 0, + "account_auths": [] + } + } + ] + ], + "ref_block_prefix": 1721994435 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "account_update", + { + "json_metadata": "", + "account": "supercomputing06", + "memo_key": "STM7myUzFgMrc5w2jRc3LH2cTwcs96q74Kj6GJ3DyKHyrHFPDP96N", + "active": { + "key_auths": [ + [ + "STM5sP9GUuExPzK35F1MLjN2dTY7fqqP7dSpMWqnzCoU3je64gm6q", + 2 + ], + [ + "STM7t97bmNzbVruhH3yGQ7yFR58UJyPTb7Jh6ugmPfH1zqzJpngQH", + 1 + ] + ], + "weight_threshold": 2, + "account_auths": [] + } + } + ] + ], + "ref_block_prefix": 1721994435 + } + ], + "witness_signature": "20033915d9ddfca226eeadc57807556f18dd1ace85659774f2b6e620c56426e4560449e07635e9724ad1171a1f49800fe392e047e2a69bfbe9ee06948608fca211" +} \ No newline at end of file diff --git a/tests/block_data/cancel_transfer_from_savings.json b/tests/block_data/cancel_transfer_from_savings.json new file mode 100644 index 0000000..ef07135 --- /dev/null +++ b/tests/block_data/cancel_transfer_from_savings.json @@ -0,0 +1,18 @@ +{ + "operations": [ + [ + "cancel_transfer_from_savings", + { + "request_id": 1, + "from": "jesta" + } + ] + ], + "expiration": "2016-09-21T07:55:45", + "signatures": [ + "1f135b1a9123672cdeb679d57272631858242f569c6066b0f69293963b6b7f7781587478587b843c7f9679855606c37f0ef16707bb03a775d78e2602540626e3d4" + ], + "ref_block_num": 45917, + "ref_block_prefix": 2784823756, + "extensions": [] +} diff --git a/tests/block_data/change_recovery_account.json b/tests/block_data/change_recovery_account.json new file mode 100644 index 0000000..88e66c0 --- /dev/null +++ b/tests/block_data/change_recovery_account.json @@ -0,0 +1,5 @@ +{ + "account_to_recover": "barrie", + "extensions": [], + "new_recovery_account": "boombastic" +} diff --git a/tests/block_data/comment.json b/tests/block_data/comment.json new file mode 100644 index 0000000..f368ec0 --- /dev/null +++ b/tests/block_data/comment.json @@ -0,0 +1,23 @@ +{ + "ref_block_prefix": 3071757153, + "operations": [ + [ + "comment", + { + "author": "xeldal", + "body": "This is xeldal, an experienced witness. Will you vote for me?", + "json_metadata": "{}", + "title": "xeldal Witness Thread", + "permlink": "xeldal-witness-post", + "parent_author": "", + "parent_permlink": "witness-category" + } + ] + ], + "signatures": [ + "1f332f851112774103c4a12a97941f1c39a1c30a0561e64fbbe756d0860f7e68a206f2f57dfd15b77ecf3ce13fcffd6e66ae4b65a8df29bc01682876e34eb3cecf" + ], + "ref_block_num": 32379, + "expiration": "2016-04-08T16:20:27", + "extensions": [] +} diff --git a/tests/block_data/comment_options.json b/tests/block_data/comment_options.json new file mode 100644 index 0000000..11f9194 --- /dev/null +++ b/tests/block_data/comment_options.json @@ -0,0 +1,24 @@ +{ + "ref_block_prefix": 3739556666, + "expiration": "2016-08-12T07:02:19", + "operations": [ + [ + "comment_options", + { + "author": "testing001", + "allow_curation_rewards": true, + "max_accepted_payout": "1000.000 SBD", + "percent_steem_dollars": 5000, + "allow_votes": true, + "permlink": "testing6", + "extensions": [] + } + ] + ], + "signatures": [ + "1f47ff6711fad1ab07a9e10ce91e1fd84ca49629a6f45af6aca67150705e651b2006b5548520995bedd09daf6f597d2bc68a30c7c161b4600e14f0032e69235fcf" + ], + "ref_block_num": 13118, + "extensions": [] +} + diff --git a/tests/block_data/convert.json b/tests/block_data/convert.json new file mode 100644 index 0000000..471c355 --- /dev/null +++ b/tests/block_data/convert.json @@ -0,0 +1,21 @@ +{ + 'expiration': '2016-07-04T00:29:39', + 'extensions': [], + 'operations': [ + [ + 'convert', + { + 'amount': '5.000 SBD', + 'owner': 'summon', + 'requestid': 1467592156 + } + ] + ], + 'ref_block_num': 5864, + 'ref_block_prefix': 521569582, + 'signatures': [ + '1f0cd39195d45d5d40cd92651081670b5a799217d615c311921fc1981a0898703d1864555148c2e1246a19fa8ea1b80b4dd4474df86fc9a9c9d6a9c8576d467687' + ] +} + + diff --git a/tests/block_data/custom.json b/tests/block_data/custom.json new file mode 100644 index 0000000..7f38ac5 --- /dev/null +++ b/tests/block_data/custom.json @@ -0,0 +1,34 @@ +{ + "ref_block_prefix": 1654024379, + "expiration": "2016-06-03T18:37:24", + "operations": [ + [ + "custom_json", + { + "required_posting_auths": [ + "steemit" + ], + "required_auths": [], + "id": "follow", + "json": "{" + follower + ":" + steemit + "," + following + ":" + steem + "," + what + ":[" + posts + "]}" + } + ] + ], + "signatures": [ + "1f6019603d73f8c26b92cbdf1c224bf48fb0e600ff9e1689a09e8e4cb1234aeeb92b5eb6f8b8d148bbd3e62a4eb2bc94d1ff2293ec9b957d17d46e9dc11f41735d" + ], + "ref_block_num": 56232, + "extensions": [] +} diff --git a/tests/block_data/custom_json.json b/tests/block_data/custom_json.json new file mode 100644 index 0000000..21ba866 --- /dev/null +++ b/tests/block_data/custom_json.json @@ -0,0 +1,35 @@ +{ + "ref_block_prefix": 1654024379, + "expiration": "2016-06-03T18:37:24", + "operations": [ + [ + "custom_json", + { + "required_posting_auths": [ + "steemit" + ], + "required_auths": [], + "id": "follow", + "json": "{" + follower + ":" + steemit + "," + following + ":" + steem + "," + what + ":[" + posts + "]}" + } + ] + ], + "signatures": [ + "1f6019603d73f8c26b92cbdf1c224bf48fb0e600ff9e1689a09e8e4cb1234aeeb92b5eb6f8b8d148bbd3e62a4eb2bc94d1ff2293ec9b957d17d46e9dc11f41735d" + ], + "ref_block_num": 56232, + "extensions": [] +} + diff --git a/tests/block_data/delete_comment.json b/tests/block_data/delete_comment.json new file mode 100644 index 0000000..ccaade4 --- /dev/null +++ b/tests/block_data/delete_comment.json @@ -0,0 +1,19 @@ +{ + "ref_block_prefix": 3023139187, + "expiration": "2016-06-06T19:34:27", + "operations": [ + [ + "delete_comment", + { + "author": "jsc", + "permlink": "tests-delete" + } + ] + ], + "signatures": [ + "2044602e8a51a6f44827be54fb5fec8b53698fdf608a5fdd5943af71f288229fc078104b9798391989e15153f5f1aeb370d74ec027fefe4b5372a6c90d35b175f3" + ], + "ref_block_num": 12211, + "extensions": [] +} + diff --git a/tests/block_data/feed_publish.json b/tests/block_data/feed_publish.json new file mode 100644 index 0000000..f4a95d2 --- /dev/null +++ b/tests/block_data/feed_publish.json @@ -0,0 +1,23 @@ +{ + "ref_block_prefix": 336265640, + "expiration": "2016-04-26T23:08:06", + "operations": [ + [ + "feed_publish", + { + "exchange_rate": { + "quote": "1.000 STEEM", + "base": "0.374 SBD" + }, + "publisher": "smooth.witness" + } + ] + ], + "signatures": [ + "1f45f20c78e105eba93946b4366293f28a1d5b5e6e52e2007e8c0965c19bdd5b1464ba7a6b274d1a483715e3a883125106905c24e57092bc89247689cdc335c3fc" + ], + "ref_block_num": 19946, + "extensions": [] +} + + \ No newline at end of file diff --git a/tests/block_data/limit_order_cancel.json b/tests/block_data/limit_order_cancel.json new file mode 100644 index 0000000..6e1bfb6 --- /dev/null +++ b/tests/block_data/limit_order_cancel.json @@ -0,0 +1,24 @@ +{ + "ref_block_prefix": 843461126, + "expiration": "2016-07-01T13:33:03", + "operations": [ + [ + "limit_order_create", + { + "owner": "adm", + "amount_to_sell": "5.000 STEEM", + "min_to_receive": "1.542 SBD", + "orderid": 9, + "fill_or_kill": false, + "expiration": "2016-07-01T13:34:03" + } + ] + ], + "signatures": [ + "1f28e4e49e31cb9f22176fe142b3334d2459ec75cd70e48b2f536f6dc38deb8e8e5402e2cb878e0bc8cee2dc1280c480acdabe5807de5f7bc5c59ccf788920cdeb" + ], + "ref_block_num": 969, + "extensions": [] +} + + \ No newline at end of file diff --git a/tests/block_data/limit_order_create.json b/tests/block_data/limit_order_create.json new file mode 100644 index 0000000..6e1bfb6 --- /dev/null +++ b/tests/block_data/limit_order_create.json @@ -0,0 +1,24 @@ +{ + "ref_block_prefix": 843461126, + "expiration": "2016-07-01T13:33:03", + "operations": [ + [ + "limit_order_create", + { + "owner": "adm", + "amount_to_sell": "5.000 STEEM", + "min_to_receive": "1.542 SBD", + "orderid": 9, + "fill_or_kill": false, + "expiration": "2016-07-01T13:34:03" + } + ] + ], + "signatures": [ + "1f28e4e49e31cb9f22176fe142b3334d2459ec75cd70e48b2f536f6dc38deb8e8e5402e2cb878e0bc8cee2dc1280c480acdabe5807de5f7bc5c59ccf788920cdeb" + ], + "ref_block_num": 969, + "extensions": [] +} + + \ No newline at end of file diff --git a/tests/block_data/pow.json b/tests/block_data/pow.json new file mode 100644 index 0000000..3dc89bd --- /dev/null +++ b/tests/block_data/pow.json @@ -0,0 +1,28 @@ +{ + "ref_block_prefix": 2181793527, + "expiration": "2016-03-24T18:00:21", + "operations": [ + [ + "pow", + { + "props": { + "account_creation_fee": "100.000 STEEM", + "sbd_interest_rate": 1000, + "maximum_block_size": 131072 + }, + "work": { + "signature": "202f30b355f4bfe501292d3c3d650de105a1d7053fcefe875a286e79d3e886e7b005e97255b81f4c35e0ca1ad8e9acc4a57d694828231e57ae7e408e8a2f858a99", + "work": "0031b16c3007c425f72c1c32359511fb89ede9980ac807b81f5ab8e5edcce345", + "input": "8a023b6abb7e241ad41594fb0a22afb6832e4c4d68bae99707e20bfc8679b8e6", + "worker": "STM5gzvDurFRmVUUs38TDtTtGVAEz8TcWMt4xLVbxwP2PP8b9q7P4" + }, + "nonce": 326, + "block_id": "00000449f7860b82b4fbe2f317c670e9f01d6d9a", + "worker_account": "nxt6" + } + ] + ], + "signatures": [], + "ref_block_num": 1097, + "extensions": [] +} diff --git a/tests/block_data/pow2.json b/tests/block_data/pow2.json new file mode 100644 index 0000000..321e071 --- /dev/null +++ b/tests/block_data/pow2.json @@ -0,0 +1,104 @@ +{ + "ref_block_prefix": 2030100032, + "expiration": "2017-01-20T17:43:24", + "operations": [ + [ + "pow2", + { + "work": [ + 1, + { + "prev_block": "0083f04940de00790a548572b5f7a09d2a9e6676", + "pow_summary": 3542335882, + "proof": { + "inputs": [ + 2930666, + 3055534, + 16227194, + 1878724, + 3055534, + 3370375, + 10368718, + 8279292, + 1878724, + 12665269, + 13416647, + 14101780, + 14954112, + 16332900, + 7269530, + 13055417, + 16709657, + 14859041, + 8879475, + 3839300, + 8879475, + 14954112, + 3370375, + 7416112, + 15613499, + 15613499, + 6086878, + 9856240, + 587509, + 587509, + 6047993, + 10368718, + 6449363, + 7416112, + 15056305, + 8279292, + 13055417, + 6086878, + 16332900, + 14859041, + 308997, + 13416647, + 14101780, + 2930666, + 2552223, + 12665269, + 2552223, + 6047993, + 308997, + 16709657, + 3654688, + 9885009, + 15056305, + 9856240, + 7269530, + 3654688, + 5757028, + 16227194, + 5757028, + 3839300, + 9885009, + 6449363, + 2141293, + 2141293 + ], + "n": 140, + "seed": "3dbe4a5694af55d7bccc622a7b2d41293c26d5290ca43bd9754104d99c52dd2a", + "k": 6 + }, + "input": { + "prev_block": "0083f04940de00790a548572b5f7a09d2a9e6676", + "nonce": "11247522470727134118", + "worker_account": "nori" + } + } + ], + "props": { + "account_creation_fee": "0.001 STEEM", + "sbd_interest_rate": 1000, + "maximum_block_size": 131072 + } + } + ] + ], + "signatures": [ + "1f0e5ef13b709989d1256def83f45dd8a89b821cefdf3f5feefa380508233afb0d2c457d04e2c64937f36ff4d6a86e26303f710db1d92749ac6fc8fa8f95259e95" + ], + "ref_block_num": 61513, + "extensions": [] +} diff --git a/tests/block_data/recover_account.json b/tests/block_data/recover_account.json new file mode 100644 index 0000000..9fb2903 --- /dev/null +++ b/tests/block_data/recover_account.json @@ -0,0 +1,39 @@ +{ + "operations": [ + [ + "recover_account", + { + "recent_owner_authority": { + "account_auths": [], + "key_auths": [ + [ + "STM6Wf68LVi22QC9eS8LBWykRiSrKKp5RTWXcNqjh3VPNhiT9xFxx", + 1 + ] + ], + "weight_threshold": 1 + }, + "new_owner_authority": { + "account_auths": [], + "key_auths": [ + [ + "STM82miH8qam2G2WPPjgyquPBrUbenGDHjhZMxqaKqCugWhcuqZzW", + 1 + ] + ], + "weight_threshold": 1 + }, + "extensions": [], + "account_to_recover": "steemychicken1" + } + ] + ], + "expiration": "2016-07-18T05:46:33", + "signatures": [ + "202c2c3902d513bb7f22e833576ea8418fdf7be3a08b0736d1de03c3289c5db11e1a95af820703e1407b8f3c0b030d857f666132b10be165b7569faba0442790f5", + "2059587d734535c43caf33a706404d813897e8887ad1696750435be63dfae26fde5995a2c6c8cf295c380d89152abe97f4990f9c78a0e9095a96e6e2432dd88e05" + ], + "ref_block_num": 17711, + "ref_block_prefix": 311057647, + "extensions": [] +} diff --git a/tests/block_data/request_account_recovery.json b/tests/block_data/request_account_recovery.json new file mode 100644 index 0000000..8f829d5 --- /dev/null +++ b/tests/block_data/request_account_recovery.json @@ -0,0 +1,29 @@ +{ + "ref_block_prefix": 392888852, + "expiration": "2016-07-18T00:14:45", + "operations": [ + [ + "request_account_recovery", + { + "account_to_recover": "gandalf", + "new_owner_authority": { + "weight_threshold": 1, + "account_auths": [], + "key_auths": [ + [ + "STM6LYxj96zdypHYqgDdD6Nyh2NxerN3P1Mp3ddNm7gci63nfrSuZ", + 1 + ] + ] + }, + "recovery_account": "steem", + "extensions": [] + } + ] + ], + "signatures": [ + "1f6b0f44985aa8f476385078b69366b0868b45b666f717b34e074b98ca97a767b6209a931e998912f51b2f7d490a6283c3ce9c3d1f2a42a4695bda1e7a6786d0d3" + ], + "ref_block_num": 11112, + "extensions": [] +} diff --git a/tests/block_data/set_withdraw_vesting_route.json b/tests/block_data/set_withdraw_vesting_route.json new file mode 100644 index 0000000..51dca57 --- /dev/null +++ b/tests/block_data/set_withdraw_vesting_route.json @@ -0,0 +1,20 @@ +{ + "ref_block_prefix": 1734342499, + "expiration": "2016-07-01T14:12:24", + "operations": [ + [ + "set_withdraw_vesting_route", + { + "from_account": "lin9uxis", + "percent": 10000, + "auto_vest": false, + "to_account": "linouxis9" + } + ] + ], + "signatures": [ + "1f1fb84928c952d6bec647f8180787485165714762591096655b9f44ad8b35742a0b964faa5d40b4ff66602ff5e5d978153414abf166adf90b6926e4791164c76a" + ], + "ref_block_num": 1756, + "extensions": [] +} diff --git a/tests/block_data/transaction.json b/tests/block_data/transaction.json new file mode 100644 index 0000000..fb66900 --- /dev/null +++ b/tests/block_data/transaction.json @@ -0,0 +1,110 @@ +[ + { + "signatures": [ + "1f7f99b4e98878ecd2b65bc9e6c8e2fc3a929fdb766411e89b6df2accddf326b901e8bc10c0d0f47738c26c6fdcf15f76a11eb69a12058e96820b2625061d6aa96" + ], + "extensions": [], + "expiration": "2016-08-11T22:00:18", + "ref_block_num": 2203, + "operations": [ + [ + "comment", + { + "body": "@@ -154,16 +154,17 @@\n at coffe\n+e\n deliver\n", + "title": "", + "author": "mindfreak", + "parent_author": "einsteinpotsdam", + "permlink": "re-einsteinpotsdam-tutorial-for-other-shop-owners-how-to-accept-steem-and-steem-usd-payments-setup-time-under-2-minutes-android-20160811t215904898z", + "parent_permlink": "tutorial-for-other-shop-owners-how-to-accept-steem-and-steem-usd-payments-setup-time-under-2-minutes-android", + "json_metadata": "{\"tags\":[\"steemit\"]}" + } + ] + ], + "ref_block_prefix": 3949810370 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "witness_update", + { + "url": "http://fxxk.com", + "props": { + "maximum_block_size": 65536, + "account_creation_fee": "1.000 STEEM", + "sbd_interest_rate": 1000 + }, + "block_signing_key": "STM5b3wkzd5cPuW8tYbHpsM6qo26R5eympAQsBaoEfeMDxxUCLvsY", + "fee": "0.000 STEEM", + "owner": "supercomputing06" + } + ] + ], + "ref_block_prefix": 1721994435 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "account_update", + { + "json_metadata": "", + "account": "supercomputing06", + "memo_key": "STM7myUzFgMrc5w2jRc3LH2cTwcs96q74Kj6GJ3DyKHyrHFPDP96N", + "active": { + "key_auths": [ + [ + "STM5sP9GUuExPzK35F1MLjN2dTY7fqqP7dSpMWqnzCoU3je64gm6q", + 2 + ], + [ + "STM7t97bmNzbVruhH3yGQ7yFR58UJyPTb7Jh6ugmPfH1zqzJpngQH", + 1 + ] + ], + "weight_threshold": 0, + "account_auths": [] + } + } + ] + ], + "ref_block_prefix": 1721994435 + }, + { + "signatures": [], + "extensions": [], + "expiration": "2016-08-11T22:00:36", + "ref_block_num": 2304, + "operations": [ + [ + "account_update", + { + "json_metadata": "", + "account": "supercomputing06", + "memo_key": "STM7myUzFgMrc5w2jRc3LH2cTwcs96q74Kj6GJ3DyKHyrHFPDP96N", + "active": { + "key_auths": [ + [ + "STM5sP9GUuExPzK35F1MLjN2dTY7fqqP7dSpMWqnzCoU3je64gm6q", + 2 + ], + [ + "STM7t97bmNzbVruhH3yGQ7yFR58UJyPTb7Jh6ugmPfH1zqzJpngQH", + 1 + ] + ], + "weight_threshold": 2, + "account_auths": [] + } + } + ] + ], + "ref_block_prefix": 1721994435 + } +] \ No newline at end of file diff --git a/tests/block_data/transfer.json b/tests/block_data/transfer.json new file mode 100644 index 0000000..06eb72b --- /dev/null +++ b/tests/block_data/transfer.json @@ -0,0 +1,20 @@ +{ + "ref_block_prefix": 4211555470, + "expiration": "2016-03-25T13:49:33", + "operations": [ + [ + "transfer", + { + "amount": "833.000 STEEM", + "to": "steemit", + "memo": "", + "from": "admin" + } + ] + ], + "signatures": [ + "204ffd40d4feefdf309780a62058e7944b6833595c500603f3bb66ddbbca2ea661391196a97aa7dde53fdcca8aeb31f8c63aee4f47a20238f3749d9f4cb77f03f5" + ], + "ref_block_num": 25501, + "extensions": [] +} diff --git a/tests/block_data/transfer_from_savings.json b/tests/block_data/transfer_from_savings.json new file mode 100644 index 0000000..e66d0c5 --- /dev/null +++ b/tests/block_data/transfer_from_savings.json @@ -0,0 +1,21 @@ +{ + "ref_block_prefix": 57927444, + "expiration": "2016-10-11T17:23:06", + "operations": [ + [ + "transfer_from_savings", + { + "amount": "0.051 STEEM", + "to": "knozaki2015", + "request_id": 1476206568, + "memo": "", + "from": "knozaki2015" + } + ] + ], + "signatures": [ + "205230e01b4def2d4e5a7d0446dd8c41874689155e5c739fc9a6a7d339303a5f135aa89cad21b568ef9f68d15bfaaf85e9fcc78bd544d9831c977a9b1ac578f726" + ], + "ref_block_num": 42559, + "extensions": [] +} diff --git a/tests/block_data/transfer_to_savings.json b/tests/block_data/transfer_to_savings.json new file mode 100644 index 0000000..9d4312e --- /dev/null +++ b/tests/block_data/transfer_to_savings.json @@ -0,0 +1,20 @@ +{ + "ref_block_prefix": 2803959602, + "expiration": "2016-10-10T16:41:45", + "operations": [ + [ + "transfer_to_savings", + { + "amount": "1000.000 SBD", + "to": "jamesc", + "memo": "", + "from": "jamesc" + } + ] + ], + "signatures": [ + "1f248e64af20e24ad88078b101dba8d565aa1a6bde7ce105bed11a261f5aea9d4b6aca52f3aae23f8b98526ebeede8974407a972a85606036c304020cb2af28afb" + ], + "ref_block_num": 12870, + "extensions": [] +} diff --git a/tests/block_data/transfer_to_vesting.json b/tests/block_data/transfer_to_vesting.json new file mode 100644 index 0000000..6930ffd --- /dev/null +++ b/tests/block_data/transfer_to_vesting.json @@ -0,0 +1,19 @@ +{ + "ref_block_prefix": 4131173691, + "expiration": "2016-03-27T06:55:27", + "operations": [ + [ + "transfer_to_vesting", + { + "amount": "20.000 STEEM", + "to": "itsascam", + "from": "james" + } + ] + ], + "signatures": [ + "1f2853e69b7cf718f53e97c637a348115e17ae3995c773c28445c46b12ccf3716664aca8e82963f343a061ce0e097c29fa3e07ee9dc61d372bb14882b3106547a0" + ], + "ref_block_num": 9132, + "extensions": [] +} \ No newline at end of file diff --git a/tests/block_data/vote.json b/tests/block_data/vote.json new file mode 100644 index 0000000..38bbd79 --- /dev/null +++ b/tests/block_data/vote.json @@ -0,0 +1,20 @@ +{ + "ref_block_prefix": 286809142, + "expiration": "2016-12-16T11:31:55", + "operations": [ + [ + "vote", + { + "voter": "a00", + "weight": 10000, + "author": "kibbjez", + "permlink": "t6wv1" + } + ] + ], + "signatures": [ + "20795b036ba95df0b211bc6e79c3a1d0c2363e694aee62e79eeb60f5ed859d21b86dc2205f28e8779d369a8e9a1c898df0e62efbbaf3fc3ae0ac8c8679ed6b2d68" + ], + "ref_block_num": 32469, + "extensions": [] +} diff --git a/tests/block_data/withdraw_vesting.json b/tests/block_data/withdraw_vesting.json new file mode 100644 index 0000000..fb0110a --- /dev/null +++ b/tests/block_data/withdraw_vesting.json @@ -0,0 +1,18 @@ +{ + "ref_block_prefix": 4265937178, + "expiration": "2016-03-31T18:52:33", + "operations": [ + [ + "withdraw_vesting", + { + "account": "steemit", + "vesting_shares": "260000.000000 VESTS" + } + ] + ], + "signatures": [ + "2056b5be4b9d12f91e3cec198e74dd048bcfded95b92291709815c0afc069e5aa44c1a62e3aca0001a50d57010a870975c576f83de42e435f8634dcde52a8764c5" + ], + "ref_block_num": 7003, + "extensions": [] +} diff --git a/tests/block_data/witness_update.json b/tests/block_data/witness_update.json new file mode 100644 index 0000000..83aad94 --- /dev/null +++ b/tests/block_data/witness_update.json @@ -0,0 +1,28 @@ +{ + "ref_block_prefix": 1306647607, + "expiration": "2016-04-26T02:53:27", + "operations": [ + [ + "witness_update", + { + "owner": "arhag", + "block_signing_key": "STM5VNk9doxq55YEuyFw6qpNQt7q8neBWHhrau52fjV8N3TjNNUMP", + "props": { + "account_creation_fee": "100.000 STEEM", + "sbd_interest_rate": 1000, + "maximum_block_size": 131072 + }, + "url": " ", + "fee": "0.000 STEEM" + } + ] + ], + "signatures": [ + "1f2183af215f6878a080b659c4a302ce2c67f0df4c9914872d90cf129e6d1793b11401715e130af0da60f5a5a95c48b8de30140dd9884cbc812a017aab5c2b8b5c" + ], + "ref_block_num": 64732, + "extensions": [] +} + + + \ No newline at end of file