mirror of
https://github.com/kayleegeorge/zk-chat.git
synced 2026-01-09 14:18:03 -05:00
update filepaths
This commit is contained in:
11
dist/index.js
vendored
11
dist/index.js
vendored
@@ -99009,11 +99009,6 @@ function generateAppIdentifier (appName) {
|
||||
// const vkey = JSON.parse(vkeyPath) // doesn't work
|
||||
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
|
||||
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
|
||||
var zkeyFiles = {
|
||||
vkeyPath: "/zkeyFiles/verification_key.json",
|
||||
wasmFilePath: "/zkeyFiles/rln.wasm",
|
||||
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
|
||||
};
|
||||
var RLN = /** @class */ (function () {
|
||||
// private memIndex: number
|
||||
function RLN(appName, onChain, rlnIdentifier) {
|
||||
@@ -99026,17 +99021,17 @@ var RLN = /** @class */ (function () {
|
||||
: generateAppIdentifier(appName);
|
||||
}
|
||||
/* call initRLN to create rln instance */
|
||||
RLN.prototype.initRLN = function (existingIdentity) {
|
||||
RLN.prototype.initRLN = function (vKeyPath, wasmFilePath, finalZkeyPath, existingIdentity) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var _a;
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
_a = this;
|
||||
return [4 /*yield*/, fetch(zkeyFiles.vkeyPath).then(function (res) { return res.json(); })];
|
||||
return [4 /*yield*/, fetch(vKeyPath).then(function (res) { return res.json(); })];
|
||||
case 1:
|
||||
_a.vKey = _b.sent();
|
||||
this.rlnjs = new rlnjs.RLN(zkeyFiles.wasmFilePath, zkeyFiles.finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
|
||||
this.rlnjs = new rlnjs.RLN(wasmFilePath, finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
|
||||
this.rlnIdentifier = this.rlnjs.rlnIdentifier;
|
||||
this.cache = new rlnjs.Cache(this.rlnjs.rlnIdentifier);
|
||||
this.identityCommitment = this.rlnjs.identity.getCommitment();
|
||||
|
||||
11
dist/index.mjs
vendored
11
dist/index.mjs
vendored
@@ -228240,11 +228240,6 @@ function generateAppIdentifier (appName) {
|
||||
// const vkey = JSON.parse(vkeyPath) // doesn't work
|
||||
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
|
||||
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
|
||||
var zkeyFiles = {
|
||||
vkeyPath: "/zkeyFiles/verification_key.json",
|
||||
wasmFilePath: "/zkeyFiles/rln.wasm",
|
||||
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
|
||||
};
|
||||
var RLN = /** @class */ (function () {
|
||||
// private memIndex: number
|
||||
function RLN(appName, onChain, rlnIdentifier) {
|
||||
@@ -228257,17 +228252,17 @@ var RLN = /** @class */ (function () {
|
||||
: generateAppIdentifier(appName);
|
||||
}
|
||||
/* call initRLN to create rln instance */
|
||||
RLN.prototype.initRLN = function (existingIdentity) {
|
||||
RLN.prototype.initRLN = function (vKeyPath, wasmFilePath, finalZkeyPath, existingIdentity) {
|
||||
return __awaiter$1(this, void 0, void 0, function () {
|
||||
var _a;
|
||||
return __generator$1(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0:
|
||||
_a = this;
|
||||
return [4 /*yield*/, fetch(zkeyFiles.vkeyPath).then(function (res) { return res.json(); })];
|
||||
return [4 /*yield*/, fetch(vKeyPath).then(function (res) { return res.json(); })];
|
||||
case 1:
|
||||
_a.vKey = _b.sent();
|
||||
this.rlnjs = new RLN$1(zkeyFiles.wasmFilePath, zkeyFiles.finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
|
||||
this.rlnjs = new RLN$1(wasmFilePath, finalZkeyPath, this.vKey, this.rlnIdentifier, existingIdentity);
|
||||
this.rlnIdentifier = this.rlnjs.rlnIdentifier;
|
||||
this.cache = new Cache(this.rlnjs.rlnIdentifier);
|
||||
this.identityCommitment = this.rlnjs.identity.getCommitment();
|
||||
|
||||
2
dist/types/RLN.d.ts
vendored
2
dist/types/RLN.d.ts
vendored
@@ -11,7 +11,7 @@ export default class RLN {
|
||||
identityCommitment?: bigint;
|
||||
vKey?: any;
|
||||
constructor(appName: string, onChain?: Contract, rlnIdentifier?: bigint);
|
||||
initRLN(existingIdentity?: string): Promise<void>;
|
||||
initRLN(vKeyPath: string, wasmFilePath: string, finalZkeyPath: string, existingIdentity?: string): Promise<void>;
|
||||
initOnChain(): Promise<void>;
|
||||
generateRLNProof(msg: string, epoch: bigint): Promise<RLNFullProof>;
|
||||
verifyProof(rlnProof: RLNFullProof): Promise<boolean>;
|
||||
|
||||
14
src/RLN.ts
14
src/RLN.ts
@@ -12,12 +12,6 @@ import generateAppIdentifier from "./utils/generateAppId"
|
||||
// const wasmFilePath = path.join('./zkeyFiles', 'rln', 'rln.wasm')
|
||||
// const finalZkeyPath = path.join('./zkeyFiles', 'rln', 'rln_final.zkey')
|
||||
|
||||
const zkeyFiles = {
|
||||
vkeyPath: "/zkeyFiles/verification_key.json",
|
||||
wasmFilePath: "/zkeyFiles/rln.wasm",
|
||||
finalZkeyPath: "/zkeyFiles/rln_final.zkey"
|
||||
}
|
||||
|
||||
export default class RLN {
|
||||
registry: Registry
|
||||
|
||||
@@ -47,11 +41,11 @@ export default class RLN {
|
||||
}
|
||||
|
||||
/* call initRLN to create rln instance */
|
||||
public async initRLN(existingIdentity?: string) {
|
||||
this.vKey = await fetch(zkeyFiles.vkeyPath).then((res) => res.json())
|
||||
public async initRLN(vKeyPath: string, wasmFilePath: string, finalZkeyPath: string, existingIdentity?: string) {
|
||||
this.vKey = await fetch(vKeyPath).then((res) => res.json())
|
||||
this.rlnjs = new RLNjs(
|
||||
zkeyFiles.wasmFilePath,
|
||||
zkeyFiles.finalZkeyPath,
|
||||
wasmFilePath,
|
||||
finalZkeyPath,
|
||||
this.vKey,
|
||||
this.rlnIdentifier,
|
||||
existingIdentity
|
||||
|
||||
Reference in New Issue
Block a user