diff --git a/src/modules/swarm.ts b/src/modules/swarm.ts index 8ed5f4e..71c754c 100644 --- a/src/modules/swarm.ts +++ b/src/modules/swarm.ts @@ -13,6 +13,7 @@ import sodium from "sodium-universal"; import b4a from "b4a"; import log from "../log.js"; import { getKeyPair } from "../lib/seed.js"; +import { getPluginAPI } from "./plugin"; const LUMEWEB = b4a.from("lumeweb"); export const LUMEWEB_TOPIC_HASH = b4a.allocUnsafe(32); @@ -44,6 +45,10 @@ export async function start() { await node.listen(); node.join(LUMEWEB_TOPIC_HASH); + getPluginAPI().on("core.shutdown", async () => { + return bootstrap.destroy(); + }); + log.info( "Relay Identity is %s", b4a.from(getKeyPair().publicKey).toString("hex")