Skip to content

Commit

Permalink
added keystore examples and updated README.md to mention keystores
Browse files Browse the repository at this point in the history
  • Loading branch information
monty committed Jun 5, 2024
1 parent 9615cf3 commit 3d07764
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion examples/key_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3d07764

Please sign in to comment.