Expose config and node via getters

This commit is contained in:
Arnaud 2025-09-16 15:44:53 +02:00
parent 1dc5a9dbf9
commit cd4ee2eef9
No known key found for this signature in database
GPG Key ID: B8FBC178F10CA7AE

View File

@ -51,7 +51,7 @@ logScope:
type type
CodexServer* = ref object CodexServer* = ref object
config*: CodexConf config: CodexConf
restServer: RestServerRef restServer: RestServerRef
codexNode: CodexNodeRef codexNode: CodexNodeRef
repoStore: RepoStore repoStore: RepoStore
@ -61,6 +61,12 @@ type
CodexPrivateKey* = libp2p.PrivateKey # alias CodexPrivateKey* = libp2p.PrivateKey # alias
EthWallet = ethers.Wallet EthWallet = ethers.Wallet
func config*(self: CodexServer): CodexConf =
return self.config
func node*(self: CodexServer): CodexNodeRef =
return self.codexNode
proc waitForSync(provider: Provider): Future[void] {.async.} = proc waitForSync(provider: Provider): Future[void] {.async.} =
var sleepTime = 1 var sleepTime = 1
trace "Checking sync state of Ethereum provider..." trace "Checking sync state of Ethereum provider..."