Refactor livepeer.go to enable running Livepeer node from the code#2351
Merged
leszko merged 2 commits intolivepeer:masterfrom Apr 8, 2022
Merged
Refactor livepeer.go to enable running Livepeer node from the code#2351leszko merged 2 commits intolivepeer:masterfrom
leszko merged 2 commits intolivepeer:masterfrom
Conversation
thomshutt
approved these changes
Apr 6, 2022
Contributor
thomshutt
left a comment
There was a problem hiding this comment.
Looks good, I like the ideas for future steps too
|
|
||
| // updateNilsForUnsetFlags changes some cfg fields to nil if they were not explicitly set with flags. | ||
| // For some flags, the behavior is different whether the value is default or not set by the user at all. | ||
| func updateNilsForUnsetFlags(cfg LivepeerConfig) LivepeerConfig { |
Contributor
There was a problem hiding this comment.
👍 I've always found it annoying that the Go flags package doesn't give a way to distinguish between zero value / not set, but good to at least do it all in one place
e64df90 to
d45905f
Compare
ad-astra-video
pushed a commit
to ad-astra-video/go-livepeer
that referenced
this pull request
May 25, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this pull request do? Explain your changes. (required)
Refactor
livepeer.goto allow running Livepeer node from the code. After this change, you can start Livepeer node from the code (without passing any flags) in the following manner.The context for this change is the work on implementing E2E Testing which would cover interactions with the chain. Additionally, I believe it's a way better code structure when we split the configuration and the flags parsing.
Some ideas for future improvements (not included in this PR):
main()to extract it into functions likeparseOrchAddrs()Specific updates (required)
LivepeerConfigtype and theDefaultLivepeerConfig()functionLivepeerConfigLivepeerConfiginstead of using theisFlagSetmapparseOrchAddrs()functionHow did you test each of these updates (required)
Started Livepeer on-chain and off-chain and played with transcoding and CLI interactions.
Does this pull request close any open issues?
No, but it's related to #2317
Checklist:
makeruns successfully./test.shpassREADME and other documentation updated