Skip to content

Commit

Permalink
packages/relay-server: fix pnpm build
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltg committed Jun 21, 2024
1 parent cce69e4 commit f8a5bf9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/relay-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@libp2p/circuit-relay-v2": "^1.1.0",
"@libp2p/fetch": "^1.1.0",
"@libp2p/identify": "^2.1.0",
"@libp2p/interface": "^1.5.0",
"@libp2p/peer-id": "^4.1.4",
"@libp2p/peer-id-factory": "^4.1.4",
"@libp2p/ping": "^1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/relay-server/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import express from "express"
import express, { Express } from "express"
import { StatusCodes } from "http-status-codes"
import client from "prom-client"

export const app = express()
export const app: Express = express()

app.get("/", (req, res) => {
return void res.writeHead(StatusCodes.OK).end()
Expand Down
3 changes: 2 additions & 1 deletion packages/relay-server/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { PeerId } from "@libp2p/interface"
import { createFromProtobuf, createEd25519PeerId } from "@libp2p/peer-id-factory"

const { PEER_ID, LISTEN, ANNOUNCE } = process.env

export async function getPeerId() {
export async function getPeerId(): Promise<PeerId> {
if (typeof PEER_ID === "string") {
return await createFromProtobuf(Buffer.from(PEER_ID, "base64"))
} else {
Expand Down

0 comments on commit f8a5bf9

Please sign in to comment.