Skip to content

Commit b89b22d

Browse files
committed
config: eth parameters
1 parent 77bf6ea commit b89b22d

File tree

4 files changed

+34
-16
lines changed

4 files changed

+34
-16
lines changed

Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,16 @@ scripts:
206206
cp -Rv ./scripts/* ./bin
207207

208208
.PHONY: box-dev
209-
box-dev: scripts
209+
box-dev: scripts catalyst
210210
ulimit -c unlimited \
211211
&& exec docker run \
212212
-v $$(realpath bin):/usr/local/bin \
213213
-v $$(realpath data):/data \
214214
-v $$(realpath config):/etc/livepeer:ro \
215215
-v $$(realpath ./coredumps):$$(realpath ./coredumps) \
216216
-e CORE_DUMP_DIR=$$(realpath ./coredumps) \
217-
-e LP_API_CORS_JWT_ALLOWLIST="[\"http://localhost:8080\", \"http://localhost:3000\", \"http://localhost:8888\",\"http://127.0.0.1:8080\", \"http://127.0.0.1:3000\", \"http://127.0.0.1:8888\"]" \
218-
-e LP_API_INGEST="[{\"ingest\":\"rtmp://localhost/live\",\"ingests\":{\"rtmp\":\"rtmp://localhost/live\",\"srt\":\"srt://localhost:8889\"},\"playback\":\"http://localhost:8888/hls\",\"base\":\"http://localhost:8888\",\"origin\":\"http://localhost:8888\"}]" \
219-
-e LP_CATALYST_API_TAGS="node=media,http=http://localhost:8888/mist" \
220-
-e LP_CATALYST_API_TOKEN=f61b3cdb-d173-4a7a-a0d3-547b871a56f9 \
221-
-e LP_CATALYST_SECRET=f61b3cdb-d173-4a7a-a0d3-547b871a56f9 \
222-
-e LP_LIVEPEER_ACCESS_TOKEN=f61b3cdb-d173-4a7a-a0d3-547b871a56f9 \
223-
-e LPAUTHWEBHOOKURL=http://9c2936b5-143f-4b10-b302-6a21b5f29c3d:[email protected]:3004/api/stream/hook \
217+
-v /home/iameli/.ethereum/keystore:/keystore \
218+
-e CATALYST_SECRET=f61b3cdb-d173-4a7a-a0d3-547b871a56f9 \
224219
$(shell for line in $$(cat .env 2>/dev/null || echo ''); do printf -- "-e $$line "; done) \
225220
--rm \
226221
-it \

cmd/catalyst/catalyst.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ func main() {
2727
fs.StringVar(&cli.Secret, "secret", "", "Secret UUID to secure your Catalyst node")
2828
fs.StringVar(&cli.ConfOutput, "conf-output", "/tmp/catalyst-generated.json", "Path where we will place generated MistServer configuration")
2929
fs.StringVar(&cli.SQLOutput, "sql-output", "/tmp/catalyst-fixtures.sql", "Path where we will generate SQL fixtures")
30+
fs.StringVar(&cli.Network, "network", "offchain", "Network to use for transcoding. Allowed values: offchain, arbitrum-one-mainnet")
31+
fs.StringVar(&cli.EthURL, "eth-url", "", "HTTPS URL of an Ethereum RPC provider for your selected network")
32+
fs.StringVar(&cli.EthKeystorePath, "eth-keystore-path", "/keystore", "Path to an Ethereum keystore")
33+
fs.StringVar(&cli.EthPassword, "eth-password", "", "Ethereum password or path to password file")
3034

3135
ff.Parse(
3236
fs, os.Args[1:],

cmd/catalyst/config/config.go

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@ var vodBucketCatalystID = "00000000-0000-4000-0000-000000000003"
2323
var privateBucketID = "00000000-0000-4000-0000-000000000004"
2424

2525
type Cli struct {
26-
PublicURL string
27-
Secret string
28-
Verbosity string
29-
ConfOutput string
30-
SQLOutput string
31-
Network string
32-
EthURL string
33-
Keystore string
26+
PublicURL string
27+
Secret string
28+
Verbosity string
29+
ConfOutput string
30+
SQLOutput string
31+
Network string
32+
EthURL string
33+
EthKeystorePath string
34+
EthPassword string
3435
}
3536

3637
type DBObject map[string]any
@@ -163,8 +164,22 @@ func tweakProtocol(protocol *Protocol, cli *Cli, u *url.URL) bool {
163164
protocol.LivepeerAccessToken = cli.Secret
164165
} else if protocol.Connector == "livepeer-analyzer" {
165166
protocol.LivepeerAccessToken = cli.Secret
167+
} else if protocol.Connector == "livepeer" && protocol.Broadcaster {
168+
// both broadcasters
169+
if cli.Network != "offchain" {
170+
protocol.Network = cli.Network
171+
protocol.EthKeystorePath = cli.EthKeystorePath
172+
protocol.EthPassword = cli.EthPassword
173+
protocol.EthURL = cli.EthURL
174+
}
166175
} else if protocol.Connector == "livepeer" && protocol.Broadcaster && protocol.MetadataQueueURI != "" {
176+
// live broadcaster
167177
protocol.AuthWebhookURL = fmt.Sprintf("http://%s:%[email protected]:3004/api/stream/hook", adminID, cli.Secret)
178+
} else if protocol.Connector == "livepeer" && protocol.Orchestrator {
179+
// if we're not offchain we shouldn't run a local O
180+
if cli.Network != "offchain" {
181+
return false
182+
}
168183
} else if protocol.Connector == "WebRTC" {
169184
protocol.ICEServers = []ICEServer{
170185
{

cmd/catalyst/config/mist_config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ type Protocol struct {
7979
CORSJWTAllowlist string `json:"cors-jwt-allowlist,omitempty"`
8080
LivepeerAccessToken string `json:"livepeer-access-token,omitempty"`
8181
AuthWebhookURL string `json:"authWebhookUrl,omitempty"`
82+
Network string `json:"network,omitempty"`
83+
EthURL string `json:"ethUrl,omitempty"`
84+
EthKeystorePath string `json:"ethKeystorePath,omitempty"`
85+
EthPassword string `json:"ethPassword,omitempty"`
8286

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

0 commit comments

Comments
 (0)