Sequence Diagram
sequenceDiagram
autonumber
participant C as Client
participant S as Server
participant P as Porton
C ->> S: GET /keys/:address?expiry&expiry=
S ->> S: keyPair = P256.randomKeyPair()
note right of S: Server encrypts and saves privateKey
S -->> C: { type: 'p256', publicKey }
C ->> P: experimental_grantPermissions(permissions)
C -) S: POST /schedule <br/> { address, action: "mint", "schedule": "*****" }
loop CRON
S ->> P: { digest, request } = wallet_prepareCalls(calls)
S ->> S: signature = P256.sign(digest, key)
S ->> P: hash = wallet_sendPreparedCalls(request, signature)
end
- exp-0003-client.evm.workers.dev - Client
- exp-0003-server.evm.workers.dev - Server
- Client: frontend application running in the browser,
- Server: handles key generation, preparing and sending calls, scheduling and managing CRON jobs.
# install / update pnpm
npm install --global pnpm@latest
# install dependencies
pnpm install
Setup environment variables
# replace values with your own cloudflare account id and API token
cp .env.example .env
# create database (this will fail if the database already exists)
pnpm --filter='server' db:create
# bootstrap the existing database.
pnpm --filter='server' db:bootstrap
pnpm --filter='server' --filter='client' dev
- a Cloudflare account
wrangler
CLI:pnpm add --global wrangler@latest
,- authenticate with
wrangler login
cd client
pnpm build
pnpm wrangler deploy dist --config='wrangler.toml'
cd server
pnpm wrangler deploy dist --config='wrangler.toml'