diff --git a/README.md b/README.md index f5b66a4..b4ea1c3 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,6 @@ Ethereum-related utilities written in Nim. Includes things like Bloom filters, p ## Prerequisites - Nim & Nimble -- RocksDB, SQLite, LMDB (required for the trie backend tests) - -E.g. on Ubuntu one can run: -``` -apt install -y librocksdb-dev liblmdb-dev sqlite3 -``` ## Building & Testing ``` diff --git a/eth.nimble b/eth.nimble index cdfe5cd..eac4aa1 100644 --- a/eth.nimble +++ b/eth.nimble @@ -8,7 +8,6 @@ requires "nim >= 1.2.0", "nimcrypto", "stint", "secp256k1", - "rocksdb", "chronos", "chronicles", "stew", diff --git a/eth/db/kvstore_rocksdb.nim b/eth/db/kvstore_rocksdb.nim deleted file mode 100644 index fd02640..0000000 --- a/eth/db/kvstore_rocksdb.nim +++ /dev/null @@ -1,52 +0,0 @@ -{.push raises: [Defect].} - -import - std/os, - rocksdb, stew/results, - ./kvstore - -export results - -const maxOpenFiles = 512 - -type - RocksStoreRef* = ref object of RootObj - store: RocksDBInstance - -proc get*(db: RocksStoreRef, key: openArray[byte], onData: kvstore.DataProc): KvResult[bool] = - db.store.get(key, onData) - -proc find*(db: RocksStoreRef, prefix: openArray[byte], onFind: kvstore.KeyValueProc): KvResult[int] = - raiseAssert "Unimplemented" - -proc put*(db: RocksStoreRef, key, value: openArray[byte]): KvResult[void] = - db.store.put(key, value) - -proc contains*(db: RocksStoreRef, key: openArray[byte]): KvResult[bool] = - db.store.contains(key) - -proc del*(db: RocksStoreRef, key: openArray[byte]): KvResult[void] = - db.store.del(key) - -proc close*(db: RocksStoreRef) = - db.store.close - -proc init*( - T: type RocksStoreRef, basePath: string, name: string, - readOnly = false): KvResult[T] = - let - dataDir = basePath / name / "data" - backupsDir = basePath / name / "backups" - - try: - createDir(dataDir) - createDir(backupsDir) - except OSError, IOError: - return err("rocksdb: cannot create database directory") - - var store: RocksDBInstance - if (let v = store.init( - dataDir, backupsDir, readOnly, maxOpenFiles = maxOpenFiles); v.isErr): - return err(v.error) - - ok(T(store: store)) diff --git a/tests/db/all_tests.nim b/tests/db/all_tests.nim index afb6f62..552aea1 100644 --- a/tests/db/all_tests.nim +++ b/tests/db/all_tests.nim @@ -1,4 +1,3 @@ import - ./test_kvstore_rocksdb, ./test_kvstore_sqlite3, ./test_kvstore diff --git a/tests/db/test_kvstore_rocksdb.nim b/tests/db/test_kvstore_rocksdb.nim deleted file mode 100644 index 2e099a9..0000000 --- a/tests/db/test_kvstore_rocksdb.nim +++ /dev/null @@ -1,18 +0,0 @@ -{.used.} - -import - std/os, - unittest2, - chronicles, - ../../eth/db/[kvstore, kvstore_rocksdb], - ./test_kvstore - -suite "RocksStoreRef": - test "KvStore interface": - let tmp = getTempDir() / "nimbus-test-db" - removeDir(tmp) - - let db = RocksStoreRef.init(tmp, "test")[] - defer: db.close() - - testKvStore(kvStore db, false)