From 23c170ce46a003e99b72a996b55d56ab7d3ad67d Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 29 Jan 2024 14:58:56 -0600 Subject: [PATCH] init node --- codex/codex.nim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/codex/codex.nim b/codex/codex.nim index ab8b7eb3..d5c6d58b 100644 --- a/codex/codex.nim +++ b/codex/codex.nim @@ -28,6 +28,7 @@ import ./conf import ./rng import ./rest/api import ./stores +import ./slots import ./blockexchange import ./utils/fileutils import ./erasure @@ -262,7 +263,14 @@ proc new*( engine = BlockExcEngine.new(repoStore, wallet, network, blockDiscovery, peerStore, pendingBlocks) store = NetworkStore.new(engine, repoStore) erasure = Erasure.new(store, leoEncoderProvider, leoDecoderProvider) - codexNode = CodexNodeRef.new(switch, store, engine, erasure, discovery) + prover = if config.persistence: + circomBackend = CircomCompat.init(config.circomR1cs, config.circomWasm, config.circomZkey) + some Prover.new(store, circomBackend) + else: + none Prover + + codexNode = CodexNodeRef.new(switch, store, engine, erasure, prover, discovery) + restServer = RestServerRef.new( codexNode.initRestApi(config, repoStore), initTAddress(config.apiBindAddress , config.apiPort),