-
Notifications
You must be signed in to change notification settings - Fork 17
Description
The first step:
const result = await addNode(state.id, state.name, state.random, state.password, import.meta.env.VITE_APP_API_WSS);
Step 2:
const addNode = async (
id: string,
name: string,
pairingPhrase: string,
password: string,
serverHost?: string
): Promise => {
loading.value = true;
error.value = '';
try {
await nodeManager.addNode(id, name, pairingPhrase, password, serverHost);
currentNodeId.value = id;
refreshNodesList();
return { success: true };
} catch (err) {
error.value = (err as Error).message;
return { success: false, err };
} finally {
loading.value = false;
}
};
Step Three:
async addNode(
id: string,
name: string,
pairingPhrase: string,
password: string,
serverHost?: string
): Promise {
// Check if the node already exists
if (this.nodes.has(id)) {
throw new Error(Node with id "${id}" already exists
);
}
// Create a new LNC instance
const lnc = new LNC({
namespace: id,
serverHost: serverHost
});
console.log(lnc);
// Connect to node
lnc.credentials.pairingPhrase = pairingPhrase;
await lnc.connect();
// Verify connection
await lnc.lnd.lightning.listChannels();
// Set password to save credentials
lnc.credentials.password = password;
// Obtain node information
let alias = name;
try {
const info = await lnc.lnd.lightning.getInfo();
alias = info.alias || name;
} catch (error) {
console.warn('Failed to get node info:', error);
}
//Save to memory and local storage
this.nodes.set(id, lnc);
this.updateNodeInfo(id, {
id,
name,
alias,
serverHost,
isConnected: true,
isPaired: true,
lastConnected: new Date()
});
return lnc;
}
exist https://lightning.engineering/lnc-v0.3.3-alpha.wasm An error was returned before loading was complete (Response displayed) Failed to load response data Request content was evicted from inspector cache), There is no running log printing either. It was fine at first, but suddenly it's like this. Please help me check what the problem is. The error is as follows:
message: "Failed to execute 'compile' on 'WebAssembly': An argument must be provided, which must be a Response or Promise object"
stack: "TypeError: An argument must be provided, which must be a Response or Promise object"