Skip to content

Commit

Permalink
Send node version while joining as a first node during restart
Browse files Browse the repository at this point in the history
  • Loading branch information
tanuj-shardeum authored and mhanson-github committed Aug 20, 2024
1 parent 959d7d5 commit e9a5a4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/p2p/Self.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { P2P } from '@shardus/types'
import { version as shardusVersion } from '../../package.json'
import { NodeStatus, SignedObject } from '@shardus/types/build/src/p2p/P2PTypes'
import * as events from 'events'
import * as log4js from 'log4js'
Expand Down Expand Up @@ -32,6 +33,7 @@ import { submitStandbyRefresh } from './Join/v2/standbyRefresh'
import { getNumArchivers } from './Archivers'
import { currentQuarter } from './CycleCreator'
import { Utils } from '@shardus/types'
import { version } from 'os'

/** STATE */

Expand Down Expand Up @@ -995,14 +997,18 @@ async function getActiveNodesFromArchiver(
archiver: ActiveNode
): Promise<P2P.P2PTypes.SignedObject<SeedNodesList>> {
const nodeInfo = getPublicNodeInfo()
const joinRequest = {
...nodeInfo,
version: shardusVersion
}
const seedListResult: Result<
P2P.P2PTypes.SignedObject<SeedNodesList>,
Error
> = await Archivers.postToArchiver(
archiver,
'nodelist',
Context.crypto.sign({
nodeInfo,
joinRequest,
}),
10000
)
Expand Down

0 comments on commit e9a5a4f

Please sign in to comment.