Skip to content

Commit

Permalink
Merge branch 'master' into RestLightPush
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-98 authored Oct 23, 2023
2 parents 40e7409 + 9161c4f commit 6956840
Show file tree
Hide file tree
Showing 54 changed files with 1,803 additions and 569 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @richard-ramos @chaitanyaprem
7 changes: 7 additions & 0 deletions cmd/waku/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ var (
Destination: &options.KeyPasswd,
EnvVars: []string{"WAKUNODE2_KEY_PASSWORD"},
})
ClusterID = altsrc.NewUintFlag(&cli.UintFlag{
Name: "cluster-id",
Value: 0,
Usage: "Cluster id that the node is running in. Node in a different cluster id is disconnected.",
Destination: &options.ClusterID,
EnvVars: []string{"WAKUNODE2_CLUSTER_ID"},
})
StaticNode = cliutils.NewGenericFlagMultiValue(&cli.GenericFlag{
Name: "staticnode",
Usage: "Multiaddr of peer to directly connect with. Option may be repeated",
Expand Down
14 changes: 13 additions & 1 deletion cmd/waku/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"github.com/waku-org/go-waku/cmd/waku/keygen"
"github.com/waku-org/go-waku/cmd/waku/rlngenerate"
"github.com/waku-org/go-waku/waku/v2/node"
"github.com/waku-org/go-waku/waku/v2/utils"
"go.uber.org/zap"
)

var options NodeOptions
Expand All @@ -34,6 +36,7 @@ func main() {
NodeKey,
KeyFile,
KeyPassword,
ClusterID,
StaticNode,
KeepAlive,
PersistPeers,
Expand Down Expand Up @@ -113,7 +116,16 @@ func main() {
Before: altsrc.InitInputSourceWithContext(cliFlags, altsrc.NewTomlSourceFromFlagFunc("config-file")),
Flags: cliFlags,
Action: func(c *cli.Context) error {
Execute(options)
err := Execute(options)
if err != nil {
utils.Logger().Error("failure while executing wakunode", zap.Error(err))
switch e := err.(type) {
case cli.ExitCoder:
return e
case error:
return cli.Exit(err.Error(), 1)
}
}
return nil
},
Commands: []*cli.Command{
Expand Down
Loading

0 comments on commit 6956840

Please sign in to comment.