mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-17 11:06:30 +02:00
Local endpoints from the get config
This commit is contained in:
@@ -29,7 +29,7 @@ export const handleNewtGetConfigMessage: MessageHandler = async (context) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { publicKey, port, chainId } = message.data;
|
const { publicKey, port, localEndpoints, chainId } = message.data;
|
||||||
const siteId = newt.siteId;
|
const siteId = newt.siteId;
|
||||||
|
|
||||||
// Get the current site data
|
// Get the current site data
|
||||||
@@ -69,7 +69,10 @@ export const handleNewtGetConfigMessage: MessageHandler = async (context) => {
|
|||||||
.update(sites)
|
.update(sites)
|
||||||
.set({
|
.set({
|
||||||
publicKey,
|
publicKey,
|
||||||
listenPort: port
|
listenPort: port,
|
||||||
|
localEndpoints: localEndpoints
|
||||||
|
? JSON.stringify(localEndpoints)
|
||||||
|
: null
|
||||||
})
|
})
|
||||||
.where(eq(sites.siteId, siteId))
|
.where(eq(sites.siteId, siteId))
|
||||||
.returning();
|
.returning();
|
||||||
|
|||||||
@@ -48,8 +48,7 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
|||||||
pingResults,
|
pingResults,
|
||||||
newtVersion,
|
newtVersion,
|
||||||
backwardsCompatible,
|
backwardsCompatible,
|
||||||
chainId,
|
chainId
|
||||||
localEndpoints
|
|
||||||
} = message.data;
|
} = message.data;
|
||||||
if (!publicKey) {
|
if (!publicKey) {
|
||||||
logger.warn("Public key not provided");
|
logger.warn("Public key not provided");
|
||||||
@@ -132,10 +131,7 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
|||||||
.set({
|
.set({
|
||||||
pubKey: publicKey,
|
pubKey: publicKey,
|
||||||
exitNodeId: exitNodeId,
|
exitNodeId: exitNodeId,
|
||||||
subnet: newSubnet,
|
subnet: newSubnet
|
||||||
localEndpoints: localEndpoints
|
|
||||||
? JSON.stringify(localEndpoints)
|
|
||||||
: null
|
|
||||||
})
|
})
|
||||||
.where(eq(sites.siteId, siteId))
|
.where(eq(sites.siteId, siteId))
|
||||||
.returning();
|
.returning();
|
||||||
@@ -143,10 +139,7 @@ export const handleNewtRegisterMessage: MessageHandler = async (context) => {
|
|||||||
await db
|
await db
|
||||||
.update(sites)
|
.update(sites)
|
||||||
.set({
|
.set({
|
||||||
pubKey: publicKey,
|
pubKey: publicKey
|
||||||
localEndpoints: localEndpoints
|
|
||||||
? JSON.stringify(localEndpoints)
|
|
||||||
: null
|
|
||||||
})
|
})
|
||||||
.where(eq(sites.siteId, siteId))
|
.where(eq(sites.siteId, siteId))
|
||||||
.returning();
|
.returning();
|
||||||
|
|||||||
Reference in New Issue
Block a user