diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index cd86a5c596..28d9c39c4f 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -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 🚨🚨 diff --git a/cmd/livepeer/livepeer.go b/cmd/livepeer/livepeer.go index 0bf119b7bb..70922549c5 100755 --- a/cmd/livepeer/livepeer.go +++ b/cmd/livepeer/livepeer.go @@ -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") diff --git a/cmd/livepeer/starter/starter.go b/cmd/livepeer/starter/starter.go index 1053506bda..384d89edf0 100755 --- a/cmd/livepeer/starter/starter.go +++ b/cmd/livepeer/starter/starter.go @@ -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) } @@ -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 {