Skip to content
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

feat: add live worker #3860

Merged
merged 2 commits into from Oct 3, 2023
Merged

feat: add live worker #3860

merged 2 commits into from Oct 3, 2023

Conversation

bigint
Copy link
Member

@bigint bigint commented Oct 3, 2023

What does this PR do?

πŸ€– Generated by Copilot at cf97b30

This pull request adds a new subpackage for the live service worker, which is a Cloudflare Worker that interacts with the Livepeer API and Arweave via Bundlr. The subpackage contains the source code, configuration files, documentation, and dependencies for the worker. The worker exposes a /create endpoint that allows users to create live video streams with predefined profiles. The worker also posts JSON metadata of a publication and profile to Arweave via Bundlr, which is a decentralized storage network.

Related issues

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Explanation of the changes

πŸ€– Generated by Copilot at cf97b30

  • Add a new subpackage for the live service worker, which handles creating and managing live video streams via the Livepeer API and Arweave (F1-F9)
  • Define the metadata and dependencies of the subpackage in the package.json file (link)
  • Extend the base eslint and TypeScript configurations from the @hey/config package in the .eslintrc.js and tsconfig.json files (link, link)
  • Add the type definitions for the Cloudflare Workers environment from the @cloudflare/workers-types package to the tsconfig.json file (link)
  • Define the configuration for the wrangler tool, which deploys the worker to Cloudflare Workers, in the wrangler.toml file (link)
  • Document the purpose and usage of the worker in the README.md file (link)
  • Export the main entry point for the worker in the index.ts file, which creates a router object that handles different routes and methods, applies a CORS middleware and an error handling, and returns a response object (link)
  • Export a handler function for the /create endpoint in the createStream.ts file, which validates the request body and the access token, checks if the user has owned lens profiles, and calls the Livepeer API to create a new stream (link)
  • Export a helper function for building a WorkerRequest object from a Request, an Env, and an ExecutionContext object in the buildRequest.ts file (link)
  • Export the custom types for the worker in the types.ts file, such as the Env interface and the WorkerRequest type (link)
  • Add a new environment variable LIVEPEER_API_KEY to the .dev.vars.example file, which is a template for the local development environment variables (link)
  • Add a new entry for the subpackage to the lock file for the pnpm package manager, which lists the dependencies and devDependencies for the subpackage and links the internal packages to their relative paths in the workspace (link)

Emoji

πŸŽ₯πŸŒπŸ› οΈ

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
prerender βœ… Ready (Inspect) Visit Preview Oct 3, 2023 6:18am
web βœ… Ready (Inspect) Visit Preview Oct 3, 2023 6:18am

@vercel vercel bot temporarily deployed to Preview – prerender October 3, 2023 06:13 Inactive
@bigint bigint merged commit d08e878 into main Oct 3, 2023
3 of 7 checks passed
@bigint bigint deleted the live-worker branch October 3, 2023 06:14
@vercel vercel bot temporarily deployed to Preview – prerender October 3, 2023 06:14 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant