Skip to content

Commit

Permalink
Adapt cli code to node->host PKA
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielseibel1 committed Sep 19, 2023
1 parent 10c3416 commit 6d4c14c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions cli/cmd/host/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var (
mtu int
isStatic bool
isDefault bool
keepAlive int
)

var hostUpdateCmd = &cobra.Command{
Expand All @@ -43,6 +44,7 @@ var hostUpdateCmd = &cobra.Command{
apiHost.MTU = mtu
apiHost.IsStatic = isStatic
apiHost.IsDefault = isDefault
apiHost.PersistentKeepalive = int32(keepAlive)
}
functions.PrettyPrint(functions.UpdateHost(args[0], apiHost))
},
Expand All @@ -54,6 +56,7 @@ func init() {
hostUpdateCmd.Flags().StringVar(&name, "name", "", "Host name")
hostUpdateCmd.Flags().IntVar(&listenPort, "listen_port", 0, "Listen port of the host")
hostUpdateCmd.Flags().IntVar(&mtu, "mtu", 0, "Host MTU size")
hostUpdateCmd.Flags().IntVar(&keepAlive, "keep_alive", 0, "Interval in which packets are sent to keep connections open with peers")
hostUpdateCmd.Flags().BoolVar(&isStatic, "static", false, "Make Host Static ?")
hostUpdateCmd.Flags().BoolVar(&isDefault, "default", false, "Make Host Default ?")
rootCmd.AddCommand(hostUpdateCmd)
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/node/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var (
name string
postUp string
postDown string
keepAlive int
relayedNodes string
egressGatewayRanges string
expirationDateTime int
Expand Down
2 changes: 0 additions & 2 deletions cli/cmd/node/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var nodeUpdateCmd = &cobra.Command{
node.Address = address
node.Address6 = address6
node.LocalAddress = localAddress
node.PersistentKeepalive = int32(keepAlive)
if relayedNodes != "" {
node.RelayedNodes = strings.Split(relayedNodes, ",")
}
Expand All @@ -61,7 +60,6 @@ func init() {
nodeUpdateCmd.Flags().StringVar(&name, "name", "", "Node name")
nodeUpdateCmd.Flags().StringVar(&postUp, "post_up", "", "Commands to run after node is up `;` separated")
nodeUpdateCmd.Flags().StringVar(&postDown, "post_down", "", "Commands to run after node is down `;` separated")
nodeUpdateCmd.Flags().IntVar(&keepAlive, "keep_alive", 0, "Interval in which packets are sent to keep connections open with peers")
nodeUpdateCmd.Flags().StringVar(&relayedNodes, "relayed_nodes", "", "relayed nodes if node acts as a relay")
nodeUpdateCmd.Flags().StringVar(&egressGatewayRanges, "egress_addrs", "", "Addresses for egressing traffic if node acts as an egress")
nodeUpdateCmd.Flags().IntVar(&expirationDateTime, "expiry", 0, "UNIX timestamp after which node will lose access to the network")
Expand Down

0 comments on commit 6d4c14c

Please sign in to comment.