Fork mode allows the local node to resolve account state from a remote network — testnet or mainnet — while executing all transactions locally. When the node receives a request for an account it has not yet cached, it fetches that account’s current state from the remote network on demand and stores it locally from that point on. All subsequent reads and writes happen locally; the remote network is never modified. This lets you interact with real deployed contracts, test against live jetton or NFT state, and reproduce mainnet bugs in a fully controlled environment without spending real TON or waiting for testnet finality.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ton-blockchain/acton/llms.txt
Use this file to discover all available pages before exploring further.
Starting with fork mode
- Fork testnet
- Fork mainnet
- Fork with custom port
acton_nodeInfo control endpoint reports the remote state source and current fork block:
Providing an API key
Acton fetches remote state from TonCenter. For sustained development use, set the matching environment variable before starting the node:- Testnet
- Mainnet
Forking at a historical block
Pin the fork to a specific masterchain block sequence number to get a deterministic snapshot of the chain state at that point in time. This is useful for reproducing bugs that depended on state at a particular block or for running regression tests against a known-good historical state:Historical block requests require TonCenter to have an archive node available for the target network. Very old blocks may not be accessible depending on your API tier.
Configuring fork defaults in Acton.toml
Instead of passing fork flags on every invocation, set defaults in Acton.toml under [localnet]. CLI flags override these values when you need to switch networks for a single run:
acton localnet start automatically forks from testnet at block 55 000 000.
What gets forked
When fork mode is active, the following data is sourced from the remote network:- Account state — balance, code, data cell, and status for any address the local node has not yet cached.
- Chain config parameters — global network configuration (e.g. gas prices, elector address) is pulled from the remote network at the fork block.
What is NOT fetched from the remote network
What is NOT fetched from the remote network
- Transaction history prior to the fork point — the local node only keeps transactions it executes itself.
- Messages that were in flight at the fork block — only account state snapshots are pulled.
- Block history — blocks are synthetic and local; seqno starts from 1 locally regardless of the fork block.
Common use cases
Test against a real deployed contract
Fork mainnet and interact with a live jetton master, DEX pool, or NFT collection without any local deployment. The node fetches the contract state on demand.
Reproduce a mainnet bug
Pin
--fork-block-number to the block where the issue occurred and replay the transaction locally with full debug access.Integration-test an upgrade
Fork the current testnet state, deploy your upgraded contract version locally, and run your full test suite against realistic surrounding state.
Historical regression testing
Pin the fork to a well-known block and commit the resulting JSON snapshot. Every CI run starts from an identical chain state regardless of what has happened on-chain since.
Combining fork mode with other flags
Fork mode composes with the rest of the local node feature set:Verifying fork state for an address
After starting in fork mode, look up a well-known mainnet or testnet address to confirm that state is being proxied correctly:Next steps
Persistence & Snapshots
Save a forked chain state to SQLite or export it as a JSON snapshot for reproducible CI runs.
Getting Started
Review the full startup workflow, faucet usage, and API verification steps.