Skip to content

Commit

Permalink
Entity-relationship model (RTD) (hyperledger-iroha#1415)
Browse files Browse the repository at this point in the history
* Add entity-relationship model to docs

Signed-off-by: Nikolay Yushkevich <[email protected]>

* Add review correction

Signed-off-by: Nikolay Yushkevich <[email protected]>
  • Loading branch information
neewy authored Jun 7, 2018
1 parent d8ff1de commit 02f20cf
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 4 deletions.
Binary file added docs/image_assets/er-model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions docs/source/core_concepts/er_model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Entity-relationship model
=========================

Each Hyperledger Iroha peer has a state, called "World State View",
which is represented by a set of entities and relations between them.
To explain you more which entities exist in the system and what are the relations,
this sections includes ER diagram and an explanation of its components.

ER diagram
----------

.. image:: ./../../image_assets/er-model.png

Peer
----

- address — network address and internal port, is used for synchronization, consensus, and communication with the ordering service
- public_key — key, which will be used for signing blocks during consensus process

Asset
-----

- asset_id — identifier of asset, formatted as asset_name#domain_id
- domain_id — identifier of domain, where the asset was created, references existing domain
- precision — size of fractional part
- data — JSON with arbitrary structure of asset description

Signatory
---------

- public_key — a public key

Domain
------

- domain_id — identifier of a domain
- default_role — a default role per user created in the domain, references existing role

Role
----

- role_id — identifier of role

RoleHasPermissions
^^^^^^^^^^^^^^^^^^

- role_id — identifier of role, references existing role
- permission_id — an id of predefined role

Account
-------

- account_id — identifier of account, formatted as account_name@domain_id
- domain_id — identifier of domain where the account was created, references existing domain
- quorum — number of signatories required for creation of valid transaction from this account
- transaction_count – counter of transactions created by this account
- data — key-value storage for any information, related to the account

AccountHasSignatory
^^^^^^^^^^^^^^^^^^^

- account_id — identifier of account, references existing account
- public_key — a public key (which is also called signatory), references existing signatory

AccountHasAsset
^^^^^^^^^^^^^^^

- account_id — identifier of account, references existing account
- asset_id — identifier of asset, references existing asset
- amount — an amount of the asset, belonging to the account

AccountHasRoles
^^^^^^^^^^^^^^^

- account_id — identifier of account, references existing account
- role_id — identifier of role, references existing role

AccountHasGrantablePermissions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- account_id — identifier of account, references existing account. This account gives grantable permission to perform operation over itself to permittee.
- permittee_account_id — identifier of account, references existing account. This account is given permission to perform operation over account_id.
- permission_id — identifier of grantable_permission
10 changes: 6 additions & 4 deletions docs/source/core_concepts/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ We will look through the basics of Iroha in this section.
.. WARNING:: Docs are constantly updated and this section is going to be improved.
Check glossary page while contents are elaborated.

Glossary
--------

Sections
========

.. toctree::
:maxdepth: 2
:maxdepth: 1

glossary.rst
glossary.rst
er_model.rst

0 comments on commit 02f20cf

Please sign in to comment.