diff --git a/README.md b/README.md index 0a53427..1e171d5 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,24 @@ k = Keys.get_key(key_str) # import existing hex private key k = Keys(priv_k=key_str) + ``` +### keystore +```python +import asyncio +from monstr.ident.keystore import SQLiteKeyStore + +async def get_store(): + # keys store plain text see /examples/key_store.py to see how to password protect + store = SQLiteKeyStore('keystore.db') + nk = await store.get('monty') + # will be None if monty is not in the store + print(nk) + +if __name__ == '__main__': + asyncio.run(get_store()) +``` ### run local relay diff --git a/examples/key_store.py b/examples/key_store.py index 17624ff..8246ecc 100644 --- a/examples/key_store.py +++ b/examples/key_store.py @@ -9,7 +9,6 @@ import logging from pathlib import Path from monstr.ident.keystore import SQLiteKeyStore, KeystoreInterface, KeyDataEncrypter, NamedKeys -from monstr.encrypt import Keys from monstr.util import util_funcs # db will be stored here