go-waku/cmd/waku/main.go

125 lines
2.3 KiB
Go
Raw Normal View History

2022-11-26 15:57:11 +00:00
package main
import (
"os"
2023-01-11 15:58:49 +00:00
cli "github.com/urfave/cli/v2"
"github.com/urfave/cli/v2/altsrc"
"github.com/waku-org/go-waku/cmd/waku/keygen"
2022-11-26 15:57:11 +00:00
"github.com/waku-org/go-waku/waku/v2/node"
)
var options NodeOptions
2022-11-26 15:57:11 +00:00
func main() {
// Defaults
options.LogLevel = "INFO"
options.LogEncoding = "console"
cliFlags := []cli.Flag{
2023-01-11 15:58:49 +00:00
&cli.StringFlag{Name: "config-file", Usage: "loads configuration from a TOML file (cmd-line parameters take precedence)"},
TcpPort,
Address,
MaxPeerConnections,
WebsocketSupport,
WebsocketPort,
WebsocketSecurePort,
WebsocketAddress,
WebsocketSecureSupport,
WebsocketSecureKeyPath,
WebsocketSecureCertPath,
2023-07-06 21:40:57 +00:00
DNS4DomainName,
NodeKey,
KeyFile,
KeyPassword,
StaticNode,
KeepAlive,
PersistPeers,
NAT,
2023-05-08 15:19:44 +00:00
IPAddress,
ExtMultiaddresses,
ShowAddresses,
CircuitRelay,
2023-05-24 15:34:35 +00:00
ResourceScalingMemoryPercent,
ResourceScalingFDPercent,
LogLevel,
LogEncoding,
LogOutput,
AgentString,
Relay,
Topics,
ProtectedTopics,
RelayPeerExchange,
MinRelayPeersToPublish,
StoreNodeFlag,
StoreFlag,
2022-12-09 19:26:24 +00:00
StoreMessageDBURL,
StoreMessageRetentionTime,
StoreMessageRetentionCapacity,
StoreMessageDBVacuum,
StoreMessageDBMigration,
StoreResumePeer,
FilterFlag,
FilterNode,
FilterTimeout,
FilterLegacyFlag,
FilterLegacyNode,
FilterLegacyLightClient,
LightPush,
LightPushNode,
Discv5Discovery,
Discv5BootstrapNode,
Discv5UDPPort,
Discv5ENRAutoUpdate,
PeerExchange,
PeerExchangeNode,
DNSDiscovery,
DNSDiscoveryUrl,
DNSDiscoveryNameServer,
2023-03-09 15:48:25 +00:00
Rendezvous,
RendezvousNode,
2023-03-09 22:42:50 +00:00
RendezvousServer,
MetricsServer,
MetricsServerAddress,
MetricsServerPort,
RPCFlag,
RPCPort,
RPCAddress,
RPCRelayCacheCapacity,
RPCAdmin,
RESTFlag,
RESTAddress,
RESTPort,
RESTRelayCacheCapacity,
RESTAdmin,
PProf,
2022-11-26 15:57:11 +00:00
}
rlnFlags := rlnFlags()
cliFlags = append(cliFlags, rlnFlags...)
cli.VersionFlag = &cli.BoolFlag{
Name: "version",
Usage: "prints the version",
}
app := &cli.App{
Name: "gowaku",
Version: node.GetVersionInfo().String(),
2023-01-11 15:58:49 +00:00
Before: altsrc.InitInputSourceWithContext(cliFlags, altsrc.NewTomlSourceFromFlagFunc("config-file")),
2022-11-26 15:57:11 +00:00
Flags: cliFlags,
Action: func(c *cli.Context) error {
2023-07-06 21:40:57 +00:00
Execute(options)
2022-11-26 15:57:11 +00:00
return nil
},
Commands: []*cli.Command{
&keygen.Command,
},
2022-11-26 15:57:11 +00:00
}
err := app.Run(os.Args)
if err != nil {
panic(err)
}
}