make `verifier` a cmd option

This commit is contained in:
Dmitriy Ryajov 2024-02-16 16:35:54 -06:00
parent 189ba80635
commit cba998fc12
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 17 additions and 12 deletions

View File

@ -70,8 +70,8 @@ type
persistence persistence
PersistenceCmd* {.pure.} = enum PersistenceCmd* {.pure.} = enum
noCmd
prover prover
validator
LogKind* {.pure.} = enum LogKind* {.pure.} = enum
Auto = "auto" Auto = "auto"
@ -275,15 +275,21 @@ type
hidden hidden
.}: int .}: int
case persistenceCmd* {. validator* {.
command }: PersistenceCmd desc: "Enables validator, requires an Ethereum node"
defaultValue: false
name: "validator"
.}: bool
of PersistenceCmd.validator: validatorMaxSlots* {.
validatorMaxSlots* {. desc: "Maximum number of slots that the validator monitors"
desc: "Maximum number of slots that the validator monitors" defaultValue: 1000
defaultValue: 1000 name: "validator-max-slots"
name: "validator-max-slots" .}: int
.}: int
case persistenceCmd* {.
defaultValue: noCmd
command }: PersistenceCmd
of PersistenceCmd.prover: of PersistenceCmd.prover:
circomR1cs* {. circomR1cs* {.
@ -343,6 +349,8 @@ type
defaultValue: DefaultCellElms defaultValue: DefaultCellElms
defaultValueDesc: $DefaultCellElms defaultValueDesc: $DefaultCellElms
name: "max-cell-elements" }: int name: "max-cell-elements" }: int
of PersistenceCmd.noCmd:
discard
of StartUpCmd.noCmd: of StartUpCmd.noCmd:
discard # end of persistence discard # end of persistence
@ -355,9 +363,6 @@ logutils.formatIt(LogFormat.json, EthAddress): %it
func persistence*(self: CodexConf): bool = func persistence*(self: CodexConf): bool =
self.cmd == StartUpCmd.persistence self.cmd == StartUpCmd.persistence
func validator*(self: CodexConf): bool =
self.persistence and self.persistenceCmd == PersistenceCmd.validator
func prover*(self: CodexConf): bool = func prover*(self: CodexConf): bool =
self.persistence and self.persistenceCmd == PersistenceCmd.prover self.persistence and self.persistenceCmd == PersistenceCmd.prover