Skip to content

docs: add Building Apps concept pages (smart contracts, dApps, smart accounts, smart assets, Blockchain Updates) - #28

Merged
33imattei33 merged 2 commits into
devfrom
docs/eco-19-building-apps-concepts
Oct 25, 2026
Merged

33imattei33 merged 2 commits into
devfrom
docs/eco-19-building-apps-concepts

Conversation

@33imattei33

@33imattei33 33imattei33 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Closes the WP3 concept gap from PLAN-docs-expansion.md (Jira: ECO-19).

What's new

Five original pages in docs/04_building-apps/. They are numbered 07–11 because 05_node-grpc.md and 06_data-service-api.md already hold the plan's 05_/06_ prefixes.

Page Covers
07_smart-contracts-overview.md The three script types, compile and deploy flow, limits, fees, Testnet vs Mainnet differences, common mistakes
08_creating-and-launching-a-dapp.md Walkthrough: a pledge-drive dApp (write, check complexity, configure, deploy, call, read state)
09_smart-accounts.md How verification works; 2-of-3 multisig and escrow walkthroughs
10_smart-assets.md Asset script rules, what the script sees, allowlist-token walkthrough
11_blockchain-updates.md Enabling the extension, the API, the event model, rules for a reliable consumer

Samples:

  • Four Ride scripts in docs/_samples/ride/ and seven TypeScript files in docs/_samples/.
  • The pages show them with {literalinclude}, so the published code is exactly the code CI typechecks. No pasted copies can drift.
  • The existing samples_typecheck job checks the TypeScript. I added @types/node to the samples' dev dependencies for readFile.
  • A new docs/scripts/check_ride_samples.py compiles the Ride scripts with a node's /utils/script/compileCode. It needs network access, so it isn't wired into CI; that belongs to the follow-up ticket "Run docs samples against testnet in CI".

Small corrections to existing pages:

  • 05_node-grpc.md said enabling the gRPC server also enables BlockchainUpdates. They are separate extension classes.
  • 02_node-extensions.md described min-keep-alive as a subscription lifetime; it is the minimum client keep-alive ping interval. It also named only one of the module's two extension classes.
  • Glossary entries now link to the new pages.
  • PLAN-docs-expansion.md records the final numbering.

Acceptance criteria

  • The 5 pages exist and are linked from 04_building-apps/index.md; the -W build passes on this PR
  • The independence check and Vale pass on this PR
  • Every page has a "Verified against node-scala v1.8.0" stamp with its date
  • Reviewer: spot-check 3 paragraphs per page against docs.waves.tech with a search to confirm no copied prose

How it was verified

  • Facts (fees, size and complexity limits, rules on asset scripts and proofs, Blockchain Updates behaviour) were traced to node-scala v1.8.0 source and to io.decentralchain:protobuf-schemas 1.6.6.
  • Fees were confirmed with POST /transactions/calculateFee on both public nodes.
  • All four Ride scripts compile on the Testnet node (v1.8.0-dev-e6248f2408) and the Mainnet node (DCC v1.3.5).
  • The second commit applies the findings of a code review of this PR:
    • The escrow script now reads its timeout and amount from data written before locking, instead of a fixed height that Mainnet has already passed.
    • The escrow script only accepts one payout of exactly the escrowed amount with the standard fee, so funds cannot leak out through fees.
    • refund() now decrements total.
    • The compile helper and the checker script handle non-JSON and network errors.
    • check_install_snippets.py now parses directive fences that carry an argument ({literalinclude} path). Before, it silently skipped any npm install line that came after an include.
    • The limits table reconciles the per-callable and per-invocation complexity caps.
    • The Testnet's highest active feature is corrected to 26.

Not verified:

  • Nothing was broadcast to the Testnet (no funded accounts).
  • The Blockchain Updates grpcurl commands were not run against a live node. That page's stamp says so.

Worth knowing for review

  • Mainnet is behind Testnet. It runs node v1.3.5 with features up to 16 active, so Ride V5 is its highest version. The samples use STDLIB_VERSION 5 so they deploy on both networks.
  • Mainnet Set Script fee. Mainnet charges a flat 0.01 DCC, but setScript() defaults to the Testnet's per-kilobyte fee. The pages tell Mainnet users to pass fee: 1_000_000.
  • SDK chain ID default. @decentralchain/transactions builders other than transfer()/massTransfer() default to chain ID 76 ('L'), which no DecentralChain network uses. The pages warn about it; the SDK itself needs a separate issue.
  • Stale protobuf package. The published @decentralchain/protobuf-serialization 3.0.0 still uses the previous protobuf package names, so a generated client cannot reach a v1.8.0 node's BlockchainUpdates service. The Blockchain Updates page warns against generating from it.
  • Wrong function name in the Ride reference (outside this PR). 03_functions.rst documents the native-coin balance function as decentralchainBalance, but the Testnet node only compiles dccBalance, and the Mainnet node only accepts the upstream name.
  • PR size. This is about 1,200 changed lines in one PR, above the plan's ~600-line guideline. Happy to split it if that helps review.

🤖 Generated with Claude Code

favriziomattey and others added 2 commits October 24, 2026 22:43
…rt accounts, smart assets and Blockchain Updates

Closes the WP3 concept gap (ECO-19) with five original pages in
04_building-apps/, numbered 07-11 so prefixes stay unique next to the
existing 05_node-grpc and 06_data-service-api:

- 07 Smart Contracts Overview: the three script types, compile/deploy
  flow, limits, fees, Testnet vs Mainnet differences, common mistakes
- 08 Creating and Launching a dApp: pledge-drive walkthrough
- 09 Smart Accounts: 2-of-3 multisig and escrow walkthroughs
- 10 Smart Assets: allowlist-token walkthrough and asset script rules
- 11 Blockchain Updates: enabling the extension, API, event model,
  reliable-consumer rules

Every fact is traced to node-scala v1.8.0 source; fees were confirmed
with POST /transactions/calculateFee on the Testnet and Mainnet nodes.
Each page carries a "Verified against" stamp.

Samples: four Ride scripts in docs/_samples/ride/ (compiled on both
public nodes by the new docs/scripts/check_ride_samples.py) and seven
TypeScript samples typechecked by the existing samples job
(@types/node added for readFile).

Also corrects 05_node-grpc.md (enabling the gRPC server does not
enable BlockchainUpdates), 02_node-extensions.md (min-keep-alive
meaning, both extension classes), links the glossary entries and
records the final numbering in PLAN-docs-expansion.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Escrow sample (09_smart-accounts):
- The timeout was a fixed height (120000) that Mainnet has already
  passed and the Testnet soon will, letting the buyer reclaim funds at
  once. It is now written to the account's data before locking,
  computed from the current height.
- Payouts were not limited, so a signer could send the funds away as a
  huge fee or in many small pieces. A payout must now move exactly the
  escrowed amount, also stored in data, with exactly the 0.005 DCC fee,
  so the funds can leave once.

Other fixes:
- pledge-drive refund() now decrements total.
- Pages show samples with {literalinclude} instead of pasted copies, so
  the published code is the typechecked and compiled code. The install
  snippet checker now parses directive fences that carry an argument;
  without that it silently skipped the install line after an include.
- compileRide and check_ride_samples.py handle non-JSON and network
  errors instead of crashing.
- The limits table adds the per-invocation complexity cap (26,000 for
  V5, 52,000 for V6+) next to the per-callable cap it was confused with.
- Set Asset Script's 1 DCC is stated to include the smart asset
  surcharge; the Testnet's highest active feature is 26, not 25.
- Walkthroughs tell readers to replace the example keys and addresses.
- Updated script sizes, complexities and fees, confirmed with the
  Testnet node's calculateFee.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@33imattei33 33imattei33 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the five new pages in docs/04_building-apps/ (07–11) and the samples in docs/_samples/.

Acceptance criterion 4 (no copied prose): I spot-checked 3 paragraphs per page against docs.waves.tech with a search. No matches.

Page Result
07 Smart Contracts Overview ✅ original
08 Creating and Launching a dApp ✅ original
09 Smart Accounts ✅ original
10 Smart Assets ✅ original
11 Blockchain Updates ✅ original

CI is green on de11f3b: strict build, independence check, samples typecheck, Vale and link check.

All four acceptance criteria for ECO-19 are met. Ready to merge into dev.

@33imattei33
33imattei33 merged commit bef8cf9 into dev Oct 25, 2026
5 checks passed
33imattei33 added a commit that referenced this pull request Oct 26, 2026
release: Building Apps concept pages (#28) and published-locales fix (#29) to main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants