End-to-end vertical slice
About 1478 wordsAbout 5 min
Week 6 · Part 3 — End-to-end vertical slice
Core question — can I put every piece together into one small app that works from click to chain and back?
Parts 1 to 5 each built one piece: the setup, the contract feature, the script, the wallet and the activity list. Separately, each one works. This Part joins them into one app a person can actually use, and checks that the joins hold.
Picture a relay race
Four fast runners still lose if they drop the baton. Most race failures happen at the handovers, not on the straights.
Where the picture stops: in a relay you only pass forward. In an app, the result has to come back: after the transaction, the page must update what the user sees.
The hard skill
Compose a contract, scripts, a wallet and a frontend into one working application, and trace a single action through every layer.
After this Part you can:
- name every layer a click passes through and what each one adds;
- spot the joins where apps usually break;
- write a README that lets someone else run your app;
- judge when one complete slice beats several half-built features.
Core / reference material
The layers, end to end
The dotted line is the part people forget. A transaction changes the chain, not your page. The page only changes when you read again.
Where slices usually break
| Join | What goes wrong | How to check |
|---|---|---|
| Frontend → wallet | Wrong network, no account, popup blocked | Show the account and network on screen |
| viem → contract | Address or ABI from an old deployment | Both come from shared/contract.ts, which npm run deploy rewrites |
| Wallet → transaction | Hash treated as success | Wait for the receipt and check status |
| Chain → page | Page shows the old value after success | Read again and reload events after the receipt |
| Events → page | Activity list empty or very slow | Query from your deployment block, not from block 0 |
| RPC → events | pruned history unavailable | Use an RPC that keeps old logs, as in W6P2 |
What "one slice" means
A vertical slice is one feature that works through every layer, rather than many features that each stop halfway. For this Part, the slice is your contract's main write, plus everything around it: the wallet, a read before and after, the transaction stages and the activity list.
One complete slice is better than three features that only half work.
Selectors, calldata and RPC method names
A function selector is the first four bytes of the Keccak-256 hash of a function's canonical signature. Ethereum uses it to identify which function is being called; the rest of the calldata carries the encoded arguments. You do not need to calculate Keccak manually:
setRecord(string)
↓
keccak256(...)
↓
first 4 bytes
↓
0x3e0a0099cast sig "setRecord(string)" computes this selector for you.
The request table below uses JSON-RPC method names: standard strings spoken between wallets, libraries, RPC providers and nodes. For example, eth_call asks a node to execute a read-only call, eth_sendTransaction submits a transaction request for signing/sending, and eth_getLogs asks for matching event logs. These names identify the protocol message; they do not by themselves prove that the operation succeeded.
Worked example: trace one click
We took a working app after completing the W6 wallet and event Parts, connected a test wallet, typed one click, traced and pressed Save record. Then we recorded every request the page sent, in order. Repeated polling requests are grouped into one row:
- RPC —
eth_callwith selector0x3e0a0099.simulateContractasks whethersetRecordwould succeed. - Wallet —
eth_chainId. viem checks that the wallet is on Sepolia before asking it to sign. - Wallet —
eth_sendTransaction. The wallet opens, the user signs, and the wallet sends the transaction request. - RPC —
eth_getTransactionReceipt,eth_blockNumberandeth_getTransactionByHash.waitForTransactionReceiptpolls until the transaction is mined. - RPC —
eth_callwith selector0x469e9067. The page readsrecords(account)again. - RPC —
eth_blockNumber, theneth_getLogs. The page reloads the activity list from events.
You can confirm what the selectors mean yourself:
cast sig "setRecord(string)" # 0x3e0a0099
cast sig "records(address)" # 0x469e9067Then the page showed:
2. Your record
one click, traced
4. Activity
0xf39F…2266 set “one click, traced” in block 11926682 txEvery layer in the diagram appears in that list. Request 1 is the simulation from W5P3. Requests 2 and 3 are the wallet from W6P1. Request 4 is the wait for the receipt. Requests 5 and 6 are the dotted line coming back: without them, the page would still show the old record.
You can record the same list in your own app: open the browser's developer tools (introduced in W6P1), go to the Network tab, filter by your RPC's address, and click Save. Requests to the wallet do not appear there, because MetaMask handles them itself.
A README someone else can follow
Your README needs only five short parts:
- What it is, in one sentence.
- Contract: network and address, with an Etherscan link.
- Run it: the exact commands, from
git clonetonpm run dev. - Use it: what to click, and what should happen.
- Limits: what it does not do yet.
Hands-on task
Build your Week 6 mini dApp: one working slice of your own contract from W5P3. It must have:
- wallet connection, with the account and network shown;
- at least one contract read;
- your contract's main write, with pending, success and failure states;
- the page updating after success, without a reload;
- an activity list built from your contract's events (W6P2);
- your contract deployed on Sepolia (from W5P3);
- a README with the five parts above.
Then trace one click in your own app, as in the worked example, using the Network tab. List the requests in order and say which layer each one belongs to.
Out of scope: extra features, styling, putting the app online (W8P2 does that) and writing tests (W7P1).
Evidence required
- A link to your repository.
- Your contract's Sepolia address.
- A short screen recording (two minutes or less) or screenshots of one full action: connect, write, pending, success, and the new entry in the activity list.
- Your one-click trace: the list of requests and the layer each belongs to.
Completion and revision
This Part is worth 100 points in the Academy progression. Academy participants submit it for a binary Complete or Revise review against the criteria above. Independent readers may use those criteria as a self-check; formal points are tracked through organised Academy participation. There is no partial-score rubric.
Further exploration — optional, not assessed
- Make the activity list update by itself when anyone writes, using viem's
watchContractEvent, and think about what happens if the page is left open for an hour. - Time each stage of your trace. Which one does the user spend longest waiting for?
- Ask a friend to use your app with no instructions except the README. Note where they get stuck.
Sources and attribution
- Ethereum JSON-RPC API — Link, referenced only
- viem — waitForTransactionReceipt — Link, referenced only
- GitHub Docs — About READMEs — Link, referenced only
- Blockchain@NTU Academy Builder starter — Reuse (MIT), the app traced in the worked example
Changelog
f0652-docs(curriculum): migrate Academy to 10-week structure (#34)on4fee9-docs(curriculum): close prerequisite gaps across Foundation and Deep Dive (#33)on69ce3-docs(builder): improve Deep Dive teaching clarity and engineering guidance (#31)onffe9a-docs(track): add Builder W5 Part 5 events as data (#28)one1f77-docs(track): add Builder W5 Parts 1 to 4 and 6 (#27)on