Skip to content

Commit

Permalink
config: add ticket params, remove orchaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
iameli committed Mar 15, 2024
1 parent b89b22d commit 7fd9814
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/catalyst/catalyst.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ func main() {
fs.StringVar(&cli.EthURL, "eth-url", "", "HTTPS URL of an Ethereum RPC provider for your selected network")
fs.StringVar(&cli.EthKeystorePath, "eth-keystore-path", "/keystore", "Path to an Ethereum keystore")
fs.StringVar(&cli.EthPassword, "eth-password", "", "Ethereum password or path to password file")
fs.StringVar(&cli.MaxTicketEV, "max-ticket-ev", "50000000001", "The maximum acceptable expected value for one PM ticket")
fs.StringVar(&cli.MaxTotalEV, "max-total-ev", "20000000000000", "The maximum acceptable expected value for one PM payment")
fs.StringVar(&cli.MaxPricePerUnit, "max-price-per-unit", "700", "The maximum transcoding price (in wei) per 'pixelsPerUnit' a broadcaster is willing to accept. If not set explicitly, broadcaster is willing to accept ANY price")

ff.Parse(
fs, os.Args[1:],
Expand Down
8 changes: 8 additions & 0 deletions cmd/catalyst/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type Cli struct {
EthURL string
EthKeystorePath string
EthPassword string
MaxTicketEV string
MaxTotalEV string
MaxPricePerUnit string
}

type DBObject map[string]any
Expand Down Expand Up @@ -171,6 +174,11 @@ func tweakProtocol(protocol *Protocol, cli *Cli, u *url.URL) bool {
protocol.EthKeystorePath = cli.EthKeystorePath
protocol.EthPassword = cli.EthPassword
protocol.EthURL = cli.EthURL
protocol.MaxPricePerUnit = cli.MaxPricePerUnit
protocol.MaxTicketEV = cli.MaxTicketEV
protocol.MaxTotalEV = cli.MaxTotalEV
} else {
protocol.OrchAddr = "http://127.0.0.1:8936"
}
} else if protocol.Connector == "livepeer" && protocol.Broadcaster && protocol.MetadataQueueURI != "" {
// live broadcaster
Expand Down
2 changes: 0 additions & 2 deletions cmd/catalyst/config/full-stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"monitor": true,
"cliAddr": "127.0.0.1:7935",
"httpAddr": "127.0.0.1:8935",
"orchAddr": "127.0.0.1:8936",
"rtmpAddr": "127.0.0.1:1936",
"metadataQueueUri": "amqp://localhost:5672/livepeer",
"v": "2"
Expand All @@ -82,7 +81,6 @@
"monitor": true,
"httpAddr": "127.0.0.1:8937",
"cliAddr": "127.0.0.1:7937",
"orchAddr": "127.0.0.1:8936",
"rtmpAddr": "127.0.0.1:1937",
"v": "2"
},
Expand Down
3 changes: 3 additions & 0 deletions cmd/catalyst/config/mist_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ type Protocol struct {
EthURL string `json:"ethUrl,omitempty"`
EthKeystorePath string `json:"ethKeystorePath,omitempty"`
EthPassword string `json:"ethPassword,omitempty"`
MaxTicketEV string `json:"maxTicketEV,omitempty"`
MaxTotalEV string `json:"maxTotalEV,omitempty"`
MaxPricePerUnit string `json:"maxPricePerUnit,omitempty"`

ICEServers []ICEServer `json:"iceservers,omitempty"`
// And finally, four ways to spell the same thing:
Expand Down

0 comments on commit 7fd9814

Please sign in to comment.