-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy path.env-upto.example
More file actions
73 lines (61 loc) · 3.82 KB
/
Copy path.env-upto.example
File metadata and controls
73 lines (61 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# ── Scenario: upto (usage-based billing, EVM + TRON) ───────────────────────
# Copy to `.env-upto` (gitignored); the upto trio loads it:
# clients/upto · servers/upto · facilitator/upto
#
# cp .env-upto.example .env-upto
#
# The payer signs an authorization for up to a MAXIMUM amount; the server
# decides the REAL usage per request and settles only that (<= max). The
# facilitator submits the on-chain settlement. Both chains use Permit2.
#
# One file, three processes. Vars grouped by the process that reads them:
# SHARED (client + facilitator), CLIENT (payer), SERVER (resource provider),
# FACILITATOR (settlement).
# ── SHARED · client + facilitator ─────────────────────────────────────────
# Signing key — payer (client) and settler (facilitator), both chains.
AGENT_WALLET_PRIVATE_KEY=0x...
# TronGrid API key — both client and facilitator touch TRON. Optional.
TRON_GRID_API_KEY=
# ── CLIENT · the payer (clients/upto) ─────────────────────────────────────
# Which chains to exercise, one N-request run per entry, in order. Each entry is
# <network>[@<token>] network: CAIP-2 chain id —
# EVM: "eip155:97" (BSC testnet), "eip155:56" (BSC mainnet)
# TRON: "tron:3448148188" (Nile testnet), "tron:2494104990" (Shasta testnet), "tron:728126428" (mainnet)
# Shortcuts: "eip155" or "tron" match any network of that family.
# token optional (each chain advertises one: EVM=USDC, TRON=USDT) — symbol or
# asset address. Use `@` (not `#`) — dotenv treats `#` as a comment.
# Unset ⇒ each configured chain once.
PAY_TARGETS=eip155:97,tron:3448148188
# The resource the client fetches (server route).
RESOURCE_URL=http://localhost:4051/generate
# How many usage-billed requests to fire (per target).
NUMBER_OF_REQUESTS=3
# Optional EVM RPC override. viem's default BSC testnet node
# (data-seed-prebsc-*.bnbchain.org:8545) is often unreachable; the upto/permit2
# path reads the chain, so set a reliable endpoint if the EVM run fails.
# EVM_RPC_URL=https://bsc-testnet-rpc.publicnode.com
# ── SERVER · the resource provider (servers/upto) ─────────────────────────
# Payout addresses (set the chain(s) you want to accept).
EVM_ADDRESS=0x... # BSC, eip155:97 (token USDC, permit2)
TRON_ADDRESS=T... # TRON Nile (tron:3448148188); Shasta: tron:2494104990; mainnet: tron:728126428 (token USDT, permit2)
# TRON network: tron:3448148188 (Nile, default), tron:2494104990 (Shasta), tron:728126428 (mainnet)
# TRON_NETWORK=tron:3448148188
# Where the server binds, and where it reaches the facilitator.
SERVER_PORT=4051
FACILITATOR_URL=http://localhost:4052
# Server authorization ceiling (the "upto" max the client signs). Real charge
# per request is a random amount in [0, this], shown in each response.
MAX_PRICE=$0.10
# Optional: drop `paymentPayload.resource` (a localhost URL when the server runs
# locally) before verify/settle. Set "true" only when a LOCAL server points at a
# hosted facilitator whose edge WAF rejects loopback URLs in the body (e.g. AWS
# `EC2MetaDataSSRF_BODY` -> 403). Facilitator never reads it; signature ignores it.
# STRIP_RESOURCE_URL=true
# Optional: facilitator API key, sent as the `X-API-KEY` header on every
# verify/settle/supported call the SERVER makes. Hosted facilitators use it to
# select a rate-limit tier — anonymous calls still work, so leave it unset for
# local runs.
# FACILITATOR_API_KEY=your-key-here
# ── FACILITATOR · settlement (facilitator/upto) ───────────────────────────
# Where the facilitator binds (FACILITATOR_URL above must point here).
FACILITATOR_PORT=4052