*More log refactoring
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
7b9c667749
commit
212edf184d
|
@ -9,7 +9,7 @@ let app: FastifyInstance;
|
||||||
export async function start() {
|
export async function start() {
|
||||||
const keyPair = getKeyPair();
|
const keyPair = getKeyPair();
|
||||||
app = fastify({
|
app = fastify({
|
||||||
logger: true,
|
logger: log.child({ module: "app-server" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
|
@ -17,8 +17,4 @@ export async function start() {
|
||||||
});
|
});
|
||||||
|
|
||||||
await app.listen({ port: 80, host: "0.0.0.0" });
|
await app.listen({ port: 80, host: "0.0.0.0" });
|
||||||
|
|
||||||
const address = app.server.address() as AddressInfo;
|
|
||||||
|
|
||||||
log.info("HTTP/App Server started on ", `${address.address}:${address.port}`);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,6 @@ import * as http2 from "http2";
|
||||||
import websocket from "@fastify/websocket";
|
import websocket from "@fastify/websocket";
|
||||||
|
|
||||||
export async function start() {
|
export async function start() {
|
||||||
const relayPort = config.uint("port");
|
|
||||||
const dht = getSwarm();
|
const dht = getSwarm();
|
||||||
let sslOptions: boolean | http2.SecureServerOptions = false;
|
let sslOptions: boolean | http2.SecureServerOptions = false;
|
||||||
|
|
||||||
|
@ -30,6 +29,7 @@ export async function start() {
|
||||||
let relayServer = fastify({
|
let relayServer = fastify({
|
||||||
http2: true,
|
http2: true,
|
||||||
https: sslOptions as http2.SecureServerOptions,
|
https: sslOptions as http2.SecureServerOptions,
|
||||||
|
logger: log.child({ module: "relay-server" }),
|
||||||
});
|
});
|
||||||
|
|
||||||
relayServer.register(websocket);
|
relayServer.register(websocket);
|
||||||
|
@ -39,9 +39,4 @@ export async function start() {
|
||||||
});
|
});
|
||||||
|
|
||||||
await relayServer.listen({ port: config.uint("port"), host: "0.0.0.0" });
|
await relayServer.listen({ port: config.uint("port"), host: "0.0.0.0" });
|
||||||
let address = relayServer.server.address() as AddressInfo;
|
|
||||||
log.info(
|
|
||||||
"DHT Relay Server started on ",
|
|
||||||
`${address.address}:${address.port}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,8 +31,8 @@ export async function start() {
|
||||||
node.join(LUMEWEB_TOPIC_HASH);
|
node.join(LUMEWEB_TOPIC_HASH);
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
"Relay Identity is",
|
"Relay Identity is %s",
|
||||||
b4a.from(node.dht.defaultKeyPair.publicKey).toString("hex")
|
b4a.from(getKeyPair().publicKey).toString("hex")
|
||||||
);
|
);
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
|
|
Loading…
Reference in New Issue