Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion cn/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "快速开始"
description: "任何 Solana 程序都可以通过加入 delegation 能力升级为支持 Ephemeral Rollups。"

Check warning on line 3 in cn/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx#L3

Did you really mean 'Solana'?
---

import Endpoints from "/cn/snippets/endpoints.mdx";
Expand Down Expand Up @@ -236,7 +236,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
在 GitHub 上查看参考实现
Expand Down
6 changes: 3 additions & 3 deletions cn/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
<Card
title="GitHub"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests"
iconType="duotone"
>
Rust Counter 的测试
</Card>
<Card
title="GitHub"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/pinocchio-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/pinocchio/tests"
iconType="duotone"
>
Pinocchio Counter 的测试
Expand All @@ -55,8 +55,8 @@

## 分步指南

构建能够调用程序中 delegation 和 undelegation instruction 的有效交易。

Check warning on line 58 in cn/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx#L58

Did you really mean 'undelegation'?
该项目的完整测试可以在 [Typescript 测试脚本](https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests) 中找到。
该项目的完整测试可以在 [Typescript 测试脚本](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests) 中找到。

<Steps>
<Step
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: "Ephemeral Accounts"
description: "创建、调整大小并关闭完全存在于 Ephemeral Rollup 中的账户。"

Check warning on line 3 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L3

Did you really mean 'Rollup'?
---

Ephemeral accounts 是只存在于 Ephemeral Rollup 内部的账户。一个 **sponsor** 账户(已委托到 ER)会以 **32 lamports/byte** 的成本为 ephemeral accounts 代付租金,这比 Solana 基础租金便宜约 109 倍。

Check warning on line 6 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L6

Did you really mean 'Rollup'?

Check warning on line 6 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L6

Did you really mean 'Solana'?

**关键特性:**

- 完全在 ER 中创建、存在并销毁
- 归调用它的程序所有(从 CPI 上下文推断)
- 由 sponsor 账户的 lamports 提供资金

Check warning on line 12 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L12

Did you really mean 'lamports'?
- 可以被创建、调整大小和关闭

---
Expand Down Expand Up @@ -46,7 +46,7 @@
## 签名要求

- **Sponsor**:在所有操作(create、resize、close)中都必须是 signer
- **Ephemeral**:**仅在 create 时** 必须是 signer(防止 pubkey 抢注)。resize 或 close 时不要求。

Check warning on line 49 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L49

Did you really mean 'pubkey'?
- 对于 PDA 账户,macro 会通过 `find_program_address` 自动推导 signer seeds

---
Expand Down Expand Up @@ -260,7 +260,7 @@

<AccordionGroup>
<Accordion title="eph fields must use AccountInfo, not Account">
`eph` fields must use `AccountInfo<'info>`, not `Account<'info, T>`. The account doesn't exist yet at validation time, so Anchor cannot deserialize it.

Check warning on line 263 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L263

Did you really mean 'deserialize'?
</Accordion>
<Accordion title="Manual serialization is required after create">
After calling `create_ephemeral_*`, you must serialize your data struct into the raw account data yourself. The macro allocates space but does not write any data.
Expand All @@ -269,10 +269,10 @@
The macro enforces this at compile time. Use the generated `create_ephemeral_*` method instead of Anchor's `init` constraint.
</Accordion>
<Accordion title="Sponsor must be delegated first">
The sponsor account needs lamports on the ER to pay ephemeral rent. It must be delegated before creating ephemeral accounts.

Check warning on line 272 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L272

Did you really mean 'lamports'?
</Accordion>
<Accordion title="Top up the sponsor before delegation">
Transfer extra SOL to the sponsor account before delegating it, so it has enough lamports to fund ephemeral accounts on the ER.

Check warning on line 275 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L275

Did you really mean 'lamports'?
</Accordion>
<Accordion title="vault and magic_program are auto-injected">
You don't need to declare them in your struct, but they appear in the IDL and must be passed from the client. Anchor resolves them automatically if named correctly.
Expand All @@ -287,7 +287,7 @@
<Card
title="Ephemeral Accounts Demo"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/ephemeral-account-chats/programs/ephemeral-account-chats"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/ephemeral-account-chats/anchor/programs/ephemeral-account-chats"
iconType="duotone"
>
Full example program on GitHub
Expand All @@ -306,6 +306,6 @@
href="/cn/pages/ephemeral-rollups-ers/how-to-guide/quickstart"
iconType="duotone"
>
Build your first program with Ephemeral Rollups

Check warning on line 309 in cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L309

Did you really mean 'Rollups'?
</Card>
</CardGroup>
4 changes: 2 additions & 2 deletions cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
<Card
title="Anchor"
icon="anchor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
>
与 Anchor 程序集成
</Card>
<Card
title="Native Rust"
icon="rust"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rust-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust"
iconType="duotone"
>
与 Native Rust 程序集成
Expand All @@ -84,7 +84,7 @@
Magic Router 会分析每笔交易的元数据(例如 writable accounts、owner 和 signer),并自动将其路由到最近的专用端点:

<img class="w-full h-auto max-w-5xl" src="/images/magic-router-scenarios.png" />
1. **客户端 - 提交交易** dApp 或用户将交易发送到 Magic Router RPC 端点。

Check warning on line 87 in cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L87

Did you really mean 'dApp'?

2. **RPC - 检查元数据**
Magic Router 会检查交易元数据,并确认 writable accounts 的 owner。
Expand All @@ -92,7 +92,7 @@
3. **验证器 - 智能路由与执行**
路由器会根据元数据决定将交易发送到:

- **Ephemeral Rollup**:用于快速、低延迟、零成本执行

Check warning on line 95 in cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L95

Did you really mean 'Rollup'?
- **Solana**:用于持久化、高吞吐执行

Check warning on line 96 in cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L96

Did you really mean 'Solana'?

---
2 changes: 1 addition & 1 deletion cn/pages/ephemeral-rollups-ers/magic-actions/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
在 GitHub 上查看参考实现
Expand Down Expand Up @@ -70,7 +70,7 @@

<CardGroup cols={2}>
<Card
title="Quickstart Ephemeral Rollups"

Check warning on line 73 in cn/pages/ephemeral-rollups-ers/magic-actions/client.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/client.mdx#L73

Did you really mean 'Rollups'?
icon="play"
href="/cn/pages/ephemeral-rollups-ers/how-to-guide/quickstart"
iconType="duotone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import MagicActionExample from "/cn/snippets/magic-action-example.mdx";
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
在 GitHub 上查看参考实现
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
在 GitHub 上查看参考实现
Expand All @@ -24,8 +24,8 @@

### 什么是 Magic Actions?

Magic Actions 允许你附加一个或多个调用指令,它们会在 Ephemeral Rollup

Check warning on line 27 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L27

Did you really mean 'Rollup'?
(ER)提交后立即在 Solana 基础层自动执行。你可以将已提交的状态作为输入,在

Check warning on line 28 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L28

Did you really mean 'Solana'?
单笔交易中编排多步骤工作流。

- **状态同步**:将 ER 变更传播到基础层账户
Expand All @@ -35,8 +35,8 @@

### 工作原理

1. 将账户委托给 Ephemeral Rollup

Check warning on line 38 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L38

Did you really mean 'Rollup'?
2. 在 Ephemeral Rollup 上执行低延迟交易

Check warning on line 39 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L39

Did you really mean 'Rollup'?
3. 在保持委托状态的同时,附带指令操作提交到基础层
4. 处理器会使用刚提交的状态自动执行

Expand All @@ -44,11 +44,11 @@

### 另请参阅

Magic Actions 与 Ephemeral Rollups 配合使用。

Check warning on line 47 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L47

Did you really mean 'Rollups'?

<CardGroup cols={2}>
<Card
title="Ephemeral Rollups"

Check warning on line 51 in cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L51

Did you really mean 'Rollups'?
icon="bolt"
href="/cn/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup"
iconType="duotone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
### 限制与注意事项

- Handlers 在基础层执行,并消耗基础层费用
- 适用标准 Solana 限制(计算、账户锁)

Check warning on line 26 in cn/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx#L26

Did you really mean 'Solana'?
- 原子性:任一 action 失败都会回滚此次提交
- 前两个 action 账户会被自动注入(`escrow`、`escrow_auth`)

Expand All @@ -31,7 +31,7 @@

<CardGroup cols={2}>
<Card
title="Ephemeral Rollups"

Check warning on line 34 in cn/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx#L34

Did you really mean 'Rollups'?
icon="bolt"
href="/cn/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup"
iconType="duotone"
Expand All @@ -55,7 +55,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
在 GitHub 上查看参考实现
Expand Down
6 changes: 3 additions & 3 deletions cn/pages/get-started/how-integrate-your-program/anchor.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Anchor 示例"
description: "学习如何编写一个在 Solana 上递增计数器的简单 Anchor 程序"

Check warning on line 3 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L3

Did you really mean 'Solana'?
---

import Endpoints from "/cn/snippets/endpoints.mdx";
Expand Down Expand Up @@ -50,7 +50,7 @@
<Card
title="源代码:Anchor Counter 程序"
icon="anchor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
></Card>
<Card
Expand Down Expand Up @@ -102,7 +102,7 @@

### 委托 Counter PDA

为了将 counter PDA 委托出去,使其在 Ephemeral Rollup 会话中变为可写,我们需要添加一个内部调用 `delegate_account` 函数的 instruction。`delegate_account` 会通过 CPI 调用委托程序,验证通过后会接管该账户的所有权。

Check warning on line 105 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L105

Did you really mean 'Rollup'?
完成这一步后,临时验证者就可以开始处理 counter PDA 上的交易,并通过委托程序提交状态差异。

<Card
Expand All @@ -111,7 +111,7 @@
href="https://solscan.io/tx/5tyEk8gkdP88xe8GL7X12f9WGZfYZtmDbuXozvqkpea4rphXPiNp91vAzmSjsyUR399wimBYazEszKSH35sidPRH?cluster=devnet"
iconType="duotone"
>
在 Solana Explorer 上查看交易详情

Check warning on line 114 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L114

Did you really mean 'Solana'?
</Card>
```rust
/// Add delegate function to the context
Expand All @@ -128,7 +128,7 @@
```rust
/// Delegate the account to the delegation program
/// Set specific validator based on ER, see https://docs.magicblock.gg/pages/get-started/how-integrate-your-program/local-setup
pub fn delegate(ctx: Context<DelegateInput>) -> Result<()> {

Check warning on line 131 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L131

Did you really mean 'fn'?
ctx.accounts.delegate_pda(
&ctx.accounts.payer,
&[COUNTER_SEED],
Expand Down Expand Up @@ -161,13 +161,13 @@
href="https://solscan.io/tx/3xzMGbj2fwFCnGp6r7wyMv5LExmL6SXaEbt52DmxA3Wx1LyksuXpPJS4AAPtqoSeJe3aF7oY3jFNiEhBQKwhzRGN?cluster=devnet"
iconType="duotone"
>
在 Solana Explorer 上查看交易详情

Check warning on line 164 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L164

Did you really mean 'Solana'?
</Card>
</CardGroup>
```rust
use ephemeral_rollups_sdk::ephem::MagicIntentBundleBuilder;

/// Increment the counter and manually commit the account in the Ephemeral Rollup session.

Check warning on line 170 in cn/pages/get-started/how-integrate-your-program/anchor.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/anchor.mdx#L170

Did you really mean 'Rollup'?
pub fn increment_and_commit(ctx: Context<IncrementAndCommit>) -> Result<()> {
let counter = &mut ctx.accounts.counter;
counter.count += 1;
Expand Down Expand Up @@ -227,7 +227,7 @@
## 接入 React 客户端

React 客户端是一个简单的界面,让你可以与 Anchor 程序进行交互。
它使用 Anchor 绑定与程序通信,并通过 MagicBlock SDK 与 Ephemeral Rollup 会话交互。源代码与程序放在一起,位于 [`anchor-counter/app`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter/app)。
它使用 Anchor 绑定与程序通信,并通过 MagicBlock SDK 与 Ephemeral Rollup 会话交互。源代码与程序放在一起,位于 [`counter/anchor/app`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor/app)。

{" "}

Expand Down Expand Up @@ -268,7 +268,7 @@
<Card
title="源代码:Anchor Counter 程序"
icon="anchor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
></Card>
<Card
Expand Down
10 changes: 5 additions & 5 deletions cn/pages/get-started/how-integrate-your-program/rust.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Rust 示例"
description: "学习如何编写一个简单的、用于在 Solana 上委托并递增计数器的 Rust 程序"

Check warning on line 3 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L3

Did you really mean 'Solana'?
---

import Endpoints from "/cn/snippets/endpoints.mdx";
Expand Down Expand Up @@ -30,7 +30,7 @@
/>
</div>

本指南将带你编写一个简单的、不依赖 Anchor 的原生 Rust 程序,用来递增计数器。你将学习如何把这个程序部署到 Solana 上,并使用 TypeScript 测试脚本与之交互。

Check warning on line 33 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L33

Did you really mean 'Solana'?

## 软件包

Expand All @@ -38,7 +38,7 @@

| 软件 | 版本 | 安装指南 |
| ---------- | ------ | ------------------------------------------------------- |
| **Solana** | 3.1.9 | [安装 Solana](https://docs.anza.xyz/cli/install) |

Check warning on line 41 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L41

Did you really mean 'Solana'?
| **Rust** | 1.89.0 | [安装 Rust](https://www.rust-lang.org/tools/install) |

## 快速访问
Expand All @@ -49,13 +49,13 @@
<Card
title="源代码:原生 Rust Counter 程序"
icon="rust"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rust-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust"
iconType="duotone"
></Card>
<Card
title="源代码:TypeScript 测试脚本"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests"
iconType="duotone"
></Card>
</CardGroup>
Expand All @@ -72,7 +72,7 @@
1. `Delegate`:将 counter 从基础层委托到 ER(在基础层调用)
2. `CommitAndUndelegate`:调度从 ER 同步 counter 到基础层,并在 ER 上解除 counter 的委托(在 ER 上调用)
3. `Commit`:调度从 ER 同步 counter 到基础层(在 ER 上调用)
4. `Undelegate`:在基础层上解除 counter 的委托(由 validator 通过 CPI 在基础层调用)

Check warning on line 75 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L75

Did you really mean 'validator'?

下面是程序的核心结构:

Expand Down Expand Up @@ -131,13 +131,13 @@
```

<Note>
你的 "Undelegate" 指令必须使用上述精确的 discriminator。该指令不会由你直接调用,

Check warning on line 134 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L134

Did you really mean 'Undelegate'?
而是由基础层上的 validator 在解除你账户在 ER 上的委托后,通过 CPI 回调到你的程序。

Check warning on line 135 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L135

Did you really mean 'validator'?
</Note>

### 委托 Counter PDA

为了将 counter PDA 委托出去,使其在 Ephemeral Rollup 会话中变为可写,我们需要添加一个内部调用 `delegate_account` 函数的 instruction。`delegate_account` 会通过 CPI 调用委托程序,验证通过后会接管该账户的所有权。

Check warning on line 140 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L140

Did you really mean 'Rollup'?
完成这一步后,临时验证者就可以开始处理 counter PDA 上的交易,并通过委托程序提交状态差异。

<Card
Expand All @@ -145,7 +145,7 @@
icon="magnifying-glass"
href="https://solscan.io/tx/5jUdf5rsfQsbLYAahS9axrnLnEjdbUqtXUmGfgGuS7QqbYJ4FZHgXTNoT1bxPXp7XQu78r8Ebpp1RT2u9V6qsc1r?cluster=devnet"
iconType="duotone"
>在 Solana Explorer 上查看交易详情</Card>

Check warning on line 148 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L148

Did you really mean 'Solana'?
```rust
use solana_program::{
account_info::{next_account_info, AccountInfo},
Expand All @@ -157,7 +157,7 @@

// For Base Layer only
// Set specific validator based on ER, see https://docs.magicblock.gg/pages/get-started/how-integrate-your-program/local-setup
pub fn process_delegate(_program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult {

Check warning on line 160 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L160

Did you really mean 'fn'?
// Get accounts
let account_info_iter = &mut accounts.iter();
let initializer = next_account_info(account_info_iter)?;
Expand Down Expand Up @@ -219,7 +219,7 @@
href="https://solscan.io/tx/5fHBADq99LAEBzGoeDXGtN3ut8RBf2s5UhbDM1N6TMTpvADNeYLz8e8vinNWj1VhLhrR7UxFoW7bo2u6pBR3YRjj?cluster=devnet"
iconType="duotone"
>
在 Solana Explorer 上查看交易详情

Check warning on line 222 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L222

Did you really mean 'Solana'?
</Card>
</CardGroup>
```rust
Expand All @@ -233,7 +233,7 @@

// For ER only
pub fn process_commit(
_program_id: &Pubkey,

Check warning on line 236 in cn/pages/get-started/how-integrate-your-program/rust.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/get-started/how-integrate-your-program/rust.mdx#L236

Did you really mean '_program_id'?
accounts: &[AccountInfo],
) -> ProgramResult {
// Get accounts
Expand Down Expand Up @@ -358,7 +358,7 @@
## 测试程序

构建出可调用你程序中委托与解除委托相关 instruction 的有效交易。
该项目的完整测试代码可在 [TypeScript 测试脚本](https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests) 中查看。
该项目的完整测试代码可在 [TypeScript 测试脚本](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests) 中查看。

### 测试 `delegation` 交易

Expand Down Expand Up @@ -623,13 +623,13 @@
<Card
title="源代码:原生 Rust Counter 程序"
icon="rust"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rust-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust"
iconType="duotone"
></Card>
<Card
title="源代码:TypeScript 测试脚本"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests"
iconType="duotone"
></Card>
</CardGroup>
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/get-started/use-cases/payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description: "开启实时链上支付的新时代"
<Card
title="源代码"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/dummy-token-transfer"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/spl-tokens/anchor"
iconType="duotone"
>
进一步了解如何使用 MagicBlock 构建并集成链上支付!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "访问控制"
description: "了解如何在 Private Ephemeral Rollups 中管理细粒度访问控制和成员权限。"

Check warning on line 3 in cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx#L3

Did you really mean 'Rollups'?
---

import CreateEphemeralPermissionAnchor from "/cn/snippets/acl-code/ephemeral-permission/anchor/create.mdx";
Expand Down Expand Up @@ -40,7 +40,7 @@

## 概述

Private Ephemeral Rollups 是 [Ephemeral Rollups](/cn/pages/ephemeral-rollups-ers/introduction/why) 的一种形式,它在以[合规](/cn/pages/private-ephemeral-rollups-pers/introduction/compliance-framework)为核心的 [Trusted Execution Environment](/cn/pages/private-ephemeral-rollups-pers/introduction/onchain-privacy) 中,为受权限控制的账户提供细粒度权限管理。每个权限账户都会维护一份成员列表,并通过特定标志来决定这些成员可以执行哪些操作。

Check warning on line 43 in cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx#L43

Did you really mean 'Rollups'?

### 核心概念

Expand Down Expand Up @@ -82,7 +82,7 @@
## Ephemeral Permission

<Note>
`EphemeralPermission` 账户完全运行在 Ephemeral Rollup 上,由已委托的 PDA

Check warning on line 85 in cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx#L85

Did you really mean 'Rollup'?
承担租金——无需在 Base Layer 上创建、委托或 commit-and-undelegate
任何权限账户。三个 CPI 操作即可覆盖完整生命周期:**Create**、**Update**、**Close**,
全部由 ER 上的数据账户作为 PDA 签名,通过 MagicBlock 的 Permission Program
Expand Down Expand Up @@ -120,7 +120,7 @@
<Tab title="1. 创建 Ephemeral Permission">
通过 `CreateEphemeralPermissionCpi` 在 ER 上初始化一个新的 `EphemeralPermission`
账户。Payer = 已委托的数据 PDA,它使用其程序种子签名,并使用 `initialize`
时预先充值的 lamports 来支付租金。

Check warning on line 123 in cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx#L123

Did you really mean 'lamports'?

<Tabs>
<Tab title="Anchor">
Expand Down Expand Up @@ -215,9 +215,9 @@

<Tip>
参考实现:
[`private-counter`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/private-counter)
[`private-counter/anchor`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/private-counter/anchor)
(Anchor)和
[`pinocchio-private-counter`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/pinocchio-private-counter)。
[`private-counter/pinocchio`](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/private-counter/pinocchio)。
</Tip>

---
Expand All @@ -226,7 +226,7 @@

1. **Authority 管理**:始终至少为一位可信成员分配 `AUTHORITY_FLAG`
2. **最小权限原则**:仅向每位成员授予必要的标志
3. **实时更新**:权限可以在不取消委托的情况下于 Private Ephemeral Rollup 上实时更新,从而实现动态访问控制调整

Check warning on line 229 in cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/private-ephemeral-rollups-pers/how-to-guide/access-control.mdx#L229

Did you really mean 'Rollup'?
4. **清理**:取消委托并关闭未使用的权限账户,以释放 SOL

---
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/templates/counter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Card
title="查看仓库"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
>
查看源代码与实现
Expand All @@ -18,7 +18,7 @@

## 概览

使用 Ephemeral Rollups 在链上以低延迟追踪和更新计数器。这个简单示例展示了将 accounts 委托给 ephemeral rollups 并实现高频状态更新的核心概念。

Check warning on line 21 in cn/pages/templates/counter.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/counter.mdx#L21

Did you really mean 'Rollups'?

Check warning on line 21 in cn/pages/templates/counter.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/counter.mdx#L21

Did you really mean 'rollups'?

---

Expand All @@ -26,7 +26,7 @@

<CardGroup cols={2}>
<Card
title="Ephemeral Rollup"

Check warning on line 29 in cn/pages/templates/counter.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/counter.mdx#L29

Did you really mean 'Rollup'?
icon="gauge-max"
href="/cn/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup"
iconType="duotone"
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/templates/gachapon.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: Gachapon

Check warning on line 2 in cn/pages/templates/gachapon.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/gachapon.mdx#L2

Did you really mean 'Gachapon'?
---

<CardGroup cols={2}>
<Card
title="查看仓库"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/gachapon"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/gachapon-example"
iconType="duotone"
>
查看源代码与实现
Expand All @@ -19,7 +19,7 @@
autoPlay
muted
loop
playsInline

Check warning on line 22 in cn/pages/templates/gachapon.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/gachapon.mdx#L22

Did you really mean 'playsInline'?
className="w-full aspect-video"
src="/images/template_images/gachapon.mp4"
controls
Expand All @@ -27,7 +27,7 @@

## 概览

通过由 MagicBlock VRF 驱动的扭蛋机格式铸造 Metaplex NFT。该模板请求可验证随机性来选择奖品结果,然后铸造对应的 NFT,让每次抽取都不可预测、可审计,并适合游戏或收藏品掉落场景。

Check warning on line 30 in cn/pages/templates/gachapon.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/gachapon.mdx#L30

Did you really mean 'Metaplex'?

---

Expand Down Expand Up @@ -62,7 +62,7 @@
</Card>

<Card
title="Metaplex NFTs"

Check warning on line 65 in cn/pages/templates/gachapon.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/gachapon.mdx#L65

Did you really mean 'NFTs'?
icon="gem"
href="https://www.metaplex.com/docs/nfts"
iconType="duotone"
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/templates/onchain-dice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: 链上骰子
<Card
title="查看仓库"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/roll-dice"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/roll-dice/anchor"
iconType="duotone"
>
查看源代码与实现
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/templates/rock-paper-scissors.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Card
title="查看仓库"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rock-paper-scissor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rock-paper-scissor/anchor"
iconType="duotone"
>
查看源代码与实现
Expand All @@ -29,7 +29,7 @@

## 概览

使用 Private Ephemeral Rollups 玩保密的石头剪刀布。每次出招都保存在私有的 TEE 账户中,对手和 RPC 都无法读取——最后一位玩家出招的瞬间,胜负自动揭晓;任意一方都可以发起重赛,复用同一组账户,无需新的租金。

Check warning on line 32 in cn/pages/templates/rock-paper-scissors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/rock-paper-scissors.mdx#L32

Did you really mean 'Rollups'?

示例附带一个 Web 应用:既可以与机器人单人对战,也可以通过链接或二维码邀请好友双人对战。

Expand All @@ -39,7 +39,7 @@

<CardGroup cols={2}>
<Card
title="Private Ephemeral Rollup"

Check warning on line 42 in cn/pages/templates/rock-paper-scissors.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/templates/rock-paper-scissors.mdx#L42

Did you really mean 'Rollup'?
icon="shield-check"
href="/cn/pages/private-ephemeral-rollups-pers/introduction/onchain-privacy"
iconType="duotone"
Expand Down
2 changes: 1 addition & 1 deletion cn/pages/tools/crank/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

Cranks(计划任务)能够让链上指令按照预定时间**自动执行**,无需用户手动参与。在传统区块链系统中,每个操作都需要用户签名并提交交易,这限制了自动化能力。

借助 MagicBlock 的 Ephemeral Rollups,你可以安排任务按固定间隔自动执行,为 Solana 程序带来强大的自动化能力。

Check warning on line 10 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L10

Did you really mean 'Solana'?

## 核心优势

- **自动执行**:程序可以按预定间隔执行指令,无需用户交互
- **成本效率**:减少对链下 cron 任务或监控服务的依赖

Check warning on line 15 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L15

Did you really mean 'cron'?
- **去中心化**:执行发生在链上,保留无需信任的保障
- **可靠性**:计划任务会在区块链共识机制内可靠执行

Expand All @@ -35,7 +35,7 @@
<Card
title="代码示例"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/crank-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/crank-counter/anchor"
iconType="duotone"
>
查看我们的 GitHub 仓库
Expand All @@ -44,16 +44,16 @@

## 工作原理

Cranks 依托 MagicBlock 的 Ephemeral Rollups 提供计划执行能力:

Check warning on line 47 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L47

Did you really mean 'Rollups'?

1. 在 Solana 基础层上**初始化**程序状态

Check warning on line 49 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L49

Did you really mean 'Solana'?
2. 将账户**委托**给 Ephemeral Rollup,以获得更快执行
3. **安排**一个会自动执行指令的 crank 任务
4. 在指定间隔内自动**执行**
5. 完成后将账户**取消委托**回 Solana 基础层

Check warning on line 53 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L53

Did you really mean 'Solana'?

调度通过对 MagicBlock 调度程序的 Cross-Program Invocation(CPI)完成,由它负责实际的执行时机和可靠性。

<Callout type="info">
Crank 在 Ephemeral Rollup 的共识机制内执行,从而保证可靠且无需信任。更详细的实现步骤请参阅<a href="/cn/pages/tools/crank/implementation">实现方式</a>指南。

Check warning on line 58 in cn/pages/tools/crank/introduction.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

cn/pages/tools/crank/introduction.mdx#L58

Did you really mean 'Rollup'?
</Callout>
2 changes: 1 addition & 1 deletion cn/snippets/oncurve-delegation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import OncurveUndelegationKitCode from "/cn/snippets/oncurve-undelegation-kit.md
<Card
title="GitHub"
icon="wallet"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/oncurve-delegation"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/oncurve-delegation/client"
iconType="duotone"
>
曲线内账户委托
Expand Down
4 changes: 2 additions & 2 deletions cn/snippets/quick-access-er-rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<Card
title="GitHub"
icon="rust"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rust-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust"
iconType="duotone"
>
Native Rust 实现
</Card>
<Card
title="GitHub"
icon="face-lying"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/pinocchio-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/pinocchio"
iconType="duotone"
>
Pinocchio 实现
Expand Down
2 changes: 1 addition & 1 deletion cn/snippets/quick-access-er.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Card
title="GitHub"
icon="anchor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
>
Anchor 实现
Expand Down
2 changes: 1 addition & 1 deletion cn/snippets/quick-access-per.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Card
title="GitHub"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/private-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/private-counter/anchor"
iconType="duotone"
>
Private Counter 的 Anchor 实现
Expand Down
2 changes: 1 addition & 1 deletion cn/snippets/quick-access-vrf.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Card
title="GitHub"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/roll-dice"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/roll-dice/anchor"
iconType="duotone"
>
掷骰子示例仓库
Expand Down
2 changes: 1 addition & 1 deletion jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "クイックスタート"
description: "どの Solana プログラムでも、delegation 機能を追加することで Ephemeral Rollups に対応できます。"

Check warning on line 3 in jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx#L3

Did you really mean 'Solana'?

Check warning on line 3 in jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart.mdx#L3

Did you really mean 'Rollups'?
---

import Endpoints from "/jp/snippets/endpoints.mdx";
Expand Down Expand Up @@ -236,7 +236,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
GitHub 上の参考実装を見る
Expand Down
6 changes: 3 additions & 3 deletions jp/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
<Card
title="GitHub"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests"
iconType="duotone"
>
Rust Counter のテスト
</Card>
<Card
title="GitHub"
icon="js"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/pinocchio-counter/tests"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/pinocchio/tests"
iconType="duotone"
>
Pinocchio Counter のテスト
Expand All @@ -55,8 +55,8 @@

## ステップバイステップガイド

delegation と undelegation 用 instruction を呼び出す有効なトランザクションを組み立てます。

Check warning on line 58 in jp/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/how-to-guide/rust-tests.mdx#L58

Did you really mean 'undelegation'?
このプロジェクトの完全なテストは [Typescript Test Script](https://github.com/magicblock-labs/magicblock-engine-examples/blob/main/rust-counter/tests) にあります。
このプロジェクトの完全なテストは [Typescript Test Script](https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust/tests) にあります。

<Steps>
<Step
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
title: "Ephemeral Accounts"
description: "Ephemeral Rollup 上だけに存在するアカウントを作成・リサイズ・クローズします。"

Check warning on line 3 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L3

Did you really mean 'Rollup'?
---

Ephemeral accounts は Ephemeral Rollup 内にのみ存在するアカウントです。**sponsor** アカウント(ER に委任されている)が、**32 lamports/byte** で ephemeral accounts の rent を肩代わりします。これは Solana の基本 rent より約 109 倍安価です。

Check warning on line 6 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L6

Did you really mean 'Rollup'?

Check warning on line 6 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L6

Did you really mean 'Solana'?

**主な特性:**

- 生成から終了まで完全に ER 内で完結する
- 呼び出し元プログラムが所有する(CPI コンテキストから推論)
- sponsor アカウントの lamports で賄われる

Check warning on line 12 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L12

Did you really mean 'lamports'?
- 作成、リサイズ、クローズが可能

---
Expand Down Expand Up @@ -260,7 +260,7 @@

<AccordionGroup>
<Accordion title="eph fields must use AccountInfo, not Account">
`eph` fields must use `AccountInfo<'info>`, not `Account<'info, T>`. The account doesn't exist yet at validation time, so Anchor cannot deserialize it.

Check warning on line 263 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L263

Did you really mean 'deserialize'?
</Accordion>
<Accordion title="Manual serialization is required after create">
After calling `create_ephemeral_*`, you must serialize your data struct into the raw account data yourself. The macro allocates space but does not write any data.
Expand All @@ -269,10 +269,10 @@
The macro enforces this at compile time. Use the generated `create_ephemeral_*` method instead of Anchor's `init` constraint.
</Accordion>
<Accordion title="Sponsor must be delegated first">
The sponsor account needs lamports on the ER to pay ephemeral rent. It must be delegated before creating ephemeral accounts.

Check warning on line 272 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L272

Did you really mean 'lamports'?
</Accordion>
<Accordion title="Top up the sponsor before delegation">
Transfer extra SOL to the sponsor account before delegating it, so it has enough lamports to fund ephemeral accounts on the ER.

Check warning on line 275 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L275

Did you really mean 'lamports'?
</Accordion>
<Accordion title="vault and magic_program are auto-injected">
You don't need to declare them in your struct, but they appear in the IDL and must be passed from the client. Anchor resolves them automatically if named correctly.
Expand All @@ -287,7 +287,7 @@
<Card
title="Ephemeral Accounts Demo"
icon="github"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/ephemeral-account-chats/programs/ephemeral-account-chats"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/ephemeral-account-chats/anchor/programs/ephemeral-account-chats"
iconType="duotone"
>
Full example program on GitHub
Expand All @@ -306,6 +306,6 @@
href="/jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart"
iconType="duotone"
>
Build your first program with Ephemeral Rollups

Check warning on line 309 in jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/ephemeral-accounts.mdx#L309

Did you really mean 'Rollups'?
</Card>
</CardGroup>
4 changes: 2 additions & 2 deletions jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
<Card
title="Anchor"
icon="anchor"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/anchor-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/anchor"
iconType="duotone"
>
Anchor プログラムと統合する
</Card>
<Card
title="Native Rust"
icon="rust"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/rust-counter"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/counter/native-rust"
iconType="duotone"
>
Native Rust プログラムと統合する
Expand All @@ -84,15 +84,15 @@
Magic Router は各トランザクションのメタデータ(writable accounts、owner、signer など)を解析し、最適な専用エンドポイントへ自動ルーティングします。

<img class="w-full h-auto max-w-5xl" src="/images/magic-router-scenarios.png" />
1. **クライアント - トランザクション送信** dApp またはユーザーが Magic Router RPC エンドポイントへトランザクションを送信します。

Check warning on line 87 in jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L87

Did you really mean 'dApp'?

2. **RPC - メタデータ検査**
Magic Router はトランザクションメタデータを調べ、writable accounts の owner を確認します。

3. **Validator - スマートルーティングと実行**

Check warning on line 92 in jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L92

Did you really mean 'Validator'?
メタデータに基づいて、ルーターは次のどちらへ送るかを判断します。

- **Ephemeral Rollup**:高速・低レイテンシ・ゼロコスト実行向け

Check warning on line 95 in jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L95

Did you really mean 'Rollup'?
- **Solana**:永続的で高スループットな実行向け

Check warning on line 96 in jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/introduction/magic-router.mdx#L96

Did you really mean 'Solana'?

---
2 changes: 1 addition & 1 deletion jp/pages/ephemeral-rollups-ers/magic-actions/client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
GitHub でリファレンス実装を見る
Expand Down Expand Up @@ -70,7 +70,7 @@

<CardGroup cols={2}>
<Card
title="Quickstart Ephemeral Rollups"

Check warning on line 73 in jp/pages/ephemeral-rollups-ers/magic-actions/client.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/client.mdx#L73

Did you really mean 'Rollups'?
icon="play"
href="/jp/pages/ephemeral-rollups-ers/how-to-guide/quickstart"
iconType="duotone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import MagicActionExample from "/jp/snippets/magic-action-example.mdx";
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
GitHub でリファレンス実装を見る
Expand Down
2 changes: 1 addition & 1 deletion jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
GitHub でリファレンス実装を見る
Expand All @@ -24,8 +24,8 @@

### Magic Actions とは?

Magic Actions を使うと、Ephemeral Rollup

Check warning on line 27 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L27

Did you really mean 'Rollup'?
(ER)のコミット直後に Solana ベースレイヤー上で自動実行される 1 つ以上の呼び出し命令を追加できます。コミット済みの状態を入力として使い、単一トランザクションで複数ステップのワークフローを編成できます。

Check warning on line 28 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L28

Did you really mean 'Solana'?

- **状態同期**: ER の変更をベースレイヤーのアカウントへ反映
- **クロスプログラム構成**: コミット後に他のプログラムを呼び出す
Expand All @@ -34,8 +34,8 @@

### 仕組み

1. アカウントを Ephemeral Rollup に委任する

Check warning on line 37 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L37

Did you really mean 'Rollup'?
2. Ephemeral Rollup 上で低レイテンシーのトランザクションを実行する

Check warning on line 38 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L38

Did you really mean 'Rollup'?
3. 委任状態を維持したまま、アクション付き命令をベースレイヤーへコミットする
4. ハンドラーが最新のコミット済み状態を使って自動実行される

Expand All @@ -43,11 +43,11 @@

### 関連項目

Magic Actions は Ephemeral Rollups と組み合わせて動作します。

Check warning on line 46 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L46

Did you really mean 'Rollups'?

<CardGroup cols={2}>
<Card
title="Ephemeral Rollups"

Check warning on line 50 in jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/overview.mdx#L50

Did you really mean 'Rollups'?
icon="bolt"
href="/jp/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup"
iconType="duotone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
### 制限事項と考慮点

- ハンドラーはベースレイヤーで実行され、ベースレイヤー手数料を消費する
- 標準的な Solana 制限が適用される(compute、アカウントロック)

Check warning on line 26 in jp/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx#L26

Did you really mean 'Solana'?
- 原子性: いずれかのアクションが失敗するとコミット全体が巻き戻る
- 最初の 2 つのアクションアカウントは自動挿入される(`escrow`、`escrow_auth`)

Expand All @@ -31,7 +31,7 @@

<CardGroup cols={2}>
<Card
title="Ephemeral Rollups"

Check warning on line 34 in jp/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx

View check run for this annotation

Mintlify / Mintlify Validation (magicblock-42) - vale-spellcheck

jp/pages/ephemeral-rollups-ers/magic-actions/troubleshooting.mdx#L34

Did you really mean 'Rollups'?
icon="bolt"
href="/jp/pages/ephemeral-rollups-ers/introduction/ephemeral-rollup"
iconType="duotone"
Expand All @@ -55,7 +55,7 @@
<Card
title="Magic Actions Example"
icon="code"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions"
href="https://github.com/magicblock-labs/magicblock-engine-examples/tree/main/magic-actions/anchor"
iconType="duotone"
>
GitHub でリファレンス実装を見る
Expand Down
Loading
Loading