Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Latest commit

 

History

History
55 lines (33 loc) · 1.37 KB

README.md

File metadata and controls

55 lines (33 loc) · 1.37 KB

catts-evm-proxy

Runs a Cloudflare Worker that proxies requests to the Alchemy API. The worker is written in Rust, compiled to WebAssembly, and deployed to Cloudflare's edge infrastructure.

Pre-requisites

The worker is configured using the following environment variables:

  • ALCHEMY_API_KEY: The API key to use when making requests to The Graph API.

Development

1. Configure

  • Create a .dev.vars file in the root of the project.
  • Add the following content to the file:
ALCHEMY_API_KEY=<API_KEY>

2. Run

npm i
npm run dev

Production

1. Configure

Set the environment variable using:

npx wrangler secret put ALCHEMY_API_KEY

2. Deploy

npm run deploy

Wrangler

Wrangler is used to develop, deploy, and configure your Worker via CLI.

Further documentation for Wrangler can be found here.

WebAssembly

workers-rs (the Rust SDK for Cloudflare Workers) is meant to be executed as compiled WebAssembly, and as such so must all the code you write and depend upon. All crates and modules used in Rust-based Workers projects have to compile to the wasm32-unknown-unknown triple.

Read more about this on the workers-rs project README.