Skip to content

Commit

Permalink
Test2
Browse files Browse the repository at this point in the history
  • Loading branch information
s-a-tanjim committed Aug 27, 2024
1 parent 0804ea9 commit d4beb77
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/keri/db/dbing.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,20 @@

from hio.base import filing

from .. import help
from ..help import helping

logger = help.ogler.getLogger()

ProemSize = 32 # does not include trailing separator
MaxProem = int("f"*(ProemSize), 16)
MaxON = int("f"*32, 16) # largest possible ordinal number, sequence or first seen

SuffixSize = 32 # does not include trailing separator
MaxSuffix = int("f"*(SuffixSize), 16)

KERIDBMapSizeKey = "KERI_DB_MAP_SIZE"

def dgKey(pre, dig):
"""
Returns bytes DB key from concatenation of '.' with qualified Base64 prefix
Expand Down Expand Up @@ -381,7 +386,13 @@ def reopen(self, readonly=False, **kwa):

# open lmdb major database instance
# creates files data.mdb and lock.mdb in .dbDirPath
print(f"Opening DB with map size: {self.MapSize}")
if (mapSize := os.getenv(KERIDBMapSizeKey)) is not None:
try:
self.MapSize = int(mapSize)
except ValueError:
logger.error("KERI_DB_MAP_SIZE must be an integer value >1!")
raise

self.env = lmdb.open(self.path, max_dbs=self.MaxNamedDBs, map_size=self.MapSize,
mode=self.perm, readonly=self.readonly)
self.opened = True if opened and self.env else False
Expand Down
47 changes: 47 additions & 0 deletions test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
kli init --name watcherpy --nopasscode --base ./base --config-dir ./keri-conf --config-file config


kli incept --name watcherpy --alias watcherpy --base ./base --file ./keri-conf/data/data.json


sudo rm -rf ~/.keri


# Demo witness

kli init --name local-wit --nopasscode --config-dir ./scripts --config-file demo-witness-oobis

kli incept --name local-wit --alias local-wit --file ./scripts/demo/data/multisig-3-sample.json


# Test2
kli init --name test4 --nopasscode --config-dir ./keri-conf --config-file config


kli incept --name test4 --alias test4 --file ./keri-conf/data/data.json


# Stage
kli init --name stagetest66 --nopasscode --config-dir ./keri-conf --config-file stage-config
kli incept --name stagetest66 --alias stagetest66 --file ./keri-conf/data/stage-data.json

# Test3
kli init --name devtest22 --nopasscode --config-dir ./keri-conf --config-file config
kli incept --name devtest22 --alias devtest22 --file ./keri-conf/data/data.json

# With Base?

kli init \
--name alice_ks \
--base play/one/alice \
--nopasscode \
--salt ${ALICE_SALT} \
--config-dir ${KERI_CONFIG_DIR} \
--config-file alice-witness-oobis


kli incept \
--name alice_ks \
--base play/one/alice \
--alias alice-aid \
-f play/one/alice/kid-conf.json

0 comments on commit d4beb77

Please sign in to comment.