def setUp(self):
        self.db_path = tempfile.mkdtemp()
        self.db_log_path = tempfile.mkdtemp()

        self.provider = rocksdb.RocksDBProvider(self.db_path, self.db_log_path, read_only=False)
        self.tangle = iotapy.storage.tangle.Tangle(self.provider)
        self.tx_validator = iotapy.validators.transaction.TransactionValidator(
            self.tangle, iotapy.network.TransactionRequester(self.tangle))
Exemple #2
0
 def test_create_a_new_database(self):
     with tempfile.TemporaryDirectory() as db_path:
         with tempfile.TemporaryDirectory() as db_log_path:
             r = rocksdb.RocksDBProvider(str(db_path), str(db_log_path), read_only=False)
             r.init()
             ch = r.db.column_family_handles[b'transaction']
             r.db.put(b'hello', b'world', ch)
             self.assertEqual(r.db.get(b'hello', ch), b'world')
    def setUp(self):
        self.db_path = tempfile.mkdtemp()
        self.db_log_path = tempfile.mkdtemp()

        self.provider = rocksdb.RocksDBProvider(self.db_path,
                                                self.db_log_path,
                                                read_only=False)
        self.provider.init()
Exemple #4
0
 def setUp(self):
     self.provider = rocksdb.RocksDBProvider('/var/db/iota/mainnetdb', '/var/db/iota/mainnetdb.log', read_only=True)
     self.provider.init()