def startup():
    """
    start the databases
    """
    # start the Chainstate Database
    ret = hchaindb.open_hchainstate("heliumdb")
    if ret == False: return "error: failed to start Chainstate database"
    else: print("Chainstate Database running")
    # start the LevelDB Database blk_index
    ret = blkindex.open_blk_index("hblk_index")
    if ret == False: return "error: failed to start blk_index"
    else: print("blkindex Database running")
def startup():
    """
    start/create the blk_index database
    """
    # start the blk_index Database
    ret = blk_index.open_blk_index("hblk_index")
    if ret == False:
        print("error: failed to start blk_index database")
        return
    else:
        print("blk_index Database running")
    return True
def setup_module():
    os.system("rm -rf ../data/heliumdb/*")
    os.system("rm -rf ../data/hblk_index/*")
    os.system("rm *.log")

    # start the Chainstate Database
    ret = hchaindb.open_hchainstate("../data/heliumdb")
    if ret == False: return "error: failed to start Chainstate database"
    else: print("Chainstate Database running")
    # start the LevelDB Database blk_index
    ret = blkindex.open_blk_index("../data/hblk_index")
    if ret == False: return "error: failed to start blk_index"
    else: print("blkindex Database running")
def startup():
    '''
     start node related systems
     '''
    try:
        # remove any locks
        os.system("rm -rf ../data/heliumdb/*")
        os.system("rm -rf ../data/hblk_index/*")
        # start the Chainstate Database
        ret = hchaindb.open_hchainstate("../data/heliumdb")
        if ret == False: return "error: failed to start Chainstate database"
        else: print("Chainstate Database running")
        # start the LevelDB Database blk_index
        ret = blkindex.open_blk_index("../data/hblk_index")
        if ret == False: return "error: failed to start blk_index"
        else: print("blkindex Database running")

    except Exception:
        return "error: failed to start Chainstate database"

    return True
Ejemplo n.º 5
0
def setup_module():
    assert bool(blkindex.open_blk_index("hblk_index")) == True
    if os.path.isfile("hblk_index"):
        os.remove("hblk_index")
def setup_module():
    hchaindb.open_hchainstate("heliumdb")
    blk_index.open_blk_index("hblk_index")