2022-11-26 15:57:11 +00:00
|
|
|
//go:build gowaku_rln
|
|
|
|
// +build gowaku_rln
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2023-01-11 15:58:49 +00:00
|
|
|
cli "github.com/urfave/cli/v2"
|
2022-11-26 15:57:11 +00:00
|
|
|
wcli "github.com/waku-org/go-waku/waku/cliutils"
|
|
|
|
)
|
|
|
|
|
|
|
|
func rlnFlags() []cli.Flag {
|
|
|
|
return []cli.Flag{
|
|
|
|
&cli.BoolFlag{
|
|
|
|
Name: "rln-relay",
|
|
|
|
Value: false,
|
|
|
|
Usage: "Enable spam protection through rln-relay",
|
|
|
|
Destination: &options.RLNRelay.Enable,
|
|
|
|
},
|
2023-08-01 18:15:01 +00:00
|
|
|
&cli.UintFlag{
|
2023-07-27 19:51:31 +00:00
|
|
|
Name: "rln-relay-membership-group-index",
|
2022-11-26 15:57:11 +00:00
|
|
|
Value: 0,
|
2023-07-27 19:51:31 +00:00
|
|
|
Usage: "the index of credentials to use, within a specific rln membership set",
|
|
|
|
Destination: &options.RLNRelay.MembershipGroupIndex,
|
2022-11-26 15:57:11 +00:00
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "rln-relay-pubsub-topic",
|
|
|
|
Value: "/waku/2/default-waku/proto",
|
|
|
|
Usage: "the pubsub topic for which rln-relay gets enabled",
|
|
|
|
Destination: &options.RLNRelay.PubsubTopic,
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "rln-relay-content-topic",
|
|
|
|
Value: "/toy-chat/2/luzhou/proto",
|
|
|
|
Usage: "the content topic for which rln-relay gets enabled",
|
|
|
|
Destination: &options.RLNRelay.ContentTopic,
|
|
|
|
},
|
|
|
|
&cli.BoolFlag{
|
|
|
|
Name: "rln-relay-dynamic",
|
|
|
|
Usage: "Enable waku-rln-relay with on-chain dynamic group management",
|
|
|
|
Destination: &options.RLNRelay.Dynamic,
|
|
|
|
},
|
|
|
|
&cli.PathFlag{
|
|
|
|
Name: "rln-relay-cred-path",
|
|
|
|
Usage: "RLN relay membership credentials file",
|
|
|
|
Value: "",
|
|
|
|
Destination: &options.RLNRelay.CredentialsPath,
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "rln-relay-cred-password",
|
|
|
|
Value: "",
|
|
|
|
Usage: "Password for encrypting RLN credentials",
|
|
|
|
Destination: &options.RLNRelay.CredentialsPassword,
|
|
|
|
},
|
2023-08-01 18:15:01 +00:00
|
|
|
&cli.UintFlag{
|
2023-07-27 19:51:31 +00:00
|
|
|
Name: "rln-relay-membership-index",
|
|
|
|
Value: 0,
|
|
|
|
Usage: "the index of credentials to use",
|
|
|
|
Destination: &options.RLNRelay.CredentialsIndex,
|
|
|
|
},
|
2022-11-26 15:57:11 +00:00
|
|
|
// TODO: this is a good candidate option for subcommands
|
|
|
|
// TODO: consider accepting a private key file and passwd
|
|
|
|
&cli.GenericFlag{
|
|
|
|
Name: "rln-relay-eth-account-private-key",
|
|
|
|
Usage: "Ethereum account private key used for registering in member contract",
|
|
|
|
Value: &wcli.PrivateKeyValue{
|
|
|
|
Value: &options.RLNRelay.ETHPrivateKey,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
&cli.StringFlag{
|
|
|
|
Name: "rln-relay-eth-client-address",
|
|
|
|
Usage: "Ethereum testnet client address",
|
|
|
|
Value: "ws://localhost:8545",
|
|
|
|
Destination: &options.RLNRelay.ETHClientAddress,
|
|
|
|
},
|
|
|
|
&cli.GenericFlag{
|
|
|
|
Name: "rln-relay-eth-contract-address",
|
|
|
|
Usage: "Address of membership contract ",
|
|
|
|
Value: &wcli.AddressValue{
|
|
|
|
Value: &options.RLNRelay.MembershipContractAddress,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|