Skip to content

Commit

Permalink
doc: initialize api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rezamahdi committed Feb 25, 2022
1 parent aedba56 commit dee85c9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doc/api/chain.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Chain
=====
Blockchain is in fact what stored in ``Storage``. But handling operations like
traversing the chain and verifying blocks is not the idea of desiging storage.
To make some higher level operations and make a unified source of truth,
``Chain`` class is placed between storage and higher level class that do the
main job.

.. autoclass:: pyzantium.Chain
:members:
11 changes: 11 additions & 0 deletions doc/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API Reference
=============

Api reference of pyzantium is presented here

.. toctree::
:maxdepth: 2

storage.rst
chain.rst
verify.rst
7 changes: 7 additions & 0 deletions doc/api/storage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Storage
=======

.. automodule:: pyzantium.storage

.. autoclass:: pyzantium.storage.Storage
.. autoclass:: pyzantium.storage.DiskStorage
23 changes: 23 additions & 0 deletions doc/api/verify.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Verifying
=========
An important concept in blockchain is the authority of data that are stored in
the blocks. Common scheme to verify authority of data in blockchain is using
Elliptic Curve Cryptography (ECC), but other types of authority checking schemes
are applicable.

Verifying authority in pyzantium is implemented using an interface called
``Verifier``. currently ECC is implemented using Cryptography package. you can
add your own scheme of verifying by sublassing ``Verifier`` and implemente
``verify`` method to return ``True`` when data authority is approved and return
``Flase`` otherwise.

.. autoclass:: pyzantium.verify.Verifier
:members:

Elliptic curve verification is implementation using ``ECCVerifier`` class:

.. autoclass:: pyzantium.verify.ECCVerifier

Someone may don't need verification at all. So using ``VoidVerifier`` is the answer:

.. autoclass:: pyzantium.verify.VoidVerifier
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ classes in order to be highly customizable.
:maxdepth: 2
:caption: Contents:

api/index.rst

Indices and tables
==================

Expand Down

0 comments on commit dee85c9

Please sign in to comment.