Skip to content

Commit bc638b4

Browse files
eliteproxrickstaa
authored andcommitted
refactor: add -gateway and deprecate -broadcaster
This commit adds the `gateway` flag and deprecates the `broadcaster` flag per core team decision (details: https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).
1 parent 7599f7f commit bc638b4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

cmd/livepeer/livepeer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ func parseLivepeerConfig() starter.LivepeerConfig {
140140
// Transcoding:
141141
cfg.Orchestrator = flag.Bool("orchestrator", *cfg.Orchestrator, "Set to true to be an orchestrator")
142142
cfg.Transcoder = flag.Bool("transcoder", *cfg.Transcoder, "Set to true to be a transcoder")
143-
cfg.Broadcaster = flag.Bool("broadcaster", *cfg.Broadcaster, "Set to true to be a broadcaster")
143+
cfg.Gateway = flag.Bool("gateway", *cfg.Broadcaster, "Set to true to be a gateway")
144+
cfg.Broadcaster = flag.Bool("broadcaster", *cfg.Broadcaster, "Set to true to be a broadcaster (**Deprecated**, use -gateway)")
144145
cfg.OrchSecret = flag.String("orchSecret", *cfg.OrchSecret, "Shared secret with the orchestrator as a standalone transcoder or path to file")
145146
cfg.TranscodingOptions = flag.String("transcodingOptions", *cfg.TranscodingOptions, "Transcoding options for broadcast job, or path to json config")
146147
cfg.MaxAttempts = flag.Int("maxAttempts", *cfg.MaxAttempts, "Maximum transcode attempts")

cmd/livepeer/starter/starter.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ type LivepeerConfig struct {
8787
HttpIngest *bool
8888
Orchestrator *bool
8989
Transcoder *bool
90+
Gateway *bool
9091
Broadcaster *bool
9192
OrchSecret *string
9293
TranscodingOptions *string
@@ -164,6 +165,7 @@ func DefaultLivepeerConfig() LivepeerConfig {
164165
defaultOrchestrator := false
165166
defaultTranscoder := false
166167
defaultBroadcaster := false
168+
defaultGateway := false
167169
defaultOrchSecret := ""
168170
defaultTranscodingOptions := "P240p30fps16x9,P360p30fps16x9"
169171
defaultMaxAttempts := 3
@@ -250,6 +252,7 @@ func DefaultLivepeerConfig() LivepeerConfig {
250252
// Transcoding:
251253
Orchestrator: &defaultOrchestrator,
252254
Transcoder: &defaultTranscoder,
255+
Gateway: &defaultGateway,
253256
Broadcaster: &defaultBroadcaster,
254257
OrchSecret: &defaultOrchSecret,
255258
TranscodingOptions: &defaultTranscodingOptions,
@@ -501,6 +504,9 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
501504
n.NodeType = core.TranscoderNode
502505
} else if *cfg.Broadcaster {
503506
n.NodeType = core.BroadcasterNode
507+
glog.Warning("-broadcaster flag is deprecated and will be removed in a future release. Please use -gateway instead")
508+
} else if *cfg.Gateway {
509+
n.NodeType = core.BroadcasterNode
504510
} else if (cfg.Reward == nil || !*cfg.Reward) && !*cfg.InitializeRound {
505511
exit("No services enabled; must be at least one of -broadcaster, -transcoder, -orchestrator, -redeemer, -reward or -initializeRound")
506512
}
@@ -1273,7 +1279,7 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
12731279
case core.OrchestratorNode:
12741280
glog.Infof("***Livepeer Running in Orchestrator Mode***")
12751281
case core.BroadcasterNode:
1276-
glog.Infof("***Livepeer Running in Broadcaster Mode***")
1282+
glog.Infof("***Livepeer Running in Gateway Mode***")
12771283
glog.Infof("Video Ingest Endpoint - rtmp://%v", *cfg.RtmpAddr)
12781284
case core.TranscoderNode:
12791285
glog.Infof("**Liveepeer Running in Transcoder Mode***")

0 commit comments

Comments
 (0)