decentralised sync engine

Compare changes

Choose any two refs to compare.

Changed files
+9 -5
src
+2 -2
tsconfig.json
···
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
-
"module": "nodenext" /* Specify what module code is generated. */,
+
"module": "bundler" /* Specify what module code is generated. */,
"rootDir": "./src/" /* Specify the root folder within your source files. */,
-
"moduleResolution": "nodenext" /* Specify how TypeScript looks up a file from a given module specifier. */,
+
"moduleResolution": "bundler" /* Specify how TypeScript looks up a file from a given module specifier. */,
"baseUrl": "./" /* Specify the base directory to resolve non-relative module names. */,
"paths": {
"@/*": [
+1
.gitignore
···
/node_modules
/dist
.env
+
.docker.env
*.tsbuildinfo
+1 -1
src/index.ts
···
}
}
-
server.listen({ port: SERVER_PORT }).catch((err: unknown) => {
+
server.listen({ port: SERVER_PORT, host: "::" }).catch((err: unknown) => {
server.log.error(err);
process.exit(1);
});
+4 -1
src/lib/utils/handshake.ts
···
error: httpResponseParseError,
data: handshakeResponseDataParsed,
} = httpSuccessResponseSchema.safeParse(handshakeResponseData);
-
if (!httpResponseParseSuccess)
+
if (!httpResponseParseSuccess) {
+
console.error("Parsing response failed.", httpResponseParseError);
+
console.error("Incoming data:", JSON.stringify(handshakeResponseData));
return {
ok: false,
error: z.treeifyError(httpResponseParseError),
};
+
}
const { data: handshakeData } = handshakeResponseDataParsed;
+1 -1
src/lib/env.ts
···
"Environment variable SERVICE_DID not set. Defaulting to `did:web:localhost`",
);
}
-
export const SERVICE_DID = serviceDidParsed ?? "did:web:localhost";
+
export const SERVICE_DID = serviceDidParsed ?? `did:web:localhost%3A${SERVER_PORT.toString()}`;
const constellationUrl = process.env.CONSTELLATION_URL;
let constellationUrlParsed: URL | undefined;