Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/zkdb as a service #47

Merged
merged 15 commits into from
Nov 10, 2023
Next Next commit
Remove helia ipfs implementation
  • Loading branch information
chiro-hiro committed Oct 29, 2023
commit 78a734105a7174902220910a16beee1c58f4d5fe
11,600 changes: 3,706 additions & 7,894 deletions packages/zkdb/package-lock.json

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions packages/zkdb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkdb",
"version": "1.0.0",
"version": "1.1.0",
"description": "zkDatabase for the future of Web3",
"author": "chiro@orochi.network",
"license": "Apache-2.0",
Expand All @@ -27,7 +27,6 @@
"buildw": "tsc -p tsconfig.json --watch",
"coverage": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js --coverage",
"format": "prettier --write --ignore-unknown **/*",
"prepare": "cd .. && cd .. && husky install packages/zkdb/.husky",
"test": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js",
"testw": "node --experimental-vm-modules --experimental-wasm-threads node_modules/jest/bin/jest.js --watch",
"lint": "npx eslint ./src/**/*.ts --fix",
Expand Down Expand Up @@ -87,7 +86,6 @@
"eslint-import-resolver-typescript": "^3.5.5",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-o1js": "^0.4.0",
"husky": "^7.0.1",
"jest": "^27.3.1",
"lint-staged": "^11.0.1",
"prettier": "^2.3.2",
Expand All @@ -99,12 +97,7 @@
"o1js": "0.12.*"
},
"dependencies": {
"@helia/ipns": "^1.1.3",
"@helia/unixfs": "^1.4.1",
"@zkdb/kubo": "^1.0.5",
"blockstore-fs": "^1.1.5",
"bson": "^5.3.0",
"datastore-fs": "^9.1.4",
"helia": "^2.0.1"
"bson": "^5.3.0"
}
}
21 changes: 0 additions & 21 deletions packages/zkdb/src/core/common.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Field } from 'o1js';
import { CID } from 'multiformats';
import { TKuboConfig } from '@zkdb/kubo';

/**
Expand Down Expand Up @@ -68,21 +67,6 @@ export interface IFileIndex<S, T, R> {
resolve(_peerID?: S): Promise<T | undefined>;
}

export interface IIPFSDirRecord {
name: string;
type: 'object' | 'file' | 'directory' | 'raw' | 'identity';
cid: CID;
path: string;
cotent: () => any;
}

/**
* Transport layer
* @var tcp TCP transport
* @var websocket Websocket transport
*/
export type TTransport = 'tcp' | 'websocket';

/**
* Storage handler
* @var file File storage
Expand Down Expand Up @@ -173,9 +157,4 @@ export type TZKDatabaseConfig =
storageEngine: 'delegated-ipfs';
merkleHeight: number;
storageEngineCfg: TDelegatedIPFSConfig;
}
| {
storageEngine: 'ipfs';
merkleHeight: number;
storageEngineCfg: THeliaConfig;
};
5 changes: 0 additions & 5 deletions packages/zkdb/src/core/zkdb-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Metadata,
StorageEngineLocal,
StorageEngineDelegatedIPFS,
StorageEngineIPFS,
} from '../storage-engine/index.js';
import { IDocument, TZKDatabaseConfig } from './common.js';
import { IIndexing } from '../index/simple.js';
Expand Down Expand Up @@ -267,10 +266,6 @@ export class ZKDatabaseStorage {
storageEngine = await StorageEngineDelegatedIPFS.getInstance(
config.storageEngineCfg
);
} else if (config.storageEngine === 'ipfs') {
storageEngine = await StorageEngineIPFS.getInstance(
config.storageEngineCfg
);
} else {
storageEngine = await StorageEngineLocal.getInstance(
config.storageEngineCfg
Expand Down
244 changes: 0 additions & 244 deletions packages/zkdb/src/examples/piglet-bank.ts

This file was deleted.

Loading