fix chat2 compilation

This commit is contained in:
fryorcraken 2025-04-12 10:46:45 +10:00
parent 708bb7214d
commit 67ee374c2e
3 changed files with 27 additions and 9 deletions

View File

@ -553,14 +553,19 @@ proc processInput(rfd: AsyncFD, rng: ref HmacDrbgContext) {.async.} =
echo "rln-relay preparation is in progress..."
let rlnConf = WakuRlnConfig(
rlnRelayDynamic: conf.rlnRelayDynamic,
rlnRelayCredIndex: conf.rlnRelayCredIndex,
rlnRelayEthContractAddress: conf.rlnRelayEthContractAddress,
rlnRelayEthClientAddress: string(conf.rlnRelayethClientAddress),
rlnRelayCredPath: conf.rlnRelayCredPath,
rlnRelayCredPassword: conf.rlnRelayCredPassword,
rlnRelayUserMessageLimit: conf.rlnRelayUserMessageLimit,
rlnEpochSizeSec: conf.rlnEpochSizeSec,
dynamic: conf.rlnRelayDynamic,
credIndex: conf.rlnRelayCredIndex,
chainId: conf.rlnRelayChainId,
ethContractAddress: conf.rlnRelayEthContractAddress,
ethClientAddress: string(conf.rlnRelayethClientAddress),
creds: some(
RlnRelayCreds(
path: conf.rlnRelayCredPath, password: conf.rlnRelayCredPassword
)
),
userMessageLimit: conf.rlnRelayUserMessageLimit,
epochSizeSec: conf.rlnEpochSizeSec,
treePath: conf.rlnRelayTreePath,
)
waitFor node.mountRlnRelay(rlnConf, spamHandler = some(spamHandler))

View File

@ -213,6 +213,13 @@ type
name: "rln-relay"
.}: bool
rlnRelayChainId* {.
desc:
"Chain ID of the provided contract (optional, will fetch from RPC provider if not used)",
defaultValue: 0,
name: "rln-relay-chain-id"
.}: uint
rlnRelayCredPath* {.
desc: "The path for peristing rln-relay credential",
defaultValue: "",
@ -273,6 +280,12 @@ type
name: "rln-relay-epoch-sec"
.}: uint64
rlnRelayTreePath* {.
desc: "Path to the RLN merkle tree sled db (https://github.com/spacejam/sled)",
defaultValue: "",
name: "rln-relay-tree-path"
.}: string
# NOTE: Keys are different in nim-libp2p
proc parseCmdArg*(T: type crypto.PrivateKey, p: string): T =
try:

View File

@ -47,7 +47,7 @@ type RlnRelayConf* {.requiresInit.} = object of RootObj
epochSizeSec*: uint64
userMessageLimit*: uint64
type WakuRlnConfig* {.requiresInit.} = object of RlnRelayConf
type WakuRlnConfig* = object of RlnRelayConf
onFatalErrorAction*: OnFatalErrorHandler
proc createMembershipList*(