Make discv5 `protocol-id` configurable at compile time

Co-authored-by: ksr <kaiserd@users.noreply.github.com>
This commit is contained in:
Lorenzo Delgado 2022-11-30 12:59:41 +01:00 committed by GitHub
parent 22d0ac81e1
commit 833818e9c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -31,12 +31,17 @@ declareCounter discovery_session_decrypt_failures, "Session decrypt failures"
logScope: logScope:
topics = "discv5" topics = "discv5"
# Support overriding the default discv5 protocol version and protocol id
# via compile time defines (e.g., '-d:discv5_protocol_id=d5waku')
const const
version: uint16 = 1 discv5_protocol_version {.intdefine.} : uint16 = 1
discv5_protocol_id {.strdefine.} = "discv5"
const
version = discv5_protocol_version
protocolId = toBytes(discv5_protocol_id)
idSignatureText = "discovery v5 identity proof" idSignatureText = "discovery v5 identity proof"
keyAgreementPrefix = "discovery v5 key agreement" keyAgreementPrefix = "discovery v5 key agreement"
protocolIdStr = "discv5"
protocolId = toBytes(protocolIdStr)
gcmNonceSize* = 12 gcmNonceSize* = 12
idNonceSize* = 16 idNonceSize* = 16
gcmTagSize* = 16 gcmTagSize* = 16