|
1 | 1 | # Storage
|
2 | 2 |
|
| 3 | +For an introduction into the concepts of Database, Persistence, Driver, Store, read [this documentation](https://github.com/hyperledger-labs/fabric-smart-client/blob/main/docs/db-driver.md). |
| 4 | + |
| 5 | +The project utilizes the following layers of abstraction on top of the database layer: |
| 6 | +* `Store`: executes the SQL queries. A `Store` is only used from within the `StoreService` of the same kind. |
| 7 | +* `StoreService`: extends the `Store` (of the same kind) by adding extra functionality (e.g. keeping maps, cache, or combining functionalities of the underlying store). A `StoreService` does not have any other dependency, but the `Store`. |
| 8 | +* `Service`: combines `StoreService` and `Service` instances to provide more complete functionality that can be used by the application. |
| 9 | +Each domain has a `Store`, a `StoreService` and potentially a `Service`. |
| 10 | + |
3 | 11 | The Fabric Token SDK utilizes a robust data management system to ensure the secure and reliable tracking of all token-related activities.
|
4 |
| -This system leverages several databases, each with a specific purpose: |
| 12 | +This system leverages several stores, each with a specific purpose: |
5 | 13 |
|
6 |
| -* **Transaction Database (`ttxdb`)**: |
7 |
| - This critical database serves as the central repository for all transaction records. |
| 14 | +* **Transaction Store (`ttxdb`)**: |
| 15 | + This critical store serves as the central repository for all transaction records. |
8 | 16 | It captures every token issuance, transfer, or redemption, providing a complete historical record of token activity within the network.
|
9 |
| - The `ttxdb` service is locate under [`token/services/ttxdb`](./../../token/services/ttxdb). It is accessible via the `ttx` service. |
| 17 | + The `ttxdb.StoreService` store is located under [`token/services/ttxdb`](./../../token/services/ttxdb). It is accessible via the `ttx.Service`. |
10 | 18 |
|
11 |
| -* **Token Database (`tokendb`)**: |
| 19 | +* **Token Store (`tokendb`)**: |
12 | 20 | The `tokendb` acts as the registry for all tokens within the system.
|
13 | 21 | It stores detailed information about each token, including its unique identifier, denomination type (think currency or unique identifier), current ownership, and total quantity in circulation.
|
14 | 22 | By referencing the `tokendb`, developers and network participants can obtain a clear picture of the token landscape.
|
15 |
| - The `tokendb` is used by the `Token Selector`, to select the tokens to use in each transaction, and by the `Token Vault Service` to provide its services. |
16 |
| - The `tokendb` service is locate under [`token/services/tokendb`](./../../token/services/tokendb). It is accessible via the `tokens` service. |
| 23 | + The `tokendb.StoreService` is used by the `Token Selector`, to select the tokens to use in each transaction, and by the `Token Vault Service` to provide its services. |
| 24 | + The `tokendb.StoreService` service is located under [`token/services/tokendb`](./../../token/services/tokendb). It is accessible via the `tokens.Service`. |
17 | 25 |
|
18 |
| -* **Audit Database (`auditdb`)** (if applicable): |
| 26 | +* **Audit Store (`auditdb`)** (if applicable): |
19 | 27 | For applications requiring enhanced auditability, the `auditdb` provides an additional layer of transparency.
|
20 | 28 | It meticulously stores audit records for transactions that have undergone the auditing process.
|
21 | 29 | This functionality is particularly valuable for scenarios where regulatory compliance or tamper-proof records are essential.
|
22 |
| - The `auditdb` service is locate under [`token/services/auditdb`](./../../token/services/auditdb). It is accessible via the `auditor` service. |
| 30 | + The `auditdb.StoreService` is located under [`token/services/auditdb`](./../../token/services/auditdb). It is accessible via the `auditor.Service`. |
23 | 31 |
|
24 |
| -* **Identity Database (`identitydb`)**: |
| 32 | +* **Identity Store (`identitydb`) and Wallet Store (`walletdb`)**: |
25 | 33 | The `identitydb` plays a crucial role in managing user identities and wallets within the network.
|
26 | 34 | It securely stores wallet configurations, identity-related audit information, and so on, enabling secure interactions with the token system.
|
27 |
| - The `identitydb` service is locate under [`token/services/identitydb`](./../../token/services/identitydb). |
| 35 | + The `identitydb.StoreService` is located under [`token/services/identitydb`](./../../token/services/identitydb). |
28 | 36 | It is used by the `identity` service via its interfaces. Please, refer to the [`identity service`](identity.md) for more information about the storage part.
|
29 | 37 |
|
30 | 38 | ## Configuration
|
|
0 commit comments