Skip to content

Commit

Permalink
refactor: rename internal references from Broadcaster to Gateway (#3060)
Browse files Browse the repository at this point in the history
* refactor: rename internal references from Broadcaster to Gateway

This commit updates internal references from 'Broadcaster' to 'Gateway'
in accordance with the core team’s decision. For more details, refer to
the discussion: [Discord
Link](https://discord.com/channels/423160867534929930/1051963444598943784/1210356864643109004).

* chore: update pending changelog
  • Loading branch information
rickstaa authored Jun 18, 2024
1 parent 0dd670f commit 20e81fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [#3055](https://github.com/livepeer/go-livepeer/pull/3055) census: Rename broadcaster metrics to gateway metrics
- [#3053](https://github.com/livepeer/go-livepeer/pull/3053) cli: add `-gateway` flag and deprecate `-broadcaster` flag.
- [#3056](https://github.com/livepeer/go-livepeer/pull/3056) cli: add `-pricePerGateway` flag and deprecate `-pricePerBroadcaster` flag.
- [#3060](https://github.com/livepeer/go-livepeer/pull/3060) refactor: rename internal references from Broadcaster to Gateway

### Breaking Changes 🚨🚨

Expand Down
2 changes: 1 addition & 1 deletion cmd/livepeer/livepeer.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func parseLivepeerConfig() starter.LivepeerConfig {
cfg.PixelsPerUnit = flag.String("pixelsPerUnit", *cfg.PixelsPerUnit, "Amount of pixels per unit. Set to '> 1' to have smaller price granularity than 1 wei / pixel")
cfg.PriceFeedAddr = flag.String("priceFeedAddr", *cfg.PriceFeedAddr, "ETH address of the Chainlink price feed contract. Used for custom currencies conversion on -pricePerUnit or -maxPricePerUnit")
cfg.AutoAdjustPrice = flag.Bool("autoAdjustPrice", *cfg.AutoAdjustPrice, "Enable/disable automatic price adjustments based on the overhead for redeeming tickets")
cfg.PricePerGateway = flag.String("pricePerGateway", *cfg.PricePerGateway, `json list of price per gateway or path to json config file. Example: {"broadcasters":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1000000000000},{"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":1000000000000}]}`)
cfg.PricePerGateway = flag.String("pricePerGateway", *cfg.PricePerGateway, `json list of price per gateway or path to json config file. Example: {"gateways":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1000000000000},{"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":1000000000000}]}`)
cfg.PricePerBroadcaster = flag.String("pricePerBroadcaster", *cfg.PricePerBroadcaster, `json list of price per broadcaster or path to json config file. Example: {"broadcasters":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1000000000000},{"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":1000000000000}]}`)
// Interval to poll for blocks
cfg.BlockPollingInterval = flag.Int("blockPollingInterval", *cfg.BlockPollingInterval, "Interval in seconds at which different blockchain event services poll for blocks")
Expand Down
10 changes: 5 additions & 5 deletions cmd/livepeer/starter/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -791,15 +791,15 @@ func StartLivepeer(ctx context.Context, cfg LivepeerConfig) {
glog.Warning("-PricePerBroadcaster flag is deprecated and will be removed in a future release. Please use -PricePerGateway instead")
cfg.PricePerGateway = cfg.PricePerBroadcaster
}
broadcasterPrices := getGatewayPrices(*cfg.PricePerGateway)
for _, p := range broadcasterPrices {
gatewayPrices := getGatewayPrices(*cfg.PricePerGateway)
for _, p := range gatewayPrices {
p := p
pricePerPixel := new(big.Rat).Quo(p.PricePerUnit, p.PixelsPerUnit)
autoPrice, err := core.NewAutoConvertedPrice(p.Currency, pricePerPixel, func(price *big.Rat) {
glog.Infof("Price: %v wei per pixel for broadcaster %v", price.FloatString(3), p.EthAddress)
glog.Infof("Price: %v wei per pixel for gateway %v", price.FloatString(3), p.EthAddress)
})
if err != nil {
panic(fmt.Errorf("Error converting price for broadcaster %s: %v", p.EthAddress, err))
panic(fmt.Errorf("Error converting price for gateway %s: %v", p.EthAddress, err))
}
n.SetBasePrice(p.EthAddress, autoPrice)
}
Expand Down Expand Up @@ -1501,7 +1501,7 @@ func getGatewayPrices(gatewayPrices string) []GatewayPrice {
return nil
}

// Format of broadcasterPrices json
// Format of gatewayPrices json
// {"gateways":[{"ethaddress":"address1","priceperunit":0.5,"currency":"USD","pixelsperunit":1}, {"ethaddress":"address2","priceperunit":0.3,"currency":"USD","pixelsperunit":3}]}
var pricesSet struct {
Gateways []struct {
Expand Down

0 comments on commit 20e81fb

Please sign in to comment.