diff --git a/waku/v2/node/wakunode2.nim b/waku/v2/node/wakunode2.nim index b8425f913..34ea8dfe8 100644 --- a/waku/v2/node/wakunode2.nim +++ b/waku/v2/node/wakunode2.nim @@ -31,7 +31,10 @@ export waku_rln_relay_types when defined(rln): - import ../protocol/waku_rln_relay/[rln, waku_rln_relay_utils] + import + libp2p/protocols/pubsub/rpc/messages, + web3, + ../protocol/waku_rln_relay/[rln, waku_rln_relay_utils] declarePublicCounter waku_node_messages, "number of messages received", ["type"] declarePublicGauge waku_node_filters, "number of content filter subscriptions" @@ -462,6 +465,7 @@ when defined(rln): node.wakuRlnRelay = rlnPeer when defined(rln): + proc addRLNRelayValidator*(node: WakuNode, pubsubTopic: string) = ## this procedure is a thin wrapper for the pubsub addValidator method ## it sets message validator on the given pubsubTopic, the validator will check that diff --git a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim index b54d6bae7..810e3eea0 100644 --- a/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim +++ b/waku/v2/protocol/waku_rln_relay/waku_rln_relay_utils.nim @@ -15,7 +15,9 @@ contract(MembershipContract): # TODO define a return type of bool for register method to signify a successful registration proc register(pubkey: Uint256) # external payable -proc createRLNInstance*(d: int, ctxPtr: var ptr RLN[Bn256]): bool = +proc createRLNInstance*(d: int, ctxPtr: var ptr RLN[Bn256]): bool + {.raises: [Defect, IOError].} = + ## generates an instance of RLN ## An RLN instance supports both zkSNARKs logics and Merkle tree data structure and operations ## d indicates the depth of Merkle tree