Fills in arguments in example command

This commit is contained in:
benbierens 2024-08-23 09:42:42 +02:00
parent 90a03935fe
commit c1ae6e24d8
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
1 changed files with 15 additions and 5 deletions

View File

@ -1,4 +1,5 @@
import os import os
import strutils
import pkg/chronos import pkg/chronos
import pkg/chronicles import pkg/chronicles
import pkg/questionable import pkg/questionable
@ -53,10 +54,19 @@ proc initializeFromCircuitDirFiles(
failure("Ceremony files not found") failure("Ceremony files not found")
proc suggestDownloadTool() = proc suggestDownloadTool(config: CodexConf) =
error "TODO: We need to tell the user how to run the download tool. " & without address =? config.marketplaceAddress:
"So probably say './cirdl [circuitDir] [rpcEndpoint] [marketplaceAddress]' " & raise (ref Defect)(msg: "Proving backend initializing while marketplace address not set.")
"but with the correct values already filled in."
let tokens = [
"cirdl",
$config.circuitDir,
config.ethProvider,
$address
]
error "Proving circuit files are not found. Please run the following to download them:" &
"'./" & tokens.join(" ") & "'"
proc initializeBackend*( proc initializeBackend*(
config: CodexConf, config: CodexConf,
@ -66,7 +76,7 @@ proc initializeBackend*(
info "Could not initialize prover backend from CLI options...", msg = cliErr.msg info "Could not initialize prover backend from CLI options...", msg = cliErr.msg
without backend =? initializeFromCircuitDirFiles(config, utils), localErr: without backend =? initializeFromCircuitDirFiles(config, utils), localErr:
info "Could not initialize prover backend from circuit dir files...", msg = localErr.msg info "Could not initialize prover backend from circuit dir files...", msg = localErr.msg
suggestDownloadTool() suggestDownloadTool(config)
return failure("CircuitFilesNotFound") return failure("CircuitFilesNotFound")
# Unexpected: value of backend does not survive leaving each scope. (definition does though...) # Unexpected: value of backend does not survive leaving each scope. (definition does though...)
return success(backend) return success(backend)