def get_admin_block_head(): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_admin_block_head() db.close() if block is None: bottle.abort(404) return block.to_dict()
def get_factoid_block(keymr: str): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_factoid_block(keymr=bytes.fromhex(keymr)) db.close() if block is None: bottle.abort(404) return block.to_dict()
def get_admin_block(lookup_hash: str): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_admin_block(lookup_hash=bytes.fromhex(lookup_hash)) db.close() if block is None: bottle.abort(404) return block.to_dict()
def get_directory_block_by_height(height: int): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_directory_block(height=height) db.close() if block is None: bottle.abort(404) return block.to_dict()
def get_entry(entry_hash: str): db = factom_core.db.FactomdLevelDB(create_if_missing=True) entry = db.get_entry(bytes.fromhex(entry_hash)) db.close() if entry is None: bottle.abort(404) return entry.to_dict()
def get_entry_block_head(chain_id: str): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_entry_block_head(chain_id=bytes.fromhex(chain_id)) db.close() if block is None: bottle.abort(404) return block.to_dict()
def get_entry_credit_block(header_hash: str): db = factom_core.db.FactomdLevelDB(create_if_missing=True) block = db.get_entry_credit_block(keymr=bytes.fromhex(header_hash)) db.close() if block is None: bottle.abort(404) return block.to_dict()