Thanks for contributing to Acton.
Acton core is a Rust project, but the repository also includes UI components that are built and checked with Bun.
This guide covers local setup, build steps, and contributor workflows used in this repository.
- Public project overview: README.md
- Security reporting policy: SECURITY.md
- Maintainer release process: RELEASING.md
This repository is a Cargo workspace for the CLI and Rust libraries, plus a few non-Cargo surfaces such as docs and UI packages.
- Root
actoncrate (src/, rootCargo.toml): the CLI entrypoint and most end-user commands. - Tolk language/compiler stack:
tolk-compiler,tolk-*,tree-sitter-*, and the matching*-syntaxcrates. - Native/runtime bridge:
ton-objs,ton-executor,ton-emulator, andtvm-ffi. - Services and tooling:
ton-api,ton-localnet,ton-indexer,ton-retrace, theton-language-server-*crates, andacton-debug. - Repo tooling:
xtaskfor release/schema/artifact maintenance workflows. - Non-Cargo surfaces:
docs/(Next.js + Fumadocs), the Bun-built UI crates, and template/package-manager assets undersrc/commands/new/templates/.
The tree-sitter-* crates own grammar source of truth. The matching
*-syntax crates are typed AST/parser wrappers around those grammars rather
than independent grammar implementations.
- Unless stated otherwise, run commands from the repository root.
- Prefer
justtargets over ad-hoc commands when both exist. - Some targets intentionally modify files (
just check-ui,just fmt-ui,just test-update).
For the minimal local build/test flow, install:
- Rust toolchain (
rustup,cargo) just(task runner)cargo install just --version 1.58.0 --locked
cargo-nextest(required Rust test runner for non-doc tests)cargo install cargo-nextest --version 0.9.143 --locked
- Bun (required for UI packages; version pinned in
package.json)curl -fsSL https://bun.sh/install | bash - Git LFS (required for files tracked through LFS)
# macOS brew install git-lfs # Linux (Debian/Ubuntu) sudo apt install git-lfs git lfs install
- Playwright Chromium (required for Test UI E2E;
just test-ui-e2ealso installs it automatically)bun ci just install-test-ui-e2e-browsers
- GitHub CLI (
gh) (used byjust sync-artifacts)
- macOS:
brew install gh
- Linux (Debian/Ubuntu):
sudo apt install gh
Optional CLI tools:
Install the full set with:
just install-toolsOr install individual tools as needed:
cargo-shear(unused dependency linter forjust check-deps, also needed byjust check/just check-ci)cargo install cargo-shear --version 1.13.4 --locked
cargo-deny(dependency policy checks forjust check, also used byjust check-security)cargo install cargo-deny --version 0.20.2 --locked
cargo-audit(RustSec advisory checks forjust check-audit/just check-security)cargo install cargo-audit --version 0.22.2 --locked
typos-cli(spell checker forjust typos, also needed byjust check/just check-ci)cargo install typos-cli --version 1.49.0 --locked
cargo-llvm-cov(optional, for coverage)cargo install cargo-llvm-cov --locked rustup component add llvm-tools-preview
wasm-pack(optional, for rebuilding the source trace WASM package)cargo install wasm-pack --version 0.15.0 --locked
System dependencies:
- macOS:
brew install libsodium libmicrohttpd pkg-config
- Linux (Debian/Ubuntu):
sudo apt install libsodium-dev libmicrohttpd-dev pkg-config
For Linux Test UI E2E runs, Playwright may require extra browser libraries. If Chromium fails to start, run:
bun run playwright install --with-deps chromiumFor first-time Linux TON artifact builds (closer to CI), install the extended toolchain set:
sudo apt-get update
sudo apt-get install -y \
build-essential cmake ninja-build pkg-config autoconf automake \
libssl-dev libtool zlib1g-dev libsecp256k1-dev libmicrohttpd-dev \
libsodium-dev liblz4-dev libjemalloc-dev ccache \
clang-16 llvm-16 libc++-16-dev libc++abi-16-devFor a fresh checkout, the shortest path to a working contributor setup is:
just sync-artifacts
just build-ui
just build-dev
./target/debug/acton --helpWhat this does:
just sync-artifactssyncscrates/ton-objs/artifacts_manifest.tomlfrom therelease-objsrelease and refreshes the matching prebuiltobjs/archive plus bundled stdlib assets for your current platform.just build-uiinstalls UI dependencies and builds the bundled UI assets.just build-devbuilds the debug CLI against the synced TON archives../target/debug/acton --helpconfirms that the binary starts.
Acton links static TON artifacts (libemulator.a, libtolk.a) from the
upstream ton-blockchain/ton repository branch acton.
For normal contributor setup, treat the published release-objs assets as the
source of truth.
just sync-artifacts/cargo xtask sync-artifactsownscrates/ton-objs/artifacts_manifest.toml,objs/, and the bundled stdlib assets undercrates/tolk-compiler/assets/.crates/ton-objs/build.rsverifieslibemulator.aandlibtolk.aagainst the SHA-256 values recorded in that manifest.- Only use the manual rebuild path when you are intentionally updating the
native artifact set itself; otherwise prefer re-syncing from
release-objs.
The verification bypass TON_OBJS_DISABLE_ARCHIVE_SHA_VERIFY exists as an
escape hatch, but it should stay unset for normal contributor builds. When set
to anything other than 0 / false, build-time archive verification is
disabled.
Acton embeds a default mainnet blockchain config for local emulation in
crates/ton-executor/src/default_config.boc64. Refresh it from TON Center with:
cargo xtask update-default-configThe task fetches getConfigAll, validates that result.config.bytes is a valid
BOC, and writes the base64 string into the bundled config file. The
ton-executor test suite also checks the bundled value against TON Center when
the endpoint is available; network, HTTP, or invalid-response failures are
reported as a skipped check rather than a failing test.
Use the built-in sync task instead of downloading release assets manually:
just sync-artifacts
just build-ui
just build-dev
./target/debug/acton --helpThis command:
- downloads the current
artifacts_manifest.tomlfrom therelease-objsrelease; - overwrites
crates/ton-objs/artifacts_manifest.tomlwith the released manifest; - downloads and unpacks the matching
ton-objs-<target>.tar.gzarchive intoobjs/; - downloads a temporary
ton-stdlib.tar.gz, replacescrates/tolk-compiler/assets/tolk-stdlib/andcrates/tolk-compiler/assets/fift-stdlib/from itstolk-stdlib/directory andfift-stdlib/Asm.fifplusfift-stdlib/Fift.fif, then removes the temporary archive.
After syncing, validate with:
just build-dev
./target/debug/acton doctorClone the TON repository from the Acton repo root:
git clone --branch acton https://github.com/ton-blockchain/ton.git ton-repo --recurse-submodulesBuild the static artifacts with the script for your platform.
Ubuntu/Debian-like Linux:
cd ton-repo
sh ./assembly/native/build-ubuntu-static.sh -a -c
cd ..macOS:
cd ton-repo
sh ./assembly/native/build-macos-static.sh -a -c
cd ..Then copy the generated archives into Acton and build the project:
mkdir -p objs
cp ton-repo/artifacts/libemulator.a objs/
cp ton-repo/artifacts/libtolk.a objs/
# only when intentionally updating the native artifact set, edit crates/ton-objs/artifacts_manifest.toml:
# - increment `artifact_set_revision`
# - update `sha256.libemulator` / `sha256.libtolk`
just build-ui
just build-dev
./target/debug/acton --help./target/debug/acton --help
./target/debug/acton testDefault test command:
just testUpdate snapshots:
just test-updateEquivalent explicit form (with env):
SNAPSHOTS=overwrite just testRun browser E2E tests against a real acton test --ui server:
just test-ui-e2eThis target builds UI bundles, builds the debug Acton binary with those fresh
assets embedded, installs Playwright Chromium, type-checks the E2E test files,
creates a temporary Jetton template project under /tmp, starts
acton test --ui --coverage, and checks the Test UI in headless Chromium.
When an intentional visual change requires new screenshots:
just test-ui-e2e-updateCommit the updated files under
packages/test-ui/e2e/__image_snapshots__/.
Useful E2E environment variables:
ACTON_E2E_BIN: override the Acton binary used by the fixture.ACTON_E2E_TMPDIR: override the parent directory for temporary projects.ACTON_E2E_KEEP_TEMP=1: keep the generated project for debugging.
CI runs these visual E2E tests on macOS so the committed *-darwin.png
snapshots are compared on the same OS family. Linux local runs still check the
browser workflows, but skip visual snapshot assertions.
Run specific suites:
# Integration tests
cargo nextest run --test integration_test
# Debugger tests (sequential due to shared debug port)
cargo nextest run --test debug_test --test-threads 1Keep temp test artifacts:
DISABLE_TMP_DIR_CLEANUP_IN_TESTS=1 just testNotes:
just testusescargo nextest runfor Rust test targets andcargo test --workspace --docfor doctests.ton-retracetests stay inside the shared workspace run, but the repo's nextest config assignspackage(ton-retrace)to theretrace-serialgroup, so those tests still run one at a time.- CI test behavior is slightly different: the
cinextest profile andonly_cifeature are enabled in CI. For parity, run:CI=1 just test
Rust:
just fmt
just fmt-check
just clippy
just check-deps
just typosUI:
just fmt-ui
just check-uijust check-ui-ci matches the non-mutating UI check used in CI.
just check-ui runs lint:fix and may modify files.
Run it until no further changes are produced, then stage updated files.
just typos checks the repository from the root using _typos.toml.
It skips docs/ and selected generated or imported trees with high false-positive rates.
Run repository-wide dependency and supply-chain audits with:
just check-securityjust check-security stops on the first failure and currently checks:
- Rust dependencies with
cargo deny check - RustSec advisories for
Cargo.lockwithcargo audit - root workspace dependencies, including the VS Code extension, with
bun audit crates/tree-sitter-*withnpm audit
Run this check when your PR changes lockfiles, dependency manifests, or package versions for the Rust, root/UI, tree-sitter, or VS Code extension dependency surfaces listed above.
Generate LCOV:
just coverageGenerate HTML report:
just coverage-htmlBuild UI bundles used by Acton:
just build-uiWhen changing crates/acton-source-trace or crates/acton-source-trace-wasm,
generate the wasm-bindgen package with:
just build-source-trace-wasmThe generated package is written to /tmp/acton-source-trace-wasm by default.
Override it with:
ACTON_SOURCE_TRACE_WASM_OUT=/tmp/my-source-trace-wasm just build-source-trace-wasmCopying the generated JS/WASM into the package that embeds it is a manual step. Use the files from that output directory as the source for the downstream retracer-core update.
Documentation site (Next.js in docs/, package manager: Bun):
cd docs
bun ci
bun run devValidate docs from the repository root:
just check-docsThis runs the docs dependency install, Fumadocs generated-source refresh, format check, internal link validation, navigation validation, and static export build.
Regenerate auto-generated MDX documentation from Acton sources:
./target/debug/acton docgen
# or
cargo run --bin acton -- docgen
# check mode (fails with exit code 1 and prints diff if docs are stale)
cargo run --bin acton -- docgen --checkDo not hand-edit generated outputs. Edit the source-of-truth inputs instead,
then rerun acton docgen.
Source-of-truth map:
src/doc/man/*.md-> command reference docs underdocs/content/docs/commands, terminal help text undersrc/doc/man/generated_txt, and installed manpages undersrc/etc/manlib/->docs/content/docs/standard_librarycrates/tolk-compiler/assets/tolk-stdlib/->docs/content/docs/tolk_standard_library- linter rule metadata in
crates/tolk-linter/and related macros ->docs/content/docs/rules
acton docgen updates generated trees under:
docs/content/docs/commandsdocs/content/docs/standard_librarydocs/content/docs/tolk_standard_librarydocs/content/docs/rulessrc/etc/mansrc/doc/man/generated_txt
The Simulator control API uses a separate generator:
docs/public/openapi/acton-simulator-control.openapi.json ->
docs/content/docs/simulator/control-api.mdx through bun run generated-source
in docs/.
acton docgen --check renders into a temporary output tree and fails if any
tracked generated file is stale.
If your PR changes any docgen inputs, running acton docgen and committing
generated documentation changes is required. This includes:
lib/crates/tolk-compiler/assets/tolk-stdlib/- linter rule metadata and mappings (for example
crates/tolk-linter/,crates/tolk-macros/)
Changes to man pages can change the acton help snapshots. After regeneration,
run the help tests:
cargo nextest run --test integration_test -E 'test(test_acton_help_)'Changes to lib/ comments can shift source line numbers in debugger snapshots.
Run the debugger tests that cover the changed modules. For example:
cargo nextest run --test integration_test -E 'test(test_real_counter_contract_step_in)'Review each snapshot diff. For an intended change, rerun the affected test with
SNAPSHOTS=overwrite and commit the updated snapshot.
For docs-site-only pages under docs/content/docs/ that are not generated,
edit them directly and keep nearby meta.json in sync.
After doc updates (manual or generated), validate docs from the repository root:
just check-docscrates/acton-config/schemas/acton.schema.json is generated, not
hand-maintained.
Useful commands:
cargo xtask schema
cargo xtask schema --check
just check-schemaWhen to rerun schema generation:
- any change to
ActonConfigor related config structs - schema-shaping serde/schemars changes
- changes to linter rule names, descriptions, or explanation comments in
crates/tolk-linter/, which the schema includes - docs or editor work that depends on new config fields
Current consumers include:
- repo editor settings such as
.vscode/settings.json ton-language-server-core, which embeds the schema for TOML hover/completion help
A stale schema usually shows up as just check-schema failure, missing hover
docs, or editor completion that does not know about new config fields.
Grammar source of truth lives in crates/tree-sitter-*. The matching
crates/*-syntax crates wrap those grammars with typed AST helpers.
If your PR changes any crates/tree-sitter-* grammar/parser artifacts:
just test-tree-sitter-allFor quick Tolk-only iteration:
just test-tree-sitter-tolkWhen grammar snapshots need refresh:
just update-test-tree-sitter-tolkcargo xtask contains both contributor-facing and maintainer-only workflows.
Common contributor-facing tasks:
cargo xtask sync-artifactscargo xtask schemacargo xtask schema --check
Mostly maintainer-facing tasks:
cargo xtask releasecargo xtask retagcargo xtask dist ...cargo xtask update-abi-catalogcargo xtask github-cleanupcargo xtask ubicloud-cleanup
RELEASING.md documents numbered release flows in detail. The cleanup tasks are
cache-pruning helpers and should not be used casually.
Use this as a quick local matrix before pushing:
| Change type | Required local checks |
|---|---|
| Rust-only code | just check |
UI code (packages/, root package.json) |
just check + just build-ui + just check-ui; for Test UI behavior/screenshots also run just test-ui-e2e |
Dependency or lockfile changes (Cargo.lock, root bun.lock, tree-sitter/code extension package manifests) |
just check-security |
Standard library / docgen inputs (lib/, crates/tolk-compiler/assets/tolk-stdlib, linter rule metadata) |
just check + acton docgen and commit generated docs |
Docs site content/config/dependencies (docs/) |
just check-docs |
Tree-sitter grammar (crates/tree-sitter-*) |
just check + just test-tree-sitter-all (and the matching just update-test-tree-sitter-* recipe when snapshots change) |
| Release preparation (maintainers) | Follow RELEASING.md |
Every pull request must pass all checks from:
just checkThis command runs Rust formatting, docgen, dependency, dependency-policy, lint, schema, and test checks.
It needs cargo-shear, cargo-deny, cargo-audit, and typos-cli locally;
just install-tools installs them together with the optional coverage and WASM tools.
typos uses _typos.toml excludes for docs/ and selected generated or imported trees.
If your PR touches UI code (packages/test-ui, packages/localnet-ui,
packages/transaction-ui, or root UI config in package.json), you must also
run:
just build-ui
just check-uiIf your PR changes Test UI behavior or visuals, also run:
just test-ui-e2eUse just test-ui-e2e-update only when the visual change is intentional and
commit the regenerated screenshots.
Recommended extended local validation before opening a PR:
just precommitjust precommit additionally runs UI formatting/lint and full build steps.
Project follows Conventional Commits with scope.
Recommended format:
<type>(<scope>): <short imperative summary>
Examples:
feat(check): add inspection for duplicate condition in if-elsefix(stdlib): fix external message body serializationchore(docs): update linting docs
Rules:
- Use one of:
feat,fix,chore,refactor(anddocs/test/ciwhen appropriate). - Keep scope specific (
check,localnet,stdlib,wallet,test-runner,docs, etc.). - Use present tense in the subject (for example:
add,fix,update, notadded,fixed,updated). - Write concise imperative subject in lowercase.
- Keep the subject short (recommended: up to ~72 characters).
- Do not end the subject with a period.
- Optional issue/PR reference at the end is common:
(#123).
TONCENTER_MAINNET_API_KEY: API key for TON Center mainnet requests.TONCENTER_TESTNET_API_KEY: API key for TON Center testnet requests.ACTON_STUDIO_TONCENTER_MAINNET_API_KEYandACTON_STUDIO_TONCENTER_TESTNET_API_KEY: build-time application keys embedded in the Rust binary for Studio's public-network requests. RuntimeTONCENTER_MAINNET_API_KEYandTONCENTER_TESTNET_API_KEYvalues override them.VITE_LOCALNET_TONCENTER_API_KEY: API key sent by the localnet UI to TON Center-compatible/api/v2and/api/v3endpoints.DISABLE_TMP_DIR_CLEANUP_IN_TESTS=1: preserve temp test directories.ACTON_LOG_DIR: custom directory for Acton debug logs.
In generated projects, .env is usually the simplest place to set the
TON Center keys because Acton loads that file automatically.
Release and published trunk builds require the TONCENTER_MAINNET_API_KEY and
TONCENTER_TESTNET_API_KEY GitHub Actions secrets. The build workflows pass them
to Rust through the ACTON_STUDIO_ variables. Pull-request builds do not receive
these keys. Local builds can set the same build-time variables explicitly;
Cargo does not load .env files automatically.
Embedded application keys can be extracted from distributed binaries. Use keys intended for distribution. Studio adds them to upstream requests on the server; it does not expose them through its browser configuration.
Do what you want and how it is convenient for you.