Work on #508 (thin client)

This commit is contained in:
Zef Hemel
2023-08-26 08:31:51 +02:00
parent 3af0f180cd
commit 9ee9008bf2
30 changed files with 717 additions and 327 deletions
+8 -3
View File
@@ -1,14 +1,19 @@
import { KVStore } from "../../plugos/lib/kv_store.ts";
import { storeSyscalls } from "../../plugos/syscalls/store.ts";
import { proxySyscalls } from "../../plugos/syscalls/transport.ts";
import { SysCallMapping } from "../../plugos/system.ts";
// DEPRECATED, use store directly
export function clientStoreSyscalls(
storeCalls: SysCallMapping,
db: KVStore,
): SysCallMapping {
const localStoreCalls = storeSyscalls(db);
return proxySyscalls(
["clientStore.get", "clientStore.set", "clientStore.delete"],
(ctx, name, ...args) => {
return storeCalls[name.replace("clientStore.", "store.")](ctx, ...args);
return localStoreCalls[name.replace("clientStore.", "store.")](
ctx,
...args,
);
},
);
}