diff --git a/docs/pages/build/framework/action/serialized-action.mdx b/docs/pages/build/framework/action/serialized-action.mdx index d9e6810..5ba9ba8 100644 --- a/docs/pages/build/framework/action/serialized-action.mdx +++ b/docs/pages/build/framework/action/serialized-action.mdx @@ -5,6 +5,7 @@ A serialized action is an action that encapsulates the execution and confirmatio ## Serialized Action A serialized action looks like this + ```typescript interface SerializedAction { name: string; @@ -19,12 +20,13 @@ interface SerializedAction { errors: ExecutionError[] | null; } ``` + - `name`: The name of the action sent. - `signature`: The signature of the action. This is used to authenticate the user who signed the action. - `msgSender`: The address of the user who sent the action. - `payload`: The data of the action. This is the actual data that the action is supposed to mutate the state with. -- `executionStatus`: The status of the execution of the action (Defaults to ``CREATED``). More on this [here](/build/framework/action/execution-status). -- `confirmationStatus`: The confirmation status for the action (Defaults to ``CX``). More on this [here](/build/framework/action/confirmation-status). +- `executionStatus`: The status of the execution of the action (Defaults to `CREATED`). More on this [here](/build/framework/action/execution-status). +- `confirmationStatus`: The confirmation status for the action (Defaults to `CX`). More on this [here](/build/framework/action/confirmation-status). - `isReverted`: A boolean flag to indicate if the action is reverted or not at the execution level. - `hash`: The keccak256 hash of the action. - `logs`: The logs generated for the action's execution. @@ -36,13 +38,13 @@ Every action contains Logs and Errors generated during the action execution. ### `action.logs` -Returns the execution logs for the action. If not null, the execution succeeded without any errors. It is null if the action has not yet been executed. Here the action is of type ``SerializedAction``. +Returns the execution logs for the action. If not null, the execution succeeded without any errors. It is null if the action has not yet been executed. Here the action is of type `SerializedAction`. **Type:** `ExecutionLog[] | null` ### `action.errors` -Returns any errors that occurred during the execution of the action. It is null if the action has not yet been executed. Here the action is of type ``SerializedAction``. +Returns any errors that occurred during the execution of the action. It is null if the action has not yet been executed. Here the action is of type `SerializedAction`. **Type:** `ExecutionError[] | null;` diff --git a/docs/pages/build/framework/block.mdx b/docs/pages/build/framework/block.mdx index 32db328..1a88ad2 100644 --- a/docs/pages/build/framework/block.mdx +++ b/docs/pages/build/framework/block.mdx @@ -54,6 +54,7 @@ interface BlockData { - `hooksRoot`: The root hash of a merkle tree of block hook names executed in the block. - `builderSignature`: The signature of the builder on the block. - `executionStatus`: The status of the block execution. It is an encoded value that represents which action succeeded and which failed. +- `batchInfo`: Metadata of the batch that includes this block. It is not populated by default and is later fetched from Vulcan (Verification layer). ### Block body attributes diff --git a/docs/pages/build/framework/config.mdx b/docs/pages/build/framework/config.mdx index e391071..5890c63 100644 --- a/docs/pages/build/framework/config.mdx +++ b/docs/pages/build/framework/config.mdx @@ -67,13 +67,13 @@ interface StackrConfig { name: string; version: string; salt: string; - }, + }; datastore: { - type?: 'sqlite' | 'postgres' | 'mysql' | 'mariadb'; + type?: "sqlite" | "postgres" | "mysql" | "mariadb"; uri: string; }; - preferredDA?: 'avail' | 'celestia'; - logLevel?: 'log' | 'error' | 'warn' | 'debug' | 'verbose'; + preferredDA?: "avail" | "celestia"; + logLevel?: "log" | "error" | "warn" | "debug" | "verbose"; } ``` @@ -155,7 +155,6 @@ with more support of data availability layers coming soon. No additional configu This is used for viewing the logs of the micro-rollup during runtime. Logs are a useful tool for debugging and monitoring the micro-rollup and checking for any errors. - ## Accessing config values It's not recommended to use the `stackrConfig` object defined above directly in your rollup code, other than for initializing `MicroRollup`. diff --git a/docs/pages/build/framework/micro-rollup-utils.mdx b/docs/pages/build/framework/micro-rollup-utils.mdx index 3c3bd3a..e98622d 100644 --- a/docs/pages/build/framework/micro-rollup-utils.mdx +++ b/docs/pages/build/framework/micro-rollup-utils.mdx @@ -98,18 +98,18 @@ Query and fetch list of actions along with their block data (if applicable) from - `filters`: Fields to filter on. - ```ts - interface ActionFilterParams { - name?: string; - schemaIdentifier?: string; - executionStatus?: ActionExecutionStatus | ActionExecutionStatus[]; - confirmationStatus?: ActionConfirmationStatus | ActionConfirmationStatus[]; - block?: { - status?: BlockStatus; - isReverted?: boolean; - }; - } - ``` + ```ts + interface ActionFilterParams { + name?: string; + schemaIdentifier?: string; + executionStatus?: ActionExecutionStatus | ActionExecutionStatus[]; + confirmationStatus?: ActionConfirmationStatus | ActionConfirmationStatus[]; + block?: { + status?: BlockStatus; + isReverted?: boolean; + }; + } + ``` - `orderAsc`: Whether the actions should be sorted in ascending or descending order of block height and position in block. Defaults to ascending order. diff --git a/docs/pages/build/framework/micro-rollup.mdx b/docs/pages/build/framework/micro-rollup.mdx index 2c4fd51..56e9f16 100644 --- a/docs/pages/build/framework/micro-rollup.mdx +++ b/docs/pages/build/framework/micro-rollup.mdx @@ -41,4 +41,4 @@ The Micro-Rollup object also takes in a few optional parameters 1. `stfSchemaMap` - A map of the STF names to the schema objects. This is used to map the schemas to the state transitions of the rollup. Defining this allows validation on action submission and auto-fill in Playground. -2. `blockHooks` - An object containing two keys `pre` and `post` both being ordered array of names of the `hooks` to execute with each block. \ No newline at end of file +2. `blockHooks` - An object containing two keys `pre` and `post` both being ordered array of names of the `hooks` to execute with each block. diff --git a/docs/pages/build/framework/sequencer.mdx b/docs/pages/build/framework/sequencer.mdx index d1765eb..6dc61bb 100644 --- a/docs/pages/build/framework/sequencer.mdx +++ b/docs/pages/build/framework/sequencer.mdx @@ -53,7 +53,7 @@ export class RandomStrategy extends BaseStrategy { * Create a new instance of RandomStrategy */ constructor() { - super('RandomOrder'); + super("RandomOrder"); } /** @@ -66,7 +66,7 @@ export class RandomStrategy extends BaseStrategy { return Promise.resolve( actions.sort(() => { return 0.5 - Math.random(); - }), + }) ); } } diff --git a/docs/pages/build/framework/state-machine/block-hooks.mdx b/docs/pages/build/framework/state-machine/block-hooks.mdx index 0f18d4a..319c640 100644 --- a/docs/pages/build/framework/state-machine/block-hooks.mdx +++ b/docs/pages/build/framework/state-machine/block-hooks.mdx @@ -74,9 +74,9 @@ There are 3 special variables which always exist inside the handler of a block h 1. `state` 2. `block` - - `block.height` - - `block.timestamp` - - `block.parentHash` + - `block.height` + - `block.timestamp` + - `block.parentHash` 3. `emit` {/* prettier-ignore */} diff --git a/docs/pages/build/guides/community-integrations.mdx b/docs/pages/build/guides/community-integrations.mdx new file mode 100644 index 0000000..b5aaa4d --- /dev/null +++ b/docs/pages/build/guides/community-integrations.mdx @@ -0,0 +1,21 @@ +# Community Integrations [What others are integrating] + +### [Integrating Oracles](https://github.com/Dhruv-2003/Oracles-mru-integration?tab=readme-ov-file) + +This integration allows you to feed external price data into the rollup, enabling state transitions based on live data from Chainlink, Chronicle, or Pyth. + +### [Integrating Wallet providers](https://github.com/Dhruv-2003/Walletprovider-mru-example?tab=readme-ov-file) + +This integration enables users to interact with the rollup using their preferred authentication methods, including social login, embedded wallets, self-custodial wallets, or WalletConnect. + +### [Integrating Cross Chain Bridging](https://github.com/Architsharma7/Bridges-Stackr) + +This integration helps set up cross-chain bridges for message passing and token bridging from any other chain to Stackr's micro-rollups using **Hyperlane**, **Axelar**, or **LayerZero**. + +### [Integrating Event Notifier via Wallet Messaging](https://github.com/Architsharma7/XMTP-MRU) + +This integration helps you build an event notifier for users of Stackr's micro-rollup using **XMTP**. + +### [Integration of Access Control](https://github.com/Architsharma7/Lit-Stackr) + +This integration allows you to add access control based on the micro-rollup's state using **Lit Actions** and session signatures. diff --git a/docs/pages/build/upgrade-guide.mdx b/docs/pages/build/upgrade-guide.mdx index ffa6ead..e46a02d 100644 --- a/docs/pages/build/upgrade-guide.mdx +++ b/docs/pages/build/upgrade-guide.mdx @@ -9,10 +9,12 @@ This page has instructions on upgrading your Micro-Rollup to a specific or lates This release introduces some changes in [`StackrConfig`](/build/framework/config) and [`MicroRollup`](/build/framework/micro-rollup). 1. In your `stackr.config.ts` file, + - Remove the line which imports the `deployment.json` file. The file is now directly read by the SDK. If you renamed this file, specify the path in `deploymentFile` field. -- Remove the `stackrApp` field. +- Remove the `stackrApp` field. - Remove `domain.chainId` and `domain.verifyingContract` fields. - Rename `enableEmptyBlocks` to `allowEmptyBlocks` in `sequencer` field. + 2. If you are passing any of `isSandbox`, `disableBuilder`, `disableVulcanSync` or `disableL1Sync` arguments to `MicroRollup`, they should be moved to the config now, in corresponding sections. ## Upgrading to v0.5.0 diff --git a/docs/pages/build/zero-to-one/build-your-first-mru.mdx b/docs/pages/build/zero-to-one/build-your-first-mru.mdx index 643c31e..f4788a4 100644 --- a/docs/pages/build/zero-to-one/build-your-first-mru.mdx +++ b/docs/pages/build/zero-to-one/build-your-first-mru.mdx @@ -89,7 +89,7 @@ Now let's dive into the `stackr.config.ts` file. - By default, the micro-rollup is configured to run in Sandbox mode (`isSandbox`). This is explained in the next section. - The main properties you might wish to tune here are `blockSize` and `blockTime` of your micro-rollup. -You can also set `allowEmptyBlocks` to `true` if you want your micro-rollup to always produce blocks every `blockTime` milliseconds (even when there are no actions). + You can also set `allowEmptyBlocks` to `true` if you want your micro-rollup to always produce blocks every `blockTime` milliseconds (even when there are no actions). ```ts [stackr.config.ts] sequencer: { blockSize: 16, @@ -155,7 +155,9 @@ We don't enforce any specific restrictions on the naming of the files, but keepi - `hooks.ts` contains the [Block Hooks](/build/framework/state-machine/block-hooks) for your application, if any. :::warning + It is recommended that the `machine.ts` or the file containing the `StateMachine` instance, doesn't import anything from `@stackr/sdk` instead uses `@stackr/sdk/machine` for the `StateMachine`, `State`, `Transitions` and other utility classes. + ::: ## Next Steps diff --git a/vocs.config.ts b/vocs.config.ts index 6f17c4f..464afba 100644 --- a/vocs.config.ts +++ b/vocs.config.ts @@ -233,6 +233,10 @@ export default defineConfig({ text: "Community Examples", link: "/build/guides/community-examples", }, + { + text: "Community Integrations", + link: "/build/guides/community-integrations", + }, { text: "Tutorials", collapsed: true,