Sails Local Smoke
Goal
Validate the generated client path against a local node after gtest is already green.
Deploy Artifact And Tooling
- The deploy artifact is the
.opt.wasmfile (optimized WASM), not the plain.wasm. The.opt.wasmis produced bywasm-optduring the Sails build and is significantly smaller. Uploading the unoptimized.wasmto a node will often fail withCodeTooLarge. - Prefer
vara-walletfor deploying to a local node. It handles account management and program upload without requiring a Gear source checkout or Rust-specific tooling. - For Rust-native test harnesses that already use
gclient, theGearApi+GclientEnvpath remains valid as a secondary option.
Identity Rules
- Use local dev accounts or user-provided account addresses in
SS58form for standard Vara account flows; do not default to Ethereum0xaddresses for normal local-node work. - Record the real deployed
program idfrom the deploy step and pass that into the typed client. If the flow uses vouchers, issue one first and use the returned voucher ID. Do not invent either identifier. - Keep seed phrases and private keys out of committed scripts, docs, and examples. Use local keyrings, environment input, or interactive setup instead.
Inputs
../../references/sails-gtest-and-local-validation.md../../references/sails-idl-client-pipeline.md../vara-wallet/SKILL.md../../references/sails-cheatsheet.md../../references/voucher-and-signless-flows.md../../references/sails-header-wire-format.md— Sails Header layout for debugging wire payloads
Sequence — Primary Path (vara-wallet + sails-js)
- Confirm the
docs/plans/...-gtest.mdnote shows a green test loop. - Start or reuse a local node on the default port (ws://localhost:9944).
- Set the endpoint:
$VW config set network local(persists) orexport VARA_WS=ws://localhost:9944(session only) or--network local(per-command). The default is mainnet — always override for local work. - Import a funded dev account:
$VW wallet import --seed '//Alice' --name alice. - Deploy the
.opt.wasmartifact and record the program id:
If the constructor does non-trivial work, override gas withUPLOAD=$($VW --account alice program upload ./target/wasm32-unknown-unknown/release/my_program.opt.wasm --idl ./my_program.idl --args '[]') PROGRAM_ID=$(echo $UPLOAD | jq -r .programId)--gas-limit.- Post-deploy verification: If the service exposes a query, call it immediately after deploy to verify the constructor ran. An uninitialized program will return default or empty state, or panic.
- If the program uses delayed messages, transfer VARA to the program address:
$VW --account alice transfer $PROGRAM_ID 100. - Exercise one command and one query to prove the integration works:
$VW --account alice call $PROGRAM_ID MyService/DoSomething --args '["hello"]' --idl ./my_program.idl $VW call $PROGRAM_ID MyService/GetState --args '[]' --idl ./my_program.idl
Sequence — Secondary Path (Rust gclient)
Use this path when the project already has a Rust test harness that uses gclient and GclientEnv.
- Confirm gtest is green.
- Start or reuse a local node and connect with
GearApi::init(WSAddress::dev())for local node on default port. Do not useGearApi::dev_from_path()— that expects a filesystem path to the node binary, not a WebSocket URL. - Deploy the
.opt.wasmand record the actual program id returned by the deploy flow. If the constructor does non-trivial work, override gas with an explicit limit. - If the program uses delayed messages, transfer VARA to the program address before exercising commands. On-chain programs need balance to pay for future gas — this is not required in
gtest. - Use the typed generated-client path through
GclientEnv, wiring in the actual deployed program id. - Exercise one command or query path that proves the typed integration works on a local node.
References
../../references/gtest-cheatsheet.md
Guardrails
- Keep this step typed and local.
- Do not invent account addresses, program ids, or voucher ids in guidance that pretends they already exist.
- Do not replace local smoke with explorer queries or ad hoc CLI poking.
- If
gtestis red or missing, stop and go back to../sails-gtest/SKILL.md. - Use
.opt.wasmas the default deploy artifact. The plain.wasmis an intermediate build output that may exceed on-chain size limits. - When targeting a local node with
vara-wallet, use--network localorconfig set network localorVARA_WS=ws://localhost:9944. The default endpoint is mainnet. - Do not embed machine-specific absolute paths in deploy commands or documentation. Use project-relative paths or skill-pack-relative references.
- Verify the program initialized correctly by calling a read query immediately after deploy. An uninitialized program will appear active but return empty or default state.