Working with SQLite

The view server uses SQLite3 to store client state locally. During debugging, you may wish to interact with the sqlite db directly. To do so:

$ sqlite3 ~/.local/share/pcli/pcli-view.sqlite
sqlite> PRAGMA table_info(tx);

sqlite> SELECT json_object('tx_hash', quote(tx_hash)) FROM tx;

Note that because binary data is stored directly in the db (see BLOB in pragma), you’ll need to decode the blob as a JSON object to get readable info.

Viewing IBC assets

To list assets that have been transferred in via IBC, query on the denom for a prefix of transfer/:

sqlite> SELECT denom, json_object('asset_id', quote(asset_id)) FROM assets WHERE denom LIKE 'transfer/%' ;