Skip to content

Commit

Permalink
Add clientInfo to ENR for easier testnet debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeme committed Jul 26, 2023
1 parent 31cff91 commit e7b639e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions fluffy/fluffy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ proc run(config: PortalConf) {.raises: [CatchableError].} =
d = newProtocol(
netkey,
extIp, none(Port), extUdpPort,
# Note: The addition of clientInfo to the ENR is a temporary measure to
# easily identify & debug the clients used in the testnet.
localEnrFields = {"c": clientInfoShort},
bootstrapRecords = bootstrapRecords,
bindIp = bindIp, bindPort = udpPort,
enrAutoUpdate = config.enrAutoUpdate,
Expand Down
7 changes: 6 additions & 1 deletion fluffy/version.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

{.push raises: [].}

import strutils
import
std/strutils,
stew/byteutils

const
versionMajor* = 0
Expand All @@ -30,3 +32,6 @@ const
fullVersionStr & "/" &
hostOS & "-" & hostCPU & "/" &
"Nim" & nimVersion

# Short debugging indentifier for ENR
clientInfoShort* = toBytes("f-" & gitRevision)

0 comments on commit e7b639e

Please sign in to comment.