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