-
Notifications
You must be signed in to change notification settings - Fork 7
feat(echo): run on-chain with metered payments #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
167e8b8
feat(echo): run on-chain with metered payments
rickstaa eb229cb
docs(echo): use a generated sample clip, not a personal path
rickstaa 6ab8d51
docs(echo): note that the pipes need --signer on-chain
rickstaa 1d1f46b
chore(compose): run the demo stack on a go-livepeer master build
rickstaa 87f2773
fix(compose): raise ticketEV so a metered payment fits the ticket cap
rickstaa 433b8ff
fix(compose): carry the ticketEV bump into every on-chain example
rickstaa ab98556
docs(echo): match the section structure of the other examples
rickstaa d2fb4bd
docs(echo): condense the pricing comments in .env.example
rickstaa e90154d
docs(echo): note when the signer can serve discovery
rickstaa fdedf26
docs(compose): trim the ticketEV comment
rickstaa 5a3c92d
docs(echo): mark the sample clip step as optional
rickstaa f375a30
docs(echo): drop the duplicated on-chain paragraphs
rickstaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # Copy to .env (gitignored) and fill in. Never commit secrets. | ||
| # Keystore dirs: absolute paths OUTSIDE this repo, mounted read-only. | ||
|
|
||
| NETWORK=arbitrum-one-mainnet | ||
| ETH_RPC_URL=https://arb1.arbitrum.io/rpc | ||
|
|
||
| # Signer (payer): needs an on-chain deposit + reserve. | ||
| SIGNER_KEYSTORE_DIR=/absolute/path/to/signer-keystore | ||
| SIGNER_ETH_ACCT=0xYourSignerAddress | ||
| SIGNER_ETH_PASSWORD=your-signer-keystore-password | ||
|
|
||
| # Orchestrator operating key (split-key): needs ETH for gas to redeem tickets. | ||
| ORCH_KEYSTORE_DIR=/absolute/path/to/operator-keystore | ||
| ORCH_ETH_ACCT=0xYourOperatorAddress | ||
| ORCH_ETH_PASSWORD=your-operator-keystore-password | ||
| # Registered orch = ticket recipient (-ethOrchAddr); empty = use the operating key. | ||
| ORCH_ONCHAIN_ADDR=0xYourRegisteredOrchestrator | ||
|
|
||
| # Runner price (on-chain): USD per hour, metered per second while the client | ||
| # holds the session. Keep under ~0.67: the signer signs at most 100 tickets | ||
| # per payment, and the demo orchestrator runs -ticketEV=1e10 (fee / ticketEV). | ||
| PRICE=0.10 | ||
| # Signer's max-price cap (payer side), per billing unit. Metered here, so the | ||
| # unit is one second and must exceed PRICE / 3600 (0.000111USD is ~0.40/hour). | ||
| MAX_PRICE_PER_UNIT=0.000111USD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # On-chain payment overlay for echo. Layer it on the offchain base: | ||
| # docker compose -f compose.yml -f compose.onchain.yml up -d --build | ||
| # | ||
| # Adds the shared remote signer, re-points the orchestrator on-chain (see | ||
| # ../compose.onchain.yml), and registers the app with a price so the orchestrator | ||
| # issues a payment challenge. Requires a local .env (gitignored); copy .env.example | ||
| # and fill it in. The session is metered, so a stream is billed for as long as it | ||
| # runs. Then pay through the signer: | ||
| # uv run client.py sample.mp4 --mode blur \ | ||
| # --discovery https://localhost:8935/discovery \ | ||
| # --signer http://localhost:7936 | ||
|
|
||
| services: | ||
| signer: | ||
| extends: | ||
| file: ../compose.onchain.yml | ||
| service: signer | ||
| ports: | ||
| - "7936:7936" | ||
|
|
||
| orchestrator: | ||
| extends: | ||
| file: ../compose.onchain.yml | ||
| service: orchestrator | ||
|
|
||
| # Re-declare the command to advertise a price (base file registers free). | ||
| app: | ||
| command: | ||
| - --host=0.0.0.0 | ||
| - --orchestrator=https://orchestrator:8935 | ||
| - --orchSecret=abcdef | ||
| - --runner-url=http://app:8989 | ||
| # Billed per second of session (metered); price cap in .env.example. | ||
| - --price=${PRICE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.