Skip to content

Build a workflow ​

Start by changing one screen in the complete Escrow example. You will see the change in the generic viewer without editing its React code or changing contract permissions.

Run on
Your workstation, in a source checkout.
Requires
Docker, Compose, Make and the locked dependencies.
Changes
Local CAM files and a disposable chain. No public deployment.
Success
The local creation form shows your new label; CAM conformance passes.

1. Make one visible change

In dapps/escrow/cam/ui.json, locate the AmountField with label Escrow amount in the agreement-creation screen. Change only its label to Project budget. Keep its state key, unit and expressions unchanged.

The complete example has three different kinds of UI-related code:

File or componentResponsibility
cam/main.jsonRoutes: what contract to read or call, and what happens next.
cam/ui.jsonScreens, fields, labels and buttons. This is what you are editing.
CamEscrowUIA read-only Solidity projection: state and available actions for a screen.
Browser viewerRenders those descriptions and connects a wallet. It is not the projection contract.

2. Refresh resource pins and validate

Replace your-local-context with your local Docker context. Use it for every command.

make cam/integrity/refresh DOCKER_CONTEXT=your-local-context
make cam/conformance/check DOCKER_CONTEXT=your-local-context
git diff -- dapps/escrow/cam

The UI's exact bytes changed, so its SHA-256 resource pin must change too. Inspect the diff: the intended label and affected integrity pins should explain it. Do not replace a digest with zero to bypass a failed check.

3. Open the complete example

make escrow/local/demo/gui/up DOCKER_CONTEXT=your-local-context

Keep the command running. Open the complete printed URL, normally on loopback port 5174, and open the agreement-creation form. It should show Project budget. This is a local fixture, not an update to a deployed Escrow. No wallet is needed just to inspect the form.

Stop the foreground command when finished. The explicit cleanup command is:

make escrow/local/demo/gui/down DOCKER_CONTEXT=your-local-context

Review your source diff before committing or discarding the experiment. Do not reset unrelated local work.

Understand the read that opens the form

This is the complete routes.createAgreementForm object from the source manifest, not a standalone manifest:

{
  "kind": "read",
  "inputs": [],
  "call": {
    "namespace": "contracts.CamEscrowUI",
    "function": "viewCreateAgreement",
    "args": { "client": "$account.address" }
  },
  "then": {
    "namespace": "ui",
    "function": "app",
    "args": {
      "view": {
        "screen": "$outputs.0",
        "navigation": "navigation.create"
      }
    }
  }
}

The host resolves CamEscrowUI to its address. The read uses the viewing account, receives the projection's result, and passes that result to the named app UI node. A viewing address is not proof of signing authority.

Understand how a field becomes a transaction

The amount field writes an exact base-unit decimal string to $state.amount. The creation button puts it in params.amount. The write route uses $inputs.params.amount for both the contract argument and native transaction value.

Field → button arguments → write route → review → wallet → receipt → next read. Preparation does not send anything. The contract still enforces its rules when a caller bypasses the viewer. A transaction hash is not a successful receipt.

Follow the complete UI source and route source when changing arguments. A lone field/button excerpt does not supply the other agreement inputs.

Publish deliberately

The current format is CAM 1.4.0 with UI 1.1.0. The manifest commitment and resource integrity use SHA-256. Current software rejects the older manifest versions.

For an ABI change, export the declared ABIs with make cam/abi/export, inspect the generated changes, and run conformance again. For a new app, add its explicit output mounts to the existing ABI/CAM build lanes; do not give a container write access to the whole checkout.

A local file edit changes no chain publication. Use the bundle preparation and publication workflow to make compatible resources available and have the CAM owner approve their new reference. A new business interface may require a contract migration, not just a new manifest.

Reference, not another tutorial

Use the current reference for expressions, UI fields and composition, execution outcomes and trust boundaries. In particular, the viewer can continue after an integrity warning; rendering a screen does not prove its authenticity.

Source baseline: 04a18763. The included route is checked against committed source by the documentation tests.