-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: configure protected topics via cli #1696
Conversation
507c2d5
to
5b5d266
Compare
Would you mind waiting for wakunode2 feature branch to be merged to merge this PR? cc @jm-clius |
@LNSD sure, let me know :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, LGTM. We should be able to merge the wakunode2
app changes early next week, after which this should be mergeable. Mind moving the config item to a separate section with a commented title such as Application-level configuration
. This is because it configures only application behaviour and not strictly speaking the node.
|
||
let publicKey = secp256k1.SkPublicKey.fromHex(elements[1]) | ||
if publicKey.isErr: | ||
raise newException(ConfigurationError, "Invalid public key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we append the publicKey.error()
at this point?
proc readValue*(r: var TomlReader, value: var ProtectedTopic) {.raises: [SerializationError].} = | ||
try: | ||
value = parseCmdArg(ProtectedTopic, r.readValue(string)) | ||
except CatchableError: | ||
raise newException(SerializationError, getCurrentExceptionMsg()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could reduce some code:
proc readValue*(r: var TomlReader, value: var ProtectedTopic) {.raises: [SerializationError].} = | |
try: | |
value = parseCmdArg(ProtectedTopic, r.readValue(string)) | |
except CatchableError: | |
raise newException(SerializationError, getCurrentExceptionMsg()) | |
proc readValue*(r: var TomlReader, value: var ProtectedTopic) {.raises: [ConfigurationError].} = | |
value = parseCmdArg(ProtectedTopic, r.readValue(string)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm unsure how this works under the hood, so just mirroring what we currently have in other readValue
function parsing other arguments.
5b5d266
to
9055cf5
Compare
9055cf5
to
cb2a892
Compare
@jm-clius with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Summary:
protected-topic
is added with the formatpubsubtopic:publickey
Example:
Output:
Application-level configuration