Moved rocksDb for unused for testing (#352)
* Moved rocksDb for unused for testing * Add librocks deps * Install via apt * Update apt first * Manual RocksDb build * Add build deps * Unknown package * Update packages * Follow FB rocksdb config (travis.yml)
This commit is contained in:
+28
-11
@@ -1,9 +1,26 @@
|
||||
language: node_js
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
node_js:
|
||||
- "10"
|
||||
env:
|
||||
- GH_PAGES_SRC="build-docs"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- curl
|
||||
- g++-8
|
||||
- libbz2-dev
|
||||
- libgflags-dev
|
||||
- libsnappy-dev
|
||||
- mingw-w64
|
||||
- zlib1g-dev
|
||||
before_install:
|
||||
# - sudo apt-get update
|
||||
# - sudo apt-get install curl g++-8 libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev mingw-w64 zlib1g-dev
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$(yarn global bin):$PATH
|
||||
cache:
|
||||
@@ -11,17 +28,17 @@ cache:
|
||||
directories:
|
||||
- node_modules
|
||||
install:
|
||||
# - export ROCKSDB=$HOME/rocksdb-master
|
||||
# - pushd $HOME
|
||||
# - curl -sLO https://github.com/facebook/rocksdb/archive/master.zip
|
||||
# - unzip master.zip
|
||||
# - cd rocksdb-master
|
||||
# - make shared_lib
|
||||
# - popd
|
||||
# - export CFLAGS="-I${ROCKSDB}/include/"
|
||||
# - export CXXFLAGS="-I${ROCKSDB}/include/"
|
||||
# - export LDFLAGS="-L${ROCKSDB} -lrocksdb -lstdc++ -lm -lz"
|
||||
# - export LD_LIBRARY_PATH="${ROCKSDB}:/usr/local/lib"
|
||||
- export ROCKSDB=$HOME/rocksdb-master
|
||||
- pushd $HOME
|
||||
- curl -sLO https://github.com/facebook/rocksdb/archive/master.zip
|
||||
- unzip -q master.zip
|
||||
- cd rocksdb-master
|
||||
- make shared_lib
|
||||
- popd
|
||||
- export CFLAGS="-I${ROCKSDB}/include/"
|
||||
- export CXXFLAGS="-I${ROCKSDB}/include/"
|
||||
- export LDFLAGS="-L${ROCKSDB} -lrocksdb -lstdc++ -lm -lz"
|
||||
- export LD_LIBRARY_PATH="${ROCKSDB}:/usr/local/lib"
|
||||
- yarn
|
||||
script:
|
||||
- yarn polkadot-dev-build-travis
|
||||
|
||||
+2
-2
@@ -21,8 +21,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@polkadot/dev": "^0.25.12",
|
||||
"@polkadot/ts": "^0.1.55",
|
||||
"@polkadot/dev": "^0.25.13",
|
||||
"@polkadot/ts": "^0.1.56",
|
||||
"gh-pages": "^2.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"lru_map": "^0.3.3",
|
||||
"mkdirp": "^0.5.1",
|
||||
"node-lmdb": "^0.6.2",
|
||||
"rocksdb-node": "jacogr/rocksdb-node#00ebfdbf0462ee615f4f48f1db403fd4df8471ea",
|
||||
"snappy": "^6.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import mkdirp from 'mkdirp';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
import stringToU8a from '@polkadot/util/string/toU8a';
|
||||
import rimraf from 'rimraf';
|
||||
import { stringToU8a } from '@polkadot/util/index';
|
||||
|
||||
import RocksDb from './RocksDb';
|
||||
|
||||
@@ -13,7 +13,7 @@ describe.skip('RocksDb', () => {
|
||||
const base = path.join(os.tmpdir(), '--test--');
|
||||
const name = 'RocksDb';
|
||||
const location = path.join(base, name);
|
||||
let db;
|
||||
let db: any;
|
||||
|
||||
beforeAll(() => {
|
||||
db = new RocksDb(base, name);
|
||||
+19
-9
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
"rocksdb-node": "jacogr/rocksdb-node#00ebfdbf0462ee615f4f48f1db403fd4df8471ea",
|
||||
// "rocksdb-node": "jacogr/rocksdb-node#00ebfdbf0462ee615f4f48f1db403fd4df8471ea",
|
||||
|
||||
import { BaseDb, ProgressCb } from '../types';
|
||||
|
||||
@@ -10,13 +10,7 @@ import rocksdb, { RocksDb } from 'rocksdb-node';
|
||||
import mkdirp from 'mkdirp';
|
||||
import path from 'path';
|
||||
// import snappy from 'snappy';
|
||||
import logger from '@polkadot/util/logger';
|
||||
import bufferToU8a from '@polkadot/util/buffer/toU8a';
|
||||
import u8aToBuffer from '@polkadot/util/u8a/toBuffer';
|
||||
import u8aToHex from '@polkadot/util/u8a/toHex';
|
||||
|
||||
// import assert from '@polkadot/util/assert';
|
||||
// import u8aToHex from '@polkadot/util/u8a/toHex';
|
||||
import { bufferToU8a, logger, u8aToBuffer, u8aToHex } from '@polkadot/util/index';
|
||||
|
||||
const l = logger('db/rocksdb');
|
||||
|
||||
@@ -37,6 +31,14 @@ export default class Rocks implements BaseDb {
|
||||
this.db.close();
|
||||
}
|
||||
|
||||
drop (): void {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
empty (): void {
|
||||
throw new Error('unimplemented');
|
||||
}
|
||||
|
||||
open (): void {
|
||||
l.debug(() => ['open']);
|
||||
}
|
||||
@@ -49,6 +51,10 @@ export default class Rocks implements BaseDb {
|
||||
});
|
||||
}
|
||||
|
||||
rename (base: string, file: string): void {
|
||||
// nothing
|
||||
}
|
||||
|
||||
del (key: Uint8Array): void {
|
||||
this.db.del(
|
||||
{},
|
||||
@@ -77,8 +83,12 @@ export default class Rocks implements BaseDb {
|
||||
);
|
||||
}
|
||||
|
||||
size (): number {
|
||||
return 0;
|
||||
}
|
||||
|
||||
private _deserializeValue (value: Buffer): Uint8Array | null {
|
||||
return value
|
||||
return value && value.length
|
||||
? bufferToU8a(value)
|
||||
// ? bufferToU8a(
|
||||
// snappy.uncompressSync(value)
|
||||
@@ -1393,10 +1393,10 @@
|
||||
universal-user-agent "^2.0.0"
|
||||
url-template "^2.0.8"
|
||||
|
||||
"@polkadot/dev@^0.25.12":
|
||||
version "0.25.12"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.25.12.tgz#de440a96dba3c9b4a92e6be0f0276b8c1f4daf24"
|
||||
integrity sha512-pISn6l4+brHCE04jjqSc7j7V63QmuhFykJFV2WejZHvUtKzBJa35C1ps+U9iKfa5Ma2gFyjyvlQOOvAKRwuKrA==
|
||||
"@polkadot/dev@^0.25.13":
|
||||
version "0.25.13"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.25.13.tgz#2cb3888cba59409dc0e5f829b41c738e34e8fad7"
|
||||
integrity sha512-uHizvsNzNodL+aL7B0z363l4/mAfguzdaP5xggUsI9z2iA3GPu80gmgmLgMq+0kbr/Ju0N3vWP5BgUI4OH5/Qw==
|
||||
dependencies:
|
||||
"@babel/cli" "^7.2.3"
|
||||
"@babel/core" "^7.3.4"
|
||||
@@ -1434,10 +1434,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/schnorrkel-js/-/schnorrkel-js-0.1.2-3.tgz#9117ac5126b465a1cf53c2b6bb68a17efc7e0390"
|
||||
integrity sha512-1LgF4wtER3q5uqY67CdOsQQ/SBqT6v0ZKQIS3cOTVByF16WtApD6U324uCJyMdie+GZFv0xr/40I4Ni2It+8jw==
|
||||
|
||||
"@polkadot/ts@^0.1.55":
|
||||
version "0.1.55"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.55.tgz#6bd5840035e8bde0e53932b136253e90398313b7"
|
||||
integrity sha512-OWB9GTS3BUVY1VU5JtDnN02RytchS+nN5WJg/aLhGR1BMU4DNqef7rgDonhJEaEbZzlQ/j+S+colK/0MYzQ9Bw==
|
||||
"@polkadot/ts@^0.1.56":
|
||||
version "0.1.56"
|
||||
resolved "https://registry.yarnpkg.com/@polkadot/ts/-/ts-0.1.56.tgz#ffd6e9c95704a7fb90b918193b9dc5c440114b27"
|
||||
integrity sha512-wnt4zXxZXyz6WaubTO/I+nUElwV2DogFzdl6CrKfVn2PTWp8uHN06W9s40FH57ORtmQfDr9rLRP8Nq+oIyElbg==
|
||||
|
||||
"@types/base-x@*":
|
||||
version "3.0.0"
|
||||
@@ -7546,6 +7546,11 @@ mute-stream@~0.0.4:
|
||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
|
||||
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
|
||||
|
||||
nan@2.11.0:
|
||||
version "2.11.0"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099"
|
||||
integrity sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw==
|
||||
|
||||
nan@^2.12.0, nan@^2.12.1, nan@^2.2.1, nan@^2.9.2:
|
||||
version "2.12.1"
|
||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552"
|
||||
@@ -9538,6 +9543,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
|
||||
hash-base "^3.0.0"
|
||||
inherits "^2.0.1"
|
||||
|
||||
rocksdb-node@jacogr/rocksdb-node#00ebfdbf0462ee615f4f48f1db403fd4df8471ea:
|
||||
version "1.7.2"
|
||||
resolved "https://codeload.github.com/jacogr/rocksdb-node/tar.gz/00ebfdbf0462ee615f4f48f1db403fd4df8471ea"
|
||||
dependencies:
|
||||
nan "2.11.0"
|
||||
|
||||
rsvp@^3.3.3:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a"
|
||||
|
||||
Reference in New Issue
Block a user