*Add api method to create swarms
This commit is contained in:
parent
2832694cd5
commit
ba38f7670f
|
@ -81,6 +81,7 @@ addHandler("createProtomuxChannel", createProtomuxChannel, {
|
||||||
addHandler("createProtomuxMessage", createProtomuxMessage, {
|
addHandler("createProtomuxMessage", createProtomuxMessage, {
|
||||||
receiveUpdates: true,
|
receiveUpdates: true,
|
||||||
});
|
});
|
||||||
|
addHandler("createSwarm", handleCreateSwarm);
|
||||||
|
|
||||||
async function handlePresentSeed(aq: ActiveQuery) {
|
async function handlePresentSeed(aq: ActiveQuery) {
|
||||||
const pubkey = await ed.getPublicKey(aq.callerInput.rootKey);
|
const pubkey = await ed.getPublicKey(aq.callerInput.rootKey);
|
||||||
|
@ -589,6 +590,10 @@ async function createProtomuxMessage(aq: ActiveQuery) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleCreateSwarm(aq: ActiveQuery) {
|
||||||
|
aq.respond(await createSwarm());
|
||||||
|
}
|
||||||
|
|
||||||
function getSwarmToSocketConnectionId(socket: any) {
|
function getSwarmToSocketConnectionId(socket: any) {
|
||||||
for (const conn of connections) {
|
for (const conn of connections) {
|
||||||
if (conn[1].conn === socket) {
|
if (conn[1].conn === socket) {
|
||||||
|
|
Loading…
Reference in New Issue