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.
npm run dev
# OR
wrangler dev --local --persist
-
Copy
wrangler.toml.example
towrangler.toml
. -
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
- 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>" },
]
- Setup email queue binding in
wrangler.toml
:
- 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
wrangler publish
# OR
npm run deploy