MyZubster Sepolia E2E โ Technical Deep Dive: Debugging the Full Marketplace Payment Pipeline
I have just completed a full end-to-end technical validation of the MyZubster Marketplace ETH payment pipeline on Ethereum Sepolia.
This was not a simple frontend test.
The work involved debugging and validating multiple layers of the system:
- React routing
- React development server
- Webpack Dev Server
- browser runtime diagnostics
- frontend bundle generation
- Cloudflare CDN caching
- Cloudflare Tunnel ingress rules
- SPA fallback behavior
- API/backend routing
- authentication/JWT handling
- Marketplace order state
- payment-intent generation
- MetaMask
- Ethereum Sepolia
- transaction construction
- on-chain transaction verification
- confirmation tracking
- final Marketplace payment state
The interesting part was that several apparently unrelated browser errors were actually symptoms of infrastructure and routing problems.
- Starting point: the Marketplace Operations route
The target route was:
MyZubster Marketplace Operations โ Sepolia
The React application explicitly defines:
if (path === '/marketplace/scambi') {
return ;
}
and the navigation contains:
window.location.href = '/marketplace/scambi';
So the expected application architecture was:
/marketplace
โ
MarketplacePage
/marketplace/scambi
โ
MarketplaceOpsPage
The first task was proving that this code was actually reaching the browser.
- Frontend development server investigation
The frontend was running through Create React App:
react-scripts start
The relevant process was:
/usr/bin/node
/root/myzubster-sepolia-e2e/frontend/node_modules/react-scripts/scripts/start.js
The application was bound to:
127.0.0.1:3010
We verified the listener with:
ss -ltnp | grep ':3010'
which returned the React process.
The process tree was also inspected:
sh
โโโ react-scripts
โโโ node
โโโ webpack/react development server
This was important because an attempted restart initially produced:
Something is already running on port 3010.
The issue was not that React could not start.
A previous React development process was already occupying the port.
- Local route versus public route
We then compared:
http://127.0.0.1:3010/marketplace/scambi
against:
https://sepolia.myzubster.com/marketplace/scambi
Both returned:
HTTP 200
Content-Type: text/html
This initially suggested that the route was fine.
But an HTTP 200 response alone does not prove that the correct React application version is being served.
The next step was therefore to inspect the actual JavaScript bundle.
- Runtime instrumentation
A temporary diagnostic marker was inserted into App.js:
console.log('[MYZ-APP-RUNTIME]', {
pathname: window.location.pathname,
path,
marketplaceOps: path === '/marketplace/scambi',
href: window.location.href
});
The browser then reported:
pathname: "/marketplace/scambi"
path: "/marketplace/scambi"
marketplaceOps: true
This established that the browser itself was correctly interpreting:
/marketplace/scambi
as the Marketplace Operations route.
We also inspected the DOM and confirmed that the browser was loading:
/static/js/bundle.js
- Bundle-level verification
The bundle was downloaded and searched directly.
The relevant route was found in the compiled JavaScript:
if (path === '/marketplace/scambi')
return MarketplaceOpsPage;
We also searched for:
Paga ETH su Sepolia
and found it.
This was important because it proved that the Marketplace Operations component was not merely present in the source tree.
It was present in the bundle being served.
- Cloudflare cache investigation
The next layer was Cloudflare.
The public bundle returned headers such as:
HTTP/2 200
content-type: application/javascript; charset=utf-8
etag: W/"2c9e23-..."
age: 582
cache-control: max-age=14400
cf-cache-status: HIT
The local bundle had a different ETag:
ETag: W/"2c9ec3-..."
This was the key observation.
The local development server had a newer bundle, while Cloudflare was still serving an older cached object.
So the situation was:
SOURCE CODE
โ
React build/dev server
โ
NEW BUNDLE
โ
X
Cloudflare cache
โ
OLD BUNDLE
โ
Browser
This can be particularly confusing because:
HTTP 200
does not mean:
latest application version
- Targeted Cloudflare cache purge
Instead of performing a full cache purge, the specific asset was targeted:
https://sepolia.myzubster.com/static/js/bundle.js
through Cloudflare's cache purge interface.
Cloudflare Dashboard
After the purge, a cache-busting request returned:
cf-cache-status: MISS
and the public ETag changed to the current bundle's ETag.
This established that Cloudflare was now fetching the updated asset from the origin.
- WebSocket error from Webpack Dev Server
The browser was also reporting:
Firefox cannot establish a connection to
ws://127.0.0.1:3010/ws
This initially looked alarming because the public site was being accessed through:
https://sepolia.myzubster.com
while the Webpack development client was attempting to establish a WebSocket against:
127.0.0.1:3010
The important distinction is that this is development-server HMR/WebSocket infrastructure, not the Marketplace HTTP/API request itself.
The application bundle was nevertheless loading and executing.
The browser continued to report:
MYZ-APP-RUNTIME
and:
marketplaceOps: true
so the WebSocket failure was not the root cause of the Marketplace API problem.
- The real API problem
The more significant error appeared when testing:
/api/marketplace/orders/mine
The browser expected JSON.
Instead, it received:
HTTP 200
Content-Type: text/html
with:
<!DOCTYPE html>
This immediately explained:
JSON.parse:
unexpected character at line 1 column 1
The frontend wasn't receiving malformed JSON.
It wasn't receiving JSON at all.
It was receiving the React application's HTML.
This is a classic SPA/API routing failure.
- Why this happened
The Cloudflare Tunnel configuration originally routed:
sepolia.myzubster.comโ
127.0.0.1:3010
But the backend API was actually listening on:
127.0.0.1:5010
Therefore:
GET /api/marketplace/orders/mine
was effectively becoming:
Cloudflare
โ
Frontend :3010
โ
React index.html
instead of:
Cloudflare
โ
Backend :5010
โ
JSON API
- Correcting Cloudflare ingress
The ingress configuration was changed to explicitly separate API traffic:
The routing architecture became:
Cloudflare Tunnel
โ
sepolia.myzubster.com
โ
โโโโโโโโโโโโโดโโโโโโโโโโโโ
โ โ
/api/* /*
โ โ
โผ โผ
Backend :5010 Frontend :3010
โ โ
โผ โผ
JSON React SPA
The configuration was validated:
Validating rules from /root/.cloudflared/config.yml
OK
- Discovering how Cloudflared was actually managed
An attempt to restart:
systemctl restart cloudflared
failed because:
cloudflared.service not found
We then traced the process:
systemd
โโโ PM2
โโโ cloudflared
PM2 showed:
id: 4
name: cloudflared
status: online
and the command:
/usr/local/bin/cloudflared tunnel
--config /root/.cloudflared/config.yml
--protocol http2
run myzubster
Therefore the correct restart mechanism was:
pm2 restart 4
or:
pm2 restart cloudflared
This is another useful operational lesson: before restarting infrastructure, identify which process manager actually owns it.
- API routing verification
After the Tunnel configuration was corrected, the same public endpoint:
https://sepolia.myzubster.com/api/marketplace/orders/mine
returned:
HTTP/2 401
Content-Type: application/json
with:
{
"success": false,
"message": "Token di autenticazione mancante o non valido"
}
This was exactly what we wanted from an unauthenticated request.
The important change was:
Before
200
text/html
React index.html
After
401
application/json
Backend authentication response
A 401 here was actually evidence that routing was fixed.
- Authenticated Marketplace order
Using the authenticated browser session:
fetch('/api/marketplace/orders/mine', {
headers: {
Authorization:
Bearer ${localStorage.getItem('myzubster-token')}
},
cache: 'no-store'
})
the backend returned the actual test order.
The order was:
ID:
6ab870ffc33da1e61579745d
with:
status: ACCEPTED
and:
payment.status: AWAITING_PAYMENT
The order snapshot contained:
title:
MyZubster Sepolia ETH E2E Test
price:
0.0001
currency:
ETH
exchangeMode:
payment
At this stage the Marketplace order existed correctly, but the blockchain payment had not yet been made.
- Payment-intent endpoint debugging
The frontend initially attempted:
/api/marketplace/orders/{id}/payment-intent
which returned:
404
Cannot GET /api/marketplace/orders/.../payment-intent
The actual endpoint was:
/api/marketplace/orders/{id}/payment/eth-intent
For the E2E order:
/api/marketplace/orders/6ab870ffc33da1e61579745d/payment/eth-intent
the backend returned:
HTTP 200
Content-Type: application/json
with the complete payment intent.
- Payment intent structure
The backend returned:
{
"success": true,
"data": {
"asset": "ETH",
"network": "sepolia",
"chainId": 11155111,
"chainHex": "0xaa36a7",
"expectedSender": "0xB15707286c4dFC6f642fcDf217419b2665e1847a",
"expectedRecipient": "0x14d751a54E8617C5A9DF87972dC980827fA91e4d",
"expectedAmountWei": "100000000000000",
"expectedAmountEth": "0.0001",
"minConfirmations": 3,
"paymentStatus": "AWAITING_PAYMENT",
"txId": null,
"testnet": true
}
}
This establishes several critical properties.
Network
Sepolia
Chain
11155111
Amount
100000000000000 wei
which corresponds to:
0.0001 ETH
Required confirmation depth
3
Expected sender
0xB15707286c4dFC6f642fcDf217419b2665e1847a
Expected recipient
0x14d751a54E8617C5A9DF87972dC980827fA91e4d
- MetaMask and testnet funding
When attempting to execute the transaction, MetaMask correctly identified that the wallet did not initially have enough SepoliaETH to cover the transaction and network fees.
This is an important distinction in E2E testing:
Payment amount
+
Gas fee
both require testnet funds.
The test wallet was subsequently funded using a Sepolia faucet.
Once the wallet had sufficient SepoliaETH, the transaction could be submitted.
- Transaction execution
MetaMask was used to submit:
0.0001 SepoliaETH
from:
0xB15707286c4dFC6f642fcDf217419b2665e1847a
to:
0x14d751a54E8617C5A9DF87972dC980827fA91e4d
The transaction was submitted on:
Ethereum Sepolia
Chain ID: 11155111
The Marketplace immediately entered:
PAYMENT: CONFIRMING
rather than incorrectly assuming that the payment was already final.
- Confirmation tracking
The UI displayed:
Confirmations: 0
immediately after transaction submission.
This is an important state distinction:
transaction submitted
โ
payment finalized
The backend continued checking the blockchain until the required confirmation depth was reached.
The configured threshold was:
3 confirmations
- Server-side verification
The final payment state was not determined solely by the frontend or by MetaMask.
The verification process used the payment intent as the expected source of truth.
Conceptually:
Expected sender
โ
โโโโโโโโโโโโโโโโโ
Expected recipient โ
โ โ
Expected amount โ
โ โผ
Expected network โ Blockchain transaction โ
โผ
Verification
โ
โโโโโโโโดโโโโโโโ
โ โ
Valid? Confirmations
โ โ
โโโโโโโโฌโโโโโโโ
โผ
PAID
The final transaction satisfied the expected payment parameters.
- Final transaction state
The Marketplace eventually showed:
PAYMENT: PAID
with:
Amount:
0.0001 ETH
Network:
Ethereum Sepolia
Confirmations:
3
and the transaction evidence:
TX:
0xae0b...5af9f94c37
The final sender and recipient matched the payment intent.
- Complete state transition
The entire Marketplace payment state machine was demonstrated:
โโโโโโโโโโโโโโโโโโโโโโโโ
โ ACCEPTED โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ AWAITING_PAYMENT โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โ MetaMask transaction
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ CONFIRMING โ
โ confirmations: 0 โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โ blockchain
โ confirmations
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ CONFIRMING โ
โ confirmations: 3 โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ PAID โ
โโโโโโโโโโโโโโโโโโโโโโโโ
This is substantially more meaningful than a mocked frontend payment.
- Problems encountered and resolved
The E2E test exposed several independent technical problems.
Problem 1 โ Existing React process
Something is already running on port 3010
Resolution: identify the existing react-scripts process and manage the correct process.
Problem 2 โ Stale Cloudflare bundle
cf-cache-status: HIT
age: 582
with an outdated ETag.
Resolution: targeted Cloudflare cache purge.
Problem 3 โ Webpack development WebSocket
ws://127.0.0.1:3010/ws
could not be reached from the public browser.
Resolution: identified as development-server/HMR infrastructure rather than the Marketplace API failure.
Problem 4 โ API returned HTML
/api/marketplace/orders/mine
returned:
200 text/html
instead of JSON.
Resolution: separate /api/* from frontend routing in Cloudflare Tunnel.
Problem 5 โ Wrong payment-intent endpoint
The frontend attempted:
/payment-intent
while the backend exposed:
/payment/eth-intent
Resolution: use the correct endpoint.
Problem 6 โ Missing SepoliaETH
MetaMask reported insufficient funds for network fees.
Resolution: fund the Sepolia test wallet through a faucet.
- What makes this a real E2E test?
A useful distinction is:
Mocked test
Click Pay
โ
setState(PAID)
versus:
This test
Marketplace order
โ
authenticated API
โ
payment intent
โ
MetaMask
โ
real Sepolia transaction
โ
Ethereum network
โ
transaction confirmation
โ
server-side verification
โ
3 confirmations
โ
PAID
The second flow crosses actual system boundaries.
Infrastructure architecture after the fixes
The final architecture is:
INTERNET
โ
โผ
Cloudflare Edge
โ
โผ
Cloudflare Tunnel
โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
โ โ
/api/* /*
โ โ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Backend โ โ React โ
โ 127.0.0.1 โ โ 127.0.0.1 โ
โ :5010 โ โ :3010 โ
โโโโโโโโฌโโโโโโโโ โโโโโโโโฌโโโโโโโโ
โ โ
โผ โผ
Marketplace API Marketplace UI
โ
โผ
Payment Intent
โ
โผ
MetaMask
โ
โผ
Ethereum Sepolia
โ
โผ
Blockchain TX
โ
โผ
Server Verification
โ
โผ
PAID
Useful debugging methodology
One of the biggest takeaways from this test is that debugging a Web3 application is not limited to the blockchain.
The actual dependency chain was:
Browser
โ
React
โ
Webpack
โ
HTTP
โ
Cloudflare
โ
Tunnel
โ
Backend
โ
JWT
โ
Marketplace
โ
Payment intent
โ
MetaMask
โ
Ethereum
โ
Verification
A failure anywhere in this chain can manifest as a completely misleading browser error.
For example:
JSON.parse error
looked like a frontend parsing bug.
The real problem was:
Cloudflare routing
โ
React index.html
โ
JSON.parse("<!DOCTYPE html>")
Likewise:
HTTP 200
looked successful.
But:
200 + text/html
was actually evidence of a routing failure.
Live demonstration
The complete Marketplace Operations interface is available here:
MyZubster Marketplace Operations โ Sepolia
The public Sepolia environment:
MyZubster Sepolia Environment
The blockchain can be independently inspected through:
Ethereum Sepolia Etherscan
The completed transaction can be located using the transaction hash displayed by the Marketplace payment verification panel:
0xae0b...5af9f94c37
Final technical checklist
[โ] React frontend running
[โ] Marketplace route detected
[โ] MarketplaceOpsPage present in bundle
[โ] Runtime diagnostics verified
[โ] Public bundle verified
[โ] Cloudflare stale cache identified
[โ] Cloudflare cache purged
[โ] Frontend served current bundle
[โ] API routing issue identified
[โ] /api/* routed to backend :5010
[โ] Frontend routes remain on :3010
[โ] Cloudflare Tunnel configuration validated
[โ] PM2 cloudflared process identified
[โ] cloudflared restarted correctly
[โ] Unauthenticated API returns JSON 401
[โ] Authenticated orders endpoint works
[โ] Marketplace order retrieved
[โ] ETH payment intent generated
[โ] Sepolia chain ID verified
[โ] Sender verified
[โ] Recipient verified
[โ] Amount verified
[โ] MetaMask transaction executed
[โ] Sepolia transaction confirmed
[โ] Server-side verification completed
[โ] 3 confirmations reached
[โ] Payment transitioned to PAID
Conclusion
The most important result of this work is not simply that 0.0001 SepoliaETH was transferred.
The important result is that the entire distributed system was exercised and debugged across its real boundaries.
We started with frontend routing and a browser that was not behaving as expected.
We then traced the problem through:
React
โ Webpack Dev Server
โ browser bundle
โ Cloudflare cache
โ Cloudflare Tunnel
โ API routing
โ backend authentication
โ Marketplace order
โ payment intent
โ MetaMask
โ Ethereum Sepolia
โ blockchain confirmations
โ server-side verification
The final state was:
Marketplace Order
โ
โผ
ACCEPTED
โ
โผ
Payment Intent
โ
โผ
MetaMask / Sepolia
โ
โผ
Blockchain TX
โ
โผ
3 Confirmations
โ
โผ
Server Verification
โ
โผ
PAID
The MyZubster Sepolia ETH Marketplace payment pipeline has therefore been successfully exercised end-to-end against a real Sepolia blockchain transaction.