init node

This commit is contained in:
Dmitriy Ryajov 2024-01-29 14:58:56 -06:00
parent 6d514df503
commit 23c170ce46
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
1 changed files with 9 additions and 1 deletions

View File

@ -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),