def get_db_state(working_dir):
    """
    Callback to the virtual chain state engine.
    Get a *read-only* handle to our state engine implementation
    (i.e. our name database).

    Note that in this implementation, the database
    handle returned will only support read-only operations by default.
    Attempts to save state with the handle will lead to program abort.

    Returns the handle on success
    Raises on error
    """
    impl = sys.modules[__name__]
    db_inst = BlockstackDB.get_readonly_instance(working_dir)
    assert db_inst, 'Failed to instantiate database handle'
    return db_inst