mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-15 09:26:38 +00:00
deploy: dbccecc5621256e8f69422d9b6a5539f0551eaa8
This commit is contained in:
parent
9e102a0c33
commit
80d8edfe45
@ -2,7 +2,7 @@
|
||||
|
||||
# libtool - Provide generalized library-building support services.
|
||||
# Generated automatically by config.status (libbacktrace) version-unused
|
||||
# Libtool was configured on host fv-az278-37:
|
||||
# Libtool was configured on host fv-az275-186:
|
||||
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
|
||||
#
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
|
||||
|
@ -37,6 +37,7 @@ export
|
||||
when defined(rln):
|
||||
import
|
||||
libp2p/protocols/pubsub/rpc/messages,
|
||||
libp2p/protocols/pubsub/pubsub,
|
||||
web3,
|
||||
../protocol/waku_rln_relay/[rln, waku_rln_relay_utils]
|
||||
|
||||
@ -463,7 +464,7 @@ when defined(rln):
|
||||
## this procedure is a thin wrapper for the pubsub addValidator method
|
||||
## it sets message validator on the given pubsubTopic, the validator will check that
|
||||
## all the messages published in the pubsubTopic have a valid zero-knowledge proof
|
||||
proc validator(topic: string, message: messages.Message): Future[ValidationResult] {.async.} =
|
||||
proc validator(topic: string, message: messages.Message): Future[pubsub.ValidationResult] {.async.} =
|
||||
let msg = WakuMessage.init(message.data)
|
||||
if msg.isOk():
|
||||
let
|
||||
@ -473,21 +474,21 @@ when defined(rln):
|
||||
case validationRes:
|
||||
of Valid:
|
||||
info "message validity is verified, relaying:", wakumessage=wakumessage
|
||||
return ValidationResult.Accept
|
||||
return pubsub.ValidationResult.Accept
|
||||
of Invalid:
|
||||
info "message validity could not be verified, discarding:", wakumessage=wakumessage
|
||||
return ValidationResult.Reject
|
||||
return pubsub.ValidationResult.Reject
|
||||
of Spam:
|
||||
info "A spam message is found! yay! discarding:", wakumessage=wakumessage
|
||||
return ValidationResult.Reject
|
||||
return pubsub.ValidationResult.Reject
|
||||
# set a validator for the supplied pubsubTopic
|
||||
let pb = PubSub(node.wakuRelay)
|
||||
pb.addValidator(pubsubTopic, validator)
|
||||
|
||||
proc mountRlnRelay*(node: WakuNode,
|
||||
ethClientAddrOpt: Option[string] = none(string),
|
||||
ethAccAddrOpt: Option[Address] = none(Address),
|
||||
memContractAddOpt: Option[Address] = none(Address),
|
||||
ethAccAddrOpt: Option[web3.Address] = none(web3.Address),
|
||||
memContractAddOpt: Option[web3.Address] = none(web3.Address),
|
||||
groupOpt: Option[seq[IDCommitment]] = none(seq[IDCommitment]),
|
||||
memKeyPairOpt: Option[MembershipKeyPair] = none(MembershipKeyPair),
|
||||
memIndexOpt: Option[MembershipIndex] = none(MembershipIndex),
|
||||
@ -528,8 +529,8 @@ when defined(rln):
|
||||
|
||||
var
|
||||
ethClientAddr: string
|
||||
ethAccAddr: Address
|
||||
memContractAdd: Address
|
||||
ethAccAddr: web3.Address
|
||||
memContractAdd: web3.Address
|
||||
if onchainMode:
|
||||
ethClientAddr = ethClientAddrOpt.get()
|
||||
ethAccAddr = ethAccAddrOpt.get()
|
||||
|
Loading…
x
Reference in New Issue
Block a user