diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index a7600f8fc9..bcd91dc3e3 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -6,6 +6,8 @@ #### General +- \#1848 Use fee cut instead of fee share for user facing language in the CLI (@kyriediculous) + #### Broadcaster #### Orchestrator diff --git a/cmd/livepeer_cli/wizard_bond.go b/cmd/livepeer_cli/wizard_bond.go index 3bc276a78b..dcb7938aac 100644 --- a/cmd/livepeer_cli/wizard_bond.go +++ b/cmd/livepeer_cli/wizard_bond.go @@ -34,8 +34,7 @@ func (w *wizard) registeredOrchestratorStats() map[int]common.Address { fmt.Println("+------------------------+") table := tablewriter.NewWriter(os.Stdout) - table.SetHeader([]string{"ID", "Address", "Active", "Delegated Stake", "Reward Cut (%)", "Fee Share (%)", "Service URI", "Price Per Pixel"}) - + table.SetHeader([]string{"ID", "Address", "Active", "Delegated Stake", "Reward Cut (%)", "Fee Cut (%)", "Service URI", "Price Per Pixel"}) for _, t := range orchestrators { table.Append([]string{ strconv.FormatInt(int64(nextId), 10), @@ -43,7 +42,7 @@ func (w *wizard) registeredOrchestratorStats() map[int]common.Address { strconv.FormatBool(t.Active), eth.FormatUnits(t.DelegatedStake, "LPT"), eth.FormatPerc(t.RewardCut), - eth.FormatPerc(t.FeeShare), + feeShareToFeeCutString(t.FeeShare), t.ServiceURI, t.PricePerPixel.FloatString(3), }) diff --git a/cmd/livepeer_cli/wizard_stats.go b/cmd/livepeer_cli/wizard_stats.go index 05829cb0da..cc8075f842 100644 --- a/cmd/livepeer_cli/wizard_stats.go +++ b/cmd/livepeer_cli/wizard_stats.go @@ -205,7 +205,7 @@ func (w *wizard) orchestratorStats() { {"Service URI", t.ServiceURI}, {"Delegated Stake", eth.FormatUnits(t.DelegatedStake, "LPT")}, {"Reward Cut (%)", eth.FormatPerc(t.RewardCut)}, - {"Fee Share (%)", eth.FormatPerc(t.FeeShare)}, + {"Fee Cut (%)", feeShareToFeeCutString(t.FeeShare)}, {"Last Reward Round", t.LastRewardRound.String()}, {"Base price per pixel", fmt.Sprintf("%v wei / %v pixels", priceInfo.Num(), priceInfo.Denom())}, } diff --git a/cmd/livepeer_cli/wizard_transcoder.go b/cmd/livepeer_cli/wizard_transcoder.go index 892c8e513d..3200d75137 100644 --- a/cmd/livepeer_cli/wizard_transcoder.go +++ b/cmd/livepeer_cli/wizard_transcoder.go @@ -18,6 +18,11 @@ import ( const defaultRPCPort = "8935" +const defaultRewardCut = float64(10) +const defaultFeeCut = float64(95) + +const HUNDRED_PERCENT = float64(100) + func (w *wizard) isOrchestrator() bool { isT := httpGet(fmt.Sprintf("http://%v:%v/IsOrchestrator", w.host, w.httpPort)) return isT == "true" @@ -41,7 +46,7 @@ func (w *wizard) promptOrchestratorConfig() (float64, float64, int, int, string) orch, _, err := w.getOrchestratorInfo() if err != nil || orch == nil { - fmt.Println("unable to get current reward cut and fee share") + fmt.Println("unable to get current reward cut and fee cut") blockRewardCut = 0 feeShare = 0 } else { @@ -49,11 +54,13 @@ func (w *wizard) promptOrchestratorConfig() (float64, float64, int, int, string) feeShare = eth.ToPerc(orch.FeeShare) } - fmt.Printf("Enter block reward cut percentage (current=%v default=10) - ", blockRewardCut) + feeCut := HUNDRED_PERCENT - feeShare + + fmt.Printf("Enter block reward cut percentage (current=%v default=%v) - ", blockRewardCut, defaultRewardCut) blockRewardCut = w.readDefaultFloat(blockRewardCut) - fmt.Printf("Enter fee share percentage (current=%v default=5) - ", feeShare) - feeShare = w.readDefaultFloat(feeShare) + fmt.Printf("Enter fee cut percentage (current=%v default=%v) - ", feeCut, defaultFeeCut) + feeCut = w.readDefaultFloat(feeCut) fmt.Println("Enter a transcoding base price in wei per pixels") fmt.Println("eg. 1 wei / 10 pixels = 0,1 wei per pixel") @@ -268,3 +275,7 @@ func (w *wizard) showVoteChoices() { } wtr.Flush() } + +func feeShareToFeeCutString(feeShare *big.Int) string { + return eth.FormatPerc(new(big.Int).Sub(eth.FromPerc(HUNDRED_PERCENT), feeShare)) +}