Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"@aptos-labs/ai-chatbot-client": "^0.1.4",
"@astrojs/node": "^9.5.0",
"@astrojs/partytown": "^2.1.4",
"@astrojs/react": "^4.4.0",
"@astrojs/react": "^4.4.2",
"@astrojs/sitemap": "^3.6.0",
"@astrojs/starlight": "^0.36.1",
"@astrojs/starlight-docsearch": "^0.6.0",
"@astrojs/starlight-tailwind": "^4.0.1",
"@astrojs/starlight": "^0.36.2",
"@astrojs/starlight-docsearch": "^0.6.1",
"@astrojs/starlight-tailwind": "^4.0.2",
"@astrojs/tailwind": "^6.0.2",
"@astrojs/vercel": "^8.2.10",
"@astrojs/vercel": "^8.2.11",
"@iconify/json": "^2.2.397",
"@nanostores/react": "^1.0.0",
"@octokit/graphql": "^9.0.2",
Expand All @@ -52,7 +52,7 @@
"@vercel/edge": "^1.2.2",
"@vercel/og": "^0.8.5",
"@vercel/speed-insights": "^1.2.0",
"astro": "^5.14.6",
"astro": "^5.15.8",
"astro-mermaid": "^1.1.0",
"class-variance-authority": "^0.7.1",
"firebase": "^12.4.0",
Expand Down Expand Up @@ -82,27 +82,27 @@
"@swc/core": "^1.13.5",
"@tailwindcss/vite": "^4.1.14",
"@types/gtag.js": "^0.0.20",
"@types/node": "^24.8.1",
"@types/node": "^24.10.1",
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"@types/react-syntax-highlighter": "^15.5.13",
"@vercel/node": "^5.4.1",
"astro-embed": "^0.9.1",
"@vercel/node": "^5.5.6",
"astro-embed": "^0.9.2",
"astro-eslint-parser": "^1.2.2",
"astro-favicons": "^3.1.5",
"astro-icon": "^1.1.5",
"astro-seo-schema": "^5.1.0",
"eslint": "^9.38.0",
"eslint": "^9.39.1",
"eslint-config-flat-gitignore": "^2.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-astro": "^1.3.1",
"eslint-plugin-astro": "^1.5.0",
"eslint-plugin-import-x": "^4.16.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"fast-glob": "^3.3.3",
"github-slugger": "^2.0.0",
"globals": "^16.4.0",
"graphiql": "^5.2.0",
"globals": "^16.5.0",
"graphiql": "^5.2.1",
"gray-matter": "^4.0.3",
"katex": "^0.16.25",
"kleur": "^4.1.5",
Expand Down Expand Up @@ -147,7 +147,9 @@
"path-to-regexp": ">=6.3.0",
"glob": "^11",
"devalue": ">=5.3.2",
"prismjs": ">=1.30.0"
"prismjs": ">=1.30.0",
"js-yaml": ">=4.1.1",
"tar": ">=7.5.2"
}
},
"simple-git-hooks": {
Expand Down
882 changes: 480 additions & 402 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions src/config/csp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const GOOGLE_FONTS_HOSTS = withHttps(["fonts.googleapis.com", "fonts.gstatic.com
* Content Security Policy configuration for Astro
*/
export const cspConfig = {
// ALLOWED_DIRECTIVES: readonly ["base-uri", "child-src", "connect-src", "default-src", "fenced-frame-src", "font-src", "form-action", "frame-ancestors", "frame-src", "img-src", "manifest-src", "media-src", "object-src", "referrer", "report-to", "report-uri", "require-trusted-types-for", "sandbox", "trusted-types", "upgrade-insecure-requests", "worker-src"];
directives: [
"default-src 'self'",
`img-src 'self' ${TWITTER_HOSTS} ${GOOGLE_HOSTS} ${GTM_HOST} ${GA_HOSTS} ${VERCEL_HOSTS} data: blob:`,
Expand All @@ -43,9 +44,10 @@ export const cspConfig = {
`connect-src 'self' ${APTOS_HOSTS} ${ALGOLIA_HOSTS} ${GOOGLE_HOSTS} ${GTM_HOST} ${GA_HOSTS} ${VERCEL_HOSTS} ${PUSHER_HOSTS} ${VERCEL_ANALYTICS_HOSTS}`,
`frame-src 'self' ${FIREBASE_HOSTS} ${VERCEL_HOSTS} ${VIDEO_HOSTS} ${STACKBLITZ_HOST}`,
`media-src 'self' ${TWITTER_HOSTS}`,
"style-src-attr 'unsafe-inline'",
`script-src-elem 'self' 'unsafe-inline' ${CDN_HOSTS} ${GOOGLE_HOSTS} ${GTM_HOST} ${VERCEL_HOSTS}`,
`style-src-elem 'self' 'unsafe-inline' ${VERCEL_HOSTS} ${GOOGLE_FONTS_HOSTS}`,
// TODO: These are currently disabled by Astro, if this changes, we would want to re-enable them.
//"style-src-attr 'unsafe-inline'",
//`script-src-elem 'self' 'unsafe-inline' ${CDN_HOSTS} ${GOOGLE_HOSTS} ${GTM_HOST} ${VERCEL_HOSTS}`,
//`style-src-elem 'self' 'unsafe-inline' ${VERCEL_HOSTS} ${GOOGLE_FONTS_HOSTS}`,
] as CspDirective[],
styleDirective: {
resources: ["'self'", VERCEL_HOSTS, "'unsafe-inline'"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ mise install aptos@7.9.0

If you are looking to install a specific version of the Aptos CLI, we suggest you use ASDF or Mise to handle it for
you.
{/*You can see the installation guide [here](/build/install-cli/install-cli-asdf)*/}

{/*You can see the installation guide [here](/build/install-cli/install-cli-asdf)*/}
</Aside>

If you need a specific version of the Aptos CLI, you can build it directly from the Aptos source code. This installation
Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/build/cli/working-with-move-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ The package will be published to your default profile in the CLI. You can overri
Please also note that when publishing Move modules, if multiple modules are in one package, then all modules in that package must use the same account. If they use different accounts, then the publishing will fail at the transaction level.

<Aside type="note" emoji="ℹ️">
By default, the CLI sends transactions to the remote fullnode for simulation.
By default, the CLI sends transactions to the remote fullnode for simulation.

To simulate locally, append the `--local` option to your command. You can also profile gas usage with the `--profile-gas` option.
To simulate locally, append the `--local` option to your command. You can also profile gas usage with the `--profile-gas` option.

See [Local Simulation, Benchmarking & Gas Profiling](/build/cli/working-with-move-contracts/local-simulation-benchmarking-and-gas-profiling) for details.
See [Local Simulation, Benchmarking & Gas Profiling](/build/cli/working-with-move-contracts/local-simulation-benchmarking-and-gas-profiling) for details.
</Aside>

<Aside type="caution">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,61 @@ to inspect transaction outputs with ease.
This makes it possible to test complex workflows — such as contract deployment, resource updates, or multi-step interactions.

<Aside type="note" emoji="ℹ️">
Before you get started, make sure you have updated your Aptos CLI to the latest version.
Before you get started, make sure you have updated your Aptos CLI to the latest version.

Older versions of the Aptos CLI may not support Transaction Simulation Sessions as it's a relatively new feature.
Older versions of the Aptos CLI may not support Transaction Simulation Sessions as it's a relatively new feature.
</Aside>

## Initializing a Session

You can initialize a session either from:

- **A clean local genesis**, for a completely local, isolated environment, or
- **A forked network state** (Devnet, Testnet, or Mainnet), allowing you to test your changes against real-world data.

Regardless of which mode you choose, the interface, commands, and how session data is saved are exactly the same.
Just specify your preferred mode when you initialize the session.

### From a Forked Network State

With network forking, you can test your Move code using **live network data** — balances, resources, and published modules.

To start with a forked network state, run:

```shellscript filename="Terminal"
aptos move sim init --path <SESSION_PATH> --network <NETWORK> --api-key <YOUR_API_KEY>
```

Here `<NETWORK>` can be one of the following: `devnet`, `testnet`, `mainnet`, or a custom fullnode URL.
The session will store all its data in the specified `<SESSION_PATH>` directory.

<Aside type="note" emoji="ℹ️">
You'll need a free Aptos developer account and an API key to use network forking mode.
Without an API key, you are given a very low rate limit and may run into rate limit errors almost certainly.
You'll need a free Aptos developer account and an API key to use network forking mode.
Without an API key, you are given a very low rate limit and may run into rate limit errors almost certainly.

You can follow the official instructions here: [Setup an API Key](/build/guides/build-e2e-dapp#setup-api-key).
You can follow the official instructions here: [Setup an API Key](/build/guides/build-e2e-dapp#setup-api-key).
</Aside>

### From a Clean Local Genesis

For day-to-day development, sometimes you just need a clean slate — no real network data needed.
This is perfect for ad-hoc simulation,synthetic testing, or continuous integration.

To start with a clean local genesis, run:

```shellscript filename="Terminal"
aptos move sim init --path <SESSION_PATH>
```

Everything else works the same — except that the simulation won't touch the network at all, as all data is local.

## Running simulations

Once initialized, you can run transactions against your session using the standard `aptos move` commands,
adding the `--session` argument to indicate which local session to use.

Supported commands include:

- `run`
- `run-script`
- `publish`
Expand All @@ -73,13 +83,15 @@ Supported commands include:
- `create-resource-account-and-publish-package`

There are also additional utilities under `aptos move sim` for managing and inspecting sessions.

- `fund`: fund an account with a given amount of APT
- `view-resource`: view a Move resource
- `view-resource-group`: view a resource group

For more detailed help, run `aptos move sim --help`.

### Example Workflow

```shellscript filename="Terminal"
# 1. Fund your default account with 1 APT (for demo)
aptos move sim fund --session sess --account default --amount 100000000
Expand All @@ -105,32 +117,37 @@ aptos move sim view-resource-group --session sess \
--resource-group 0x1::object::ObjectGroup \
--derived-object-address 0xA
```

Again, all state changes are local and are stored under your session directory.

## Inspecting Session Data

Each Transaction Simulation Session organizes its data in a structured directory tree, making it easy to inspect every step of your simulation.

Here's how the layout looks like for the sample session:

<FileTree>
- sess/
- [0] fund (fungible)/
- \[0] fund (fungible)/
- summary.json
- [1] execute 0x1::aptos_account::transfer/
- \[1] execute 0x1::aptos\_account::transfer/
- events.json
- summary.json
- write_set.json
- [2] view 0x1::account::get_sequence_number/
- write\_set.json
- \[2] view 0x1::account::get\_sequence\_number/
- summary.json
- [3] view resource 0xdbcb...::0x1::account::Account/
- \[3] view resource 0xdbcb...::0x1::account::Account/
- summary.json
- [4] view resource group 0x20ce...::0x1::object::ObjectGroup/
- \[4] view resource group 0x20ce...::0x1::object::ObjectGroup/
- summary.json
- config.json
- delta.json
</FileTree>

### Sample Outputs

`[1] execute 0x1::aptos_account::transfer/summary.json`

```json
{
"execute_transaction": {
Expand All @@ -148,7 +165,9 @@ Here's how the layout looks like for the sample session:
}
}
```

`[1] execute 0x1::aptos_account::transfer/events.json`

```json
[
{
Expand Down Expand Up @@ -185,7 +204,9 @@ Here's how the layout looks like for the sample session:
```

## Future Plans

We are working on adding more features to Transaction Simulation Sessions, such as:

- Gas Profiler integration
- Better performance
- Snapshot and rollback support
16 changes: 8 additions & 8 deletions src/content/docs/build/indexer/indexer-api/indexer-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ B-tree indexes are ordered and perform optimally when queries utilize a left-mos

Transactions filtered to user\_transactions (not system).

| Index Name | Indexed Columns |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| user\_transactions\_pkey | version |
| user\_transactions\_sender\_sequence\_number\_key | sender, sequence\_number |
| ut\_epoch\_index | epoch |
| ut\_insat\_index | inserted\_at |
| ut\_sender\_seq\_index | sender, sequence\_number |
| user\_transactions\_contract\_info\_index | entry\_function\_contract\_address, entry\_function\_module\_name, entry\_function_function\_name |
| Index Name | Indexed Columns |
| ------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| user\_transactions\_pkey | version |
| user\_transactions\_sender\_sequence\_number\_key | sender, sequence\_number |
| ut\_epoch\_index | epoch |
| ut\_insat\_index | inserted\_at |
| ut\_sender\_seq\_index | sender, sequence\_number |
| user\_transactions\_contract\_info\_index | entry\_function\_contract\_address, entry\_function\_module\_name, entry\_function\_function\_name |

### `block_metadata_transactions`

Expand Down
7 changes: 6 additions & 1 deletion src/content/docs/build/indexer/txn-stream/txn-filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,15 @@ grpcurl \
```

**Key Points:**

- The `transaction_filter` field is **optional** - you can stream all transactions by omitting it
- When supplied, only transactions matching the filter criteria will be returned
- The filter is applied server-side, reducing bandwidth and processing overhead for clients
- Filters are validated before being applied; invalid filters will result in an error response

## How It Works

The transaction filter system uses a declarative approach where you specify what you want to match using filters, and then combine them using boolean logic (AND, OR, NOT).
The transaction filter system uses a declarative approach where you specify what you want to match using filters, and then combine them using boolean logic (AND, OR, NOT).
Filters can be defined in:

- **Rust code** using builder patterns
Expand All @@ -102,6 +103,7 @@ There are three main types of filters you can use:
Filters transactions based on top-level transaction properties.

**Available Fields:**

- `success` (boolean): Whether the transaction succeeded or failed
- `txn_type` (enum): The type of transaction (User, Genesis, BlockMetadata, StateCheckpoint, Validator, BlockEpilogue)

Expand All @@ -120,6 +122,7 @@ Filters transactions based on top-level transaction properties.
Filters user-submitted transactions based on sender and entry function details.

**Available Fields:**

- `sender` (string): The account address that submitted the transaction
- `payload`: Filter on the entry function being called
- `function`: Entry function details
Expand Down Expand Up @@ -148,6 +151,7 @@ Filters user-submitted transactions based on sender and entry function details.
Filters transactions based on events they emit.

**Available Fields:**

- `struct_type`: Filter on the event's Move struct type
- `address` (string): Contract address
- `module` (string): Module name
Expand Down Expand Up @@ -527,6 +531,7 @@ The transaction filter system is optimized for high-throughput processing:
4. **Address Caching**: Address standardization is cached for performance

For best performance:

- Use specific filters when possible (e.g., filter by address rather than all transactions)
- Place more restrictive filters first in AND operations
- Consider the transaction volume on mainnet when designing filters
Loading