You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/pages/komodo-defi-framework/tutorials/query-the-mm2-database/index.mdx
+61-19
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,26 @@ export const description = "This guide describes how to query the MM2 SQLite dat
3
3
4
4
# How to Query the MM2 SQLite Database
5
5
6
-
The Komodo DeFi Framework API stores historical information such as swaps and orders within an SQLite database, located under the DB user data folder (e.g. {'{folder continaing mm2 binary}'}/DB/{'{wallet identifying hex string}'}/MM2.db').
6
+
The Komodo DeFi Framework API stores historical information such as swaps and orders within an SQLite database, located under the DB user data folder with each wallet having its own subfolder represented by a hexideciaml string.
7
+
This string is shown in the runtime logs of the `kdf` binary as `Public key hash` when it starts up.
8
+
9
+
```bash
10
+
30 08:39:23, mm2:269] AtomicDEX API 2.1.0-beta_a81f2a101 DT 2024-07-26T23:24:52+03:00
11
+
30 08:39:23, mm2_main::mm2::lp_native_dex:500] INFO Version: 2.1.0-beta_a81f2a101 DT 2024-07-26T23:24:52+03:00
12
+
30 08:39:23, crypto::crypto_ctx:324] INFO Public key hash: 7d6cbdd91788df3b764247721fe12853ce36b03d
13
+
```
14
+
15
+
The default location of this folder for each operating system is:
You can define a different location for the DB folder via the [`dbdir` configuration parameter](/komodo-defi-framework/setup/configure-mm2-json/) in your MM2.json file.
25
+
</Note>
7
26
8
27
There are a variety of methods to query sqlite databases. Examples below show how to do a sqlite query in Linux terminal, but first you might need to install sqlite with `sudo apt install sqlite3`.
9
28
@@ -52,6 +71,10 @@ This table keeps a detailed record of all swaps performed (including failed) in
52
71
| 14 | taker\_coin\_usd\_price | DECIMAL | USD price of taker coin at the time of the swap |
This table stores a record of results returned by registered nodes [tracked for node stats collection](/komodo-defi-framework/api/v20/start_version_stat_collection/) in this pubkey's MM2.db
144
+
Additional tables are created for each coin to store supplementary details such as block headers and transaction history. Using KMD as an example, these tables are listed below:
70692|dragonhound_DEV||1640271615|Error on request the peer PeerId("12D3KooWEnrvbqvtTowYMR8FnBeKtryTj9RcXGx8EPpFZHou2ruP"): "Canceled". Request next peer
0 commit comments