How to use the storage.helper.initKeyValueStorage function in storage

To help you get started, we’ve selected a few storage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / indy-node / indy_node / server / node.py View on Github external
def getIdrCache(self):
        if self.idrCache is None:
            self.idrCache = IdrCache(self.name,
                                     initKeyValueStorage(self.config.idrCacheStorage,
                                                         self.dataLocation,
                                                         self.config.idrCacheDbName,
                                                         db_config=self.config.db_idr_cache_db_config)
                                     )
        return self.idrCache
github hyperledger / indy-plenum / plenum / persistence / db_hash_store.py View on Github external
def open(self):
        self.nodesDb = storage.helper.initKeyValueStorage(
            self.db_type, self.dataDir, self.nodes_db_name, read_only=self._read_only)
        self.leavesDb = storage.helper.initKeyValueStorage(
            self.db_type, self.dataDir, self.leaves_db_name, read_only=self._read_only)
        self._leafCount = self.leavesDb.size
github hyperledger / indy-plenum / plenum / server / node.py View on Github external
def loadDomainState(self):
        return PruningState(
            initKeyValueStorage(
                self.config.domainStateStorage,
                self.dataLocation,
                self.config.domainStateDbName,
                db_config=self.config.db_state_config)
        )
github hyperledger / indy-plenum / plenum / server / ledgers_bootstrap.py View on Github external
def _create_state(self, name: str) -> PruningState:
        storage_name = getattr(self.config, "{}StateStorage".format(name))
        db_name = getattr(self.config, "{}StateDbName".format(name))
        if self.data_location is not None:
            return PruningState(
                initKeyValueStorage(
                    storage_name,
                    self.data_location,
                    db_name,
                    db_config=self.config.db_state_config))
        else:
            return PruningState(KeyValueStorageInMemory())
github hyperledger / indy-node / indy_node / server / node_bootstrap.py View on Github external
def init_idr_cache_storage(self):
        idr_cache = IdrCache(self.node.name,
                             initKeyValueStorage(self.node.config.idrCacheStorage,
                                                 self.node.dataLocation,
                                                 self.node.config.idrCacheDbName,
                                                 db_config=self.node.config.db_idr_cache_db_config)
                             )
        self.node.db_manager.register_new_store(IDR_CACHE_LABEL, idr_cache)
github hyperledger / indy-plenum / plenum / server / node.py View on Github external
def loadConfigState(self):
        return PruningState(
            initKeyValueStorage(
                self.config.configStateStorage,
                self.dataLocation,
                self.config.configStateDbName,
                db_config=self.config.db_state_config)
        )
github hyperledger / indy-node / data / migrations / deb / 1_3_428_to_1_3_429.py View on Github external
line_to_record = str(ledger_id) + ReqIdrToTxn.delimiter + str(seq_no)
        dest_seq_no_db_storage.put(digest, line_to_record)
        return digest

    new_db_name = db_name + '_new'
    old_path = os.path.join(db_dir, db_name)
    new_path = os.path.join(db_dir, new_db_name)
    new_seqno_db_name = config.seqNoDbName + '_new'
    attr_store = AttributeStore(
        initKeyValueStorage(
            config.attrStorage,
            db_dir,
            config.attrDbName,
            db_config=config.db_attr_db_config))
    try:
        dest_seq_no_db_storage = initKeyValueStorage(config.reqIdToTxnStorage,
                                                     db_dir,
                                                     new_seqno_db_name)
    except Exception:
        logger.error(traceback.format_exc())
        logger.error("Could not open new seq_no_db storage")
        return False

    # open new and old ledgers
    try:
        src_storage = KeyValueStorageRocksdbIntKeys(db_dir, db_name, read_only=True)
    except Exception:
        logger.error(traceback.format_exc())
        logger.error("Could not open old ledger: {}".format(os.path.join(db_dir, db_name)))
        return False

    try:
github hyperledger / indy-plenum / plenum / server / node.py View on Github external
def loadConfigState(self):
        return PruningState(
            initKeyValueStorage(
                self.config.configStateStorage,
                self.dataLocation,
                self.config.configStateDbName)
        )
github hyperledger / indy-plenum / plenum / server / node.py View on Github external
def loadDomainState(self):
        return PruningState(
            initKeyValueStorage(
                self.config.domainStateStorage,
                self.dataLocation,
                self.config.domainStateDbName)
        )