Skip to content

Commit

Permalink
recursive start relay on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
d-roak committed Jun 21, 2024
1 parent 7c0f67f commit e760802
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/node/src/run_relay.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { createRelayNode } from "@topology-foundation/network";

export async function start() {
const node = await createRelayNode();
console.log("peer_id:", node.peerId.toString());
for (let ma of node.getMultiaddrs()) {
console.log(ma);
try {
const node = await createRelayNode();
console.log("peer_id:", node.peerId.toString());
for (let ma of node.getMultiaddrs()) {
console.log(ma);
}
} catch (e) {
console.error(e);
start();
}
}

Expand Down

0 comments on commit e760802

Please sign in to comment.