diff --git a/codexcrawler/installer.nim b/codexcrawler/installer.nim index 5e3738e..42153bd 100644 --- a/codexcrawler/installer.nim +++ b/codexcrawler/installer.nim @@ -18,7 +18,7 @@ import ./components/todolist proc createComponents*(state: State): Future[?!seq[Component]] {.async.} = var components: seq[Component] = newSeq[Component]() - aaa() + await aaa(state.config) let clock = createClock() diff --git a/codexcrawler/services/marketplace.nim b/codexcrawler/services/marketplace.nim index 44197a7..4872ffe 100644 --- a/codexcrawler/services/marketplace.nim +++ b/codexcrawler/services/marketplace.nim @@ -1,4 +1,30 @@ -import ./marketplace/market +import pkg/ethers +import pkg/questionable -proc aaa*() = +import ./marketplace/market +import ./marketplace/marketplace +import ../config + +proc aaa*(config: Config) {.async.} = echo "aaa" + + let provider = JsonRpcProvider.new(config.ethProvider) + without marketplaceAddress =? Address.init(config.marketplaceAddress): + raiseAssert("A!") + + let marketplace = Marketplace.new(marketplaceAddress, provider) + let market = OnChainMarket.new(marketplace) + + echo "bbb" + echo "running with marketplace address: " & $marketplaceAddress + + try: + without zkeyhash =? await market.getZkeyHash(): + echo "couldn't get zkeyhash" + return + echo "zkeyhash=" & $zkeyhash + + except CatchableError as err: + echo "catchable error! " & err.msg + + echo "ccc"