Skip to content

Commit c58366b

Browse files
committed
docs: demo-1 Step 3 env path + stale gitignore claim (mzdc-4mv)
Two concrete bugs surfaced by novice-test v3: 1. Step 3 'cp .env.example .env' points at the wrong path. The reader is inside apps/humor/client/ after Step 2's 'cd mezo-hack/apps/humor/client'. The .env.example file lives one directory up at apps/humor/.env.example (shared between the server and client subdirs), not inside apps/humor/client/. Old command fails with 'cp: .env.example: No such file or directory'. Fixed to 'cp ../.env.example .env', with an explanatory sentence about where the template actually lives. 2. The 'repo's .gitignore already excludes .env' claim was stale. vativ/mezo-hack has NO .gitignore at any level (root, apps/humor, apps/humor/client — all 404 on GitHub). The reader creating a .env with a private key was NOT protected from an accidental 'git add .' or 'git add .env'. Replaced the false reassurance with a caution Aside telling the reader to create a .gitignore themselves before any commit ('echo ".env" > .gitignore'). Also updated the matching bullet in the Security section so the two don't drift apart. Verified against the live humor repo: - gh api repos/vativ/mezo-hack/contents/apps/humor confirms .env.example (file), client/ (dir), server/ (dir). No .env.example inside client/. - urlopen of /.gitignore, /apps/humor/.gitignore, and /apps/humor/client/.gitignore all return 404.
1 parent 94421aa commit c58366b

1 file changed

Lines changed: 26 additions & 11 deletions

File tree

src/content/docs/docs/developers/getting-started/musd-payments-x402/agentic-joke-buyer.mdx

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Demo 1 — Agentic joke buyer
33
description: >-
4-
A headless Node client that pays the Mezo x402 joke paywall
5-
autonomously using @x402/fetch and a funded testnet wallet — no
6-
browser, no Connect wallet button, no human click.
4+
A headless Node client that pays the Mezo x402 joke paywall autonomously using
5+
@x402/fetch and a funded testnet wallet — no browser, no Connect wallet
6+
button, no human click.
77
topic: developers
88
---
99

@@ -126,10 +126,13 @@ the override can be deleted without any other changes.
126126

127127
## Step 3: Configure `.env`
128128

129-
Copy the template and fill in your values:
129+
The `.env.example` template lives one directory up from the client —
130+
at `apps/humor/.env.example`, shared between the server and the
131+
client. Copy it into the client directory you're currently in and
132+
rename to `.env`:
130133

131134
```bash
132-
cp .env.example .env
135+
cp ../.env.example .env
133136
```
134137

135138
Open `.env` and set:
@@ -140,12 +143,23 @@ CLIENT_PRIVATE_KEY=0xYOUR_ACCOUNT_A_PRIVATE_KEY_HERE
140143

141144
# Target URL. Pick one:
142145
# RESOURCE_URL=http://localhost:3000/paid # your local seller from the Quickstart
143-
# RESOURCE_URL=https://demo.vativ.io/joke # the live demo
146+
# RESOURCE_URL=https://demo.vativ.io/joke # the live demo
144147
RESOURCE_URL=https://demo.vativ.io/joke
145148
```
146149

147-
`.env` is already in the repo's `.gitignore`. Keep it that way —
148-
private-key leakage via committed `.env` is how test wallets drain.
150+
<Aside type="caution" title="The repo does not ship a .gitignore">
151+
`vativ/mezo-hack` currently has **no** `.gitignore` at any level.
152+
If you plan to commit anything from your clone, create one first so
153+
your `.env` (and therefore your private key) cannot slip into a
154+
commit:
155+
156+
```bash
157+
echo ".env" > .gitignore
158+
```
159+
160+
Private-key leakage via a committed `.env` is how test wallets
161+
drain. Do this before your next `git add`.
162+
</Aside>
149163

150164
## Step 4: Run the agent
151165

@@ -239,9 +253,10 @@ Everything else is inside the library.
239253
holds only borrowed MUSD and faucet BTC is fine for this demo.
240254
Anything else goes in a hardware signer or MPC wallet. Rotate the
241255
testnet key after the demo if you shared the repo anywhere.
242-
- **`.env` must stay in `.gitignore`.** The cloned repo ships with
243-
`.env` already excluded, but verify if you fork or copy files
244-
elsewhere.
256+
- **Add `.env` to `.gitignore` before any commit.** The cloned
257+
`vativ/mezo-hack` repo does not ship a `.gitignore`; if you plan
258+
to commit anything from your clone, run
259+
`echo ".env" > .gitignore` first (see the caution in Step 3).
245260
- The `toClientEvmSigner` interface is swappable — production agentic
246261
flows replace it with a signer backed by a KMS, HSM, or threshold
247262
wallet. The rest of the pipeline (`wrapFetchWithPayment`, the x402

0 commit comments

Comments
 (0)