Skip to content

Commit

Permalink
feat: bifrost cli improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Stewart <[email protected]>
  • Loading branch information
paralin committed Jan 23, 2024
1 parent da692a4 commit 05b4ff8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

END OF TERMS AND CONDITIONS

Copyright (c) 2018-2023 Aperture Robotics, LLC.
Copyright (c) 2018-2024 Aperture Robotics, LLC.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 0 additions & 1 deletion cli/daemonflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func (a *DaemonArgs) BuildFlags() []cli.Flag {
Name: "pubsub",
Usage: buildPubsubUsage(),
EnvVars: []string{"BIFROST_PUBSUB"},
Value: "floodsub",
Destination: &a.Pubsub,
},
}
Expand Down
5 changes: 2 additions & 3 deletions cmd/bifrost/bifrost_daemon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ hold-open:
config: {}

pubsub:
id: bifrost/nats
config:
peerId: any
id: bifrost/floodsub
config: {}

udp:
id: bifrost/udp
Expand Down
7 changes: 4 additions & 3 deletions cmd/bifrost/cmd_daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ func runDaemon(c *cli.Context) error {
}
}

// Apply factories
daemonFlags.ApplyFactories(b, sr)

// Daemon API
if daemonFlags.APIListen != "" {
_, _, apiRef, err := loader.WaitExecControllerRunning(
Expand Down Expand Up @@ -182,9 +185,7 @@ func runDaemon(c *cli.Context) error {
}
defer csRef.Release()

// TODO: Load these from CLI/yaml configuration.
// For now, hardcode it.
daemonFlags.ApplyFactories(b, sr)
// Load config sets and factories
if err := daemonFlags.ApplyToConfigSet(confSet, true); err != nil {
return err
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/bifrost/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ func main() {
app.Usage = "command-line node and tools for bifrost"
app.Commands = commands

// Metadata
app.Description = "Check out the docs and examples:\n\nhttps://github.com/aperturerobotics/bifrost"
app.Copyright = "Apache License, Version 2.0."

// Hide version if unset
if version == "" {
app.HideVersion = true
} else {
Expand Down
2 changes: 0 additions & 2 deletions daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/aperturerobotics/bifrost/keypem"
"github.com/aperturerobotics/bifrost/peer"
nctr "github.com/aperturerobotics/bifrost/peer/controller"
nats_controller "github.com/aperturerobotics/bifrost/pubsub/nats/controller"
"github.com/aperturerobotics/controllerbus/bus"
"github.com/aperturerobotics/controllerbus/controller"
"github.com/aperturerobotics/controllerbus/controller/loader"
Expand Down Expand Up @@ -66,7 +65,6 @@ func NewDaemon(
}

sr.AddFactory(api_controller.NewFactory(b))
sr.AddFactory(nats_controller.NewFactory(b))
for _, ctor := range opts.ExtraControllerFactories {
if ctor != nil {
sr.AddFactory(ctor(b))
Expand Down

0 comments on commit 05b4ff8

Please sign in to comment.