Skip to content

A Cloudflare Worker that manages a wallet's inbox on DAO DAO.

Notifications You must be signed in to change notification settings

DA0-DA0/inbox-cf-worker

Repository files navigation

inbox-cf-worker

A Cloudflare Worker that manages a wallet's inbox on DAO DAO.

Used template for Cosmos wallet authentication to authenticate requests via a Cosmos wallet signature.

Development

Run locally

npm run dev
# OR
wrangler dev --local --persist

Configuration

  1. Copy wrangler.toml.example to wrangler.toml.

  2. Create KV namespaces for production and development:

npx wrangler kv:namespace create NONCES
npx wrangler kv:namespace create NONCES --preview

npx wrangler kv:namespace create INBOX
npx wrangler kv:namespace create INBOX --preview

npx wrangler kv:namespace create PUSH
npx wrangler kv:namespace create PUSH --preview
  1. Update the binding IDs in wrangler.toml:
kv-namespaces = [
  { binding = "NONCES", id = "<INSERT NONCES_ID>", preview_id = "<INSERT NONCES_PREVIEW_ID>" },
  { binding = "INBOX", id = "<INSERT INBOX_ID>", preview_id = "<INSERT INBOX_PREVIEW_ID>" },
  { binding = "PUSH", id = "<INSERT PUSH_ID>", preview_id = "<INSERT PUSH_PREVIEW_ID>" },
]
  1. Setup email queue binding in wrangler.toml:
  1. Configure secrets:
echo <VALUE> | npx wrangler secret put ADD_SECRET
echo <VALUE> | npx wrangler secret put WEB_PUSH_PUBLIC_KEY
echo <VALUE> | npx wrangler secret put WEB_PUSH_PRIVATE_KEY
echo <VALUE> | npx wrangler secret put PUSHER_HOST
echo <VALUE> | npx wrangler secret put PUSHER_PORT
echo <VALUE> | npx wrangler secret put PUSHER_APP_ID
echo <VALUE> | npx wrangler secret put PUSHER_APP_KEY
echo <VALUE> | npx wrangler secret put PUSHER_SECRET

Deploy

wrangler publish
# OR
npm run deploy

About

A Cloudflare Worker that manages a wallet's inbox on DAO DAO.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published