├── .github ├── auto_request_review.yml ├── dependabot.yml ├── pull_request_template.md └── workflows │ ├── auto_review_request.yml │ ├── build.yml │ ├── deploy.yml │ └── preview.yml ├── .gitignore ├── .vitepress ├── components │ ├── callout.vue │ ├── execution_callout.vue │ ├── keplr.png │ ├── keplr.vue │ ├── rosm.json │ └── twitter.vue ├── config.ts ├── constants │ └── constants.js └── theme │ ├── index.ts │ └── style.css ├── README.md ├── blog ├── overview.md ├── rollkit-the-first-sovereign-rollup-framework.md └── sovereign-rollups-on-bitcoin.md ├── guides ├── block-times.md ├── cometbft-to-rollkit.md ├── create-genesis.md ├── cw-orch.md ├── da-block-time.md ├── full-node.md ├── gas-price.md ├── ibc-connection.md ├── ignite-rollkit.md ├── lazy-sequencing.md ├── max-pending-blocks.md ├── metrics.md ├── overview.md ├── reset-state.md ├── restart-rollup.md ├── rollkit-monitoring.md ├── use-rollkit-cli.md ├── use-tia-for-gas.md └── zkml.md ├── index.md ├── learn ├── about.md ├── building-and-deploying-a-rollup.md ├── intro.md ├── specifications.md ├── stack.md └── transaction-flow.md ├── package-lock.json ├── package.json ├── public ├── artela-evm-rollkit │ └── artela-evm-rollkit.png ├── bitcoin-rollkit │ ├── rollkit-bitcoin-1.png │ ├── rollkit-bitcoin-2.png │ └── rollkit-bitcoin.png ├── cosmwasm │ └── init.sh ├── frontend-evm.png ├── gm │ ├── gm.png │ ├── init-arabica-testnet.sh │ ├── init-full-node.sh │ ├── init-local.sh │ ├── init-mainnet.sh │ └── init-mocha-testnet.sh ├── ibc │ └── init-osmosis-local.sh ├── img │ ├── Rollkit-cover.jpg │ ├── color-scheme.png │ ├── favicon-dark.ico │ ├── favicon-dark.png │ ├── favicon-dark.svg │ ├── favicon.png │ ├── favicon.svg │ ├── gm-world-frontend-wallet-connected.png │ ├── logo-big.svg │ ├── logo-dark.svg │ ├── logo.svg │ ├── sequencing.jpg │ └── transaction-flow.png ├── install-gm-rollup.sh ├── install-go.sh ├── install-jq.sh ├── install-local-da.sh ├── install-local-sequencer.sh ├── install-yarn.sh ├── install.sh ├── polaris-evm │ ├── polaris-evm.png │ └── polaris-start-site.png ├── range-rollkit │ ├── alert-events.png │ ├── alert-rule.png │ ├── custom-network.png │ └── import-address.png └── wordle │ ├── init.sh │ └── wordle.png ├── testnets ├── cosmwasm-testnet.md └── faucet.png ├── tutorials ├── bitcoin.md ├── da │ ├── avail-da.md │ ├── celestia-da.md │ ├── local-da.md │ └── overview.md ├── deploy-overview.md ├── docker-compose.md ├── execution │ ├── artela-evm-plus-plus.md │ ├── beaconkit.md │ ├── cosmwasm.md │ ├── evm-contract-interaction.md │ ├── octane-evm.md │ └── polaris-evm.md ├── gm-world.md ├── kurtosis.md ├── quick-start.md ├── sequencing │ ├── astria.md │ ├── based.md │ ├── centralized.md │ ├── forced-inclusion.md │ ├── local.md │ └── overview.md └── wordle.md └── yarn.lock /.github/auto_request_review.yml: -------------------------------------------------------------------------------- 1 | reviewers: 2 | defaults: 3 | - jcstein 4 | - rollkit 5 | groups: 6 | rollkit: 7 | - Manav-Aggarwal 8 | - tzdybal 9 | - gupadhyaya 10 | - tuxcanfly 11 | - yarikbratashchuk 12 | files: 13 | ".github/**": 14 | - jcstein 15 | - rollkit 16 | options: 17 | ignore_draft: true 18 | ignored_keywords: 19 | - WIP 20 | number_of_reviewers: 3 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: github-actions 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | labels: 9 | - T:dependencies 10 | # Group all patch updates into a single PR 11 | groups: 12 | patch-updates: 13 | applies-to: version-updates 14 | update-types: 15 | - "patch" 16 | - package-ecosystem: npm 17 | directory: "/" 18 | schedule: 19 | interval: weekly 20 | open-pull-requests-limit: 10 21 | labels: 22 | - T:dependencies 23 | # Group all patch updates into a single PR 24 | groups: 25 | patch-updates: 26 | applies-to: version-updates 27 | update-types: 28 | - "patch" 29 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | ## Overview 9 | 10 | 17 | -------------------------------------------------------------------------------- /.github/workflows/auto_review_request.yml: -------------------------------------------------------------------------------- 1 | name: Auto Review Request 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, ready_for_review] 6 | 7 | jobs: 8 | auto-add-reviewer: 9 | name: Auto add reviewer to PR 10 | uses: rollkit/.github/.github/workflows/reusable_housekeeping.yml@v0.5.0 11 | secrets: inherit 12 | permissions: 13 | issues: write 14 | pull-requests: write 15 | with: 16 | run-auto-request-review: true 17 | 18 | auto-add-assignee: 19 | # ignore dependabot PRs 20 | if: ${{ github.actor != 'dependabot[bot]' }} 21 | name: Assign issue and PR to creator 22 | runs-on: ubuntu-latest 23 | permissions: 24 | issues: write 25 | pull-requests: write 26 | steps: 27 | - name: Set pull_request url and creator login 28 | # yamllint disable rule:line-length 29 | run: | 30 | echo "PR=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV 31 | echo "CREATOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV 32 | # yamllint enable rule:line-length 33 | - name: Assign PR to creator 34 | run: gh pr edit ${{ env.PR }} --add-assignee ${{ env.CREATOR }} 35 | env: 36 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 37 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build VitePress Site 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | 8 | jobs: 9 | build: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | - name: Setup Node 15 | uses: actions/setup-node@v4 16 | with: 17 | node-version: 18 18 | cache: yarn # or pnpm / npm 19 | - name: Install dependencies 20 | run: yarn install # or pnpm install / npm ci 21 | - name: Build with VitePress 22 | run: yarn docs:build # or pnpm docs:build / npm docs:build 23 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # Sample workflow for building and deploying a VitePress site to GitHub Pages 2 | # 3 | name: Deploy VitePress site to Pages 4 | 5 | on: 6 | # Runs on pushes targeting the `main` branch. Change this to `master` if you're 7 | # using the `master` branch as the default branch. 8 | push: 9 | branches: [main] 10 | 11 | # Allows you to run this workflow manually from the Actions tab 12 | workflow_dispatch: 13 | 14 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 15 | permissions: write-all 16 | 17 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 18 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 19 | concurrency: 20 | group: pages 21 | cancel-in-progress: false 22 | 23 | jobs: 24 | # Build job 25 | build: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - name: Checkout 29 | uses: actions/checkout@v4 30 | with: 31 | fetch-depth: 0 # Not needed if lastUpdated is not enabled 32 | # - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm 33 | - name: Setup Node 34 | uses: actions/setup-node@v4 35 | with: 36 | node-version: 18 37 | cache: yarn # or pnpm / npm 38 | - name: Setup Pages 39 | uses: actions/configure-pages@v5 40 | - name: Install dependencies 41 | run: yarn install # or pnpm install / npm ci 42 | - name: Build with VitePress 43 | run: yarn docs:build # or pnpm docs:build / npm docs:build 44 | - name: Deploy to GitHub Pages 45 | uses: peaceiris/actions-gh-pages@v4 46 | with: 47 | github_token: ${{ secrets.GITHUB_TOKEN }} 48 | publish_dir: ./.vitepress/dist 49 | cname: rollkit.dev 50 | -------------------------------------------------------------------------------- /.github/workflows/preview.yml: -------------------------------------------------------------------------------- 1 | name: Deploy PR previews 2 | 3 | on: 4 | # This workflow requires pull_request and won't work with pull_request_target 5 | # due to github permissions 6 | pull_request: 7 | types: 8 | - opened 9 | - reopened 10 | - synchronize 11 | - closed 12 | 13 | concurrency: preview-${{ github.ref }} 14 | 15 | jobs: 16 | deploy-preview: 17 | runs-on: ubuntu-latest 18 | permissions: write-all 19 | steps: 20 | - name: Checkout 21 | uses: actions/checkout@v4 22 | 23 | - name: Setup Node 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 18 27 | cache: yarn 28 | 29 | - name: Install dependencies 30 | run: yarn install --frozen-lockfile 31 | 32 | - name: Build with Base URL 33 | run: BASE='/docs-preview/pr-${{ github.event.number }}/' yarn docs:build 34 | 35 | - name: Deploy preview 36 | uses: rossjrw/pr-preview-action@v1 37 | with: 38 | source-dir: .vitepress/dist 39 | deploy-repository: rollkit/docs-preview 40 | token: ${{ secrets.PREVIEW_DEPLOY }} 41 | preview-branch: main 42 | umbrella-dir: . 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vitepress/dist 2 | node_modules 3 | .vitepress/cache/** 4 | *.log 5 | *.tgz 6 | .DS_Store 7 | .idea 8 | .temp 9 | .vite_opt_cache 10 | .vscode 11 | -------------------------------------------------------------------------------- /.vitepress/components/callout.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /.vitepress/components/execution_callout.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /.vitepress/components/keplr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/.vitepress/components/keplr.png -------------------------------------------------------------------------------- /.vitepress/components/keplr.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /.vitepress/components/rosm.json: -------------------------------------------------------------------------------- 1 | { 2 | "rpc":"https://rpc.rosm.rollkit.dev", 3 | "rest":"https://api.rosm.rollkit.dev", 4 | "chainId":"rosm", 5 | "chainName":"Rollkit Cosmwasm Testnet", 6 | "stakeCurrency":{ 7 | "coinDenom":"ROSM", 8 | "coinMinimalDenom":"urosm", 9 | "coinDecimals":6 10 | }, 11 | "bech32Config":{ 12 | "bech32PrefixAccAddr":"wasm", 13 | "bech32PrefixAccPub":"wasmpub", 14 | "bech32PrefixValAddr":"wasmvaloper", 15 | "bech32PrefixValPub":"wasmvaloperpub", 16 | "bech32PrefixConsAddr":"wasmvalcons", 17 | "bech32PrefixConsPub":"wasmvalconspub" 18 | }, 19 | "bip44":{ 20 | "coinType":118 21 | }, 22 | "currencies":[ 23 | { 24 | "coinDenom":"ROSM", 25 | "coinMinimalDenom":"urosm", 26 | "coinDecimals":6 27 | } 28 | ], 29 | "feeCurrencies":[ 30 | { 31 | "coinDenom":"ROSM", 32 | "coinMinimalDenom":"urosm", 33 | "coinDecimals":6 34 | } 35 | ], 36 | "gasPriceStep":{ 37 | "low":0.05, 38 | "average":0.125, 39 | "high":0.2 40 | }, 41 | "features":[ 42 | "stargate", 43 | "no-legacy-stdTx", 44 | "ibc-transfer" 45 | ] 46 | } -------------------------------------------------------------------------------- /.vitepress/components/twitter.vue: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | 17 | -------------------------------------------------------------------------------- /.vitepress/constants/constants.js: -------------------------------------------------------------------------------- 1 | const constants = Object.freeze({ 2 | golangVersion: "go1.22.3", 3 | 4 | nodeVersion: "21.7.2", 5 | yarnVersion: "1.22.19", 6 | 7 | rollkitLatestTag: "v0.14.1", 8 | rollkitLatestSha: "5a8693e", 9 | rollkitCosmosSDKVersion: "v0.50.6-rollkit-v0.13.3-no-fraud-proofs", 10 | rollkitIgniteAppVersion: "rollkit/v0.2.1", 11 | 12 | localDALatestTag: "v0.3.1", 13 | goSequencingLatestTag: "v0.4.1", 14 | centralizedSequencerLatestTag: "v0.4.0", 15 | igniteVersionTag: "v28.5.3", 16 | 17 | celestiaNodeArabicaTag: "v0.20.2-arabica", 18 | celestiaNodeArabicaRollkitTag: "v0.14.1", 19 | celestiaNodeMochaTag: "v0.20.2-mocha", 20 | celestiaNodeMochaRollkitTag: "v0.14.1", 21 | celestiaNodeMainnetTag: "v0.17.2", 22 | celestiaNodeMainnetRollkitTag: "v0.13.7", 23 | }); 24 | export default constants; 25 | -------------------------------------------------------------------------------- /.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | // https://vitepress.dev/guide/custom-theme 2 | import { h } from 'vue' 3 | import Theme from 'vitepress/theme' 4 | import './style.css' 5 | 6 | export default { 7 | extends: Theme, 8 | Layout: () => { 9 | return h(Theme.Layout, null, { 10 | // https://vitepress.dev/guide/extending-default-theme#layout-slots 11 | }) 12 | }, 13 | enhanceApp({ app, router, siteData }) { 14 | // ... 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.vitepress/theme/style.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Customize default theme styling by overriding CSS variables: 3 | * https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css 4 | */ 5 | 6 | /** 7 | * Colors 8 | * -------------------------------------------------------------------------- */ 9 | 10 | :root { 11 | --vp-c-brand: #0c92f2; 12 | --vp-c-brand-light: #49adf5; 13 | --vp-c-brand-lighter: #85c8f8; 14 | --vp-c-brand-lightest: #c2e3fb; 15 | --vp-c-brand-dark: #096db5; 16 | --vp-c-brand-darker: #064979; 17 | --vp-c-brand-dimm: rgba(0, 181, 144, 0.08); 18 | } 19 | 20 | /** 21 | * Component: Button 22 | * -------------------------------------------------------------------------- */ 23 | 24 | :root { 25 | --vp-button-brand-border: var(--vp-c-brand-light); 26 | --vp-button-brand-text: var(--vp-c-white); 27 | --vp-button-brand-bg: var(--vp-c-brand); 28 | --vp-button-brand-hover-border: var(--vp-c-brand-light); 29 | --vp-button-brand-hover-text: var(--vp-c-white); 30 | --vp-button-brand-hover-bg: var(--vp-c-brand-light); 31 | --vp-button-brand-active-border: var(--vp-c-brand-light); 32 | --vp-button-brand-active-text: var(--vp-c-white); 33 | --vp-button-brand-active-bg: var(--vp-button-brand-bg); 34 | } 35 | 36 | /** 37 | * Component: Home 38 | * -------------------------------------------------------------------------- */ 39 | 40 | :root { 41 | --vp-home-hero-name-color: transparent; 42 | --vp-home-hero-name-background: -webkit-linear-gradient( 43 | 120deg, 44 | #096db5 30%, 45 | #3FA9F5 46 | ); 47 | 48 | --vp-home-hero-image-background-image: linear-gradient( 49 | -45deg, 50 | #096db5 50%, 51 | #3FA9F5 50% 52 | ); 53 | --vp-home-hero-image-filter: blur(40px); 54 | } 55 | 56 | @media (min-width: 640px) { 57 | :root { 58 | --vp-home-hero-image-filter: blur(56px); 59 | } 60 | } 61 | 62 | @media (min-width: 960px) { 63 | :root { 64 | --vp-home-hero-image-filter: blur(72px); 65 | } 66 | } 67 | 68 | /** 69 | * Component: Custom Block 70 | * -------------------------------------------------------------------------- */ 71 | 72 | :root { 73 | --vp-custom-block-tip-border: var(--vp-c-brand); 74 | --vp-custom-block-tip-text: var(--vp-c-brand-darker); 75 | --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); 76 | } 77 | 78 | .dark { 79 | --vp-custom-block-tip-border: var(--vp-c-brand); 80 | --vp-custom-block-tip-text: var(--vp-c-brand-lightest); 81 | --vp-custom-block-tip-bg: var(--vp-c-brand-dimm); 82 | } 83 | 84 | /** 85 | * Component: Algolia 86 | * -------------------------------------------------------------------------- */ 87 | 88 | .DocSearch { 89 | --docsearch-primary-color: var(--vp-c-brand) !important; 90 | } 91 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Deploy](https://github.com/rollkit/docs/actions/workflows/deploy.yml/badge.svg)](https://github.com/rollkit/docs/actions/workflows/deploy.yml) 2 | 3 | # Rollkit Documentation Site 4 | 5 | Welcome to the official documentation repository for Rollkit. 6 | 7 | Here you'll find comprehensive guides, tutorials, and reference materials to help you make the most out of Rollkit. 8 | 9 | ## Building the site 10 | 11 | To get started, clone the repository and run the following: 12 | 13 | ```bash 14 | yarn run docs:dev 15 | ``` 16 | 17 | This documentation site is built with [VitePress](https://vitepress.dev) 18 | 19 | ## Contribution Guidelines 20 | 21 | We love contributions from the community! Whether you're fixing typos, improving content clarity, or adding new topics, every contribution helps. 22 | 23 | * Fork & Clone: Fork this repository and clone it to your local machine. 24 | * Branch: Always create a new branch for your changes. Naming it relevantly. 25 | * Commit Changes: Make your changes and commit them with a clear and concise commit message. 26 | * Push & Create PR: Push your changes to your fork and create a pull request to the main branch of this repository. 27 | 28 | Please ensure you review the detailed Contribution Guidelines above before making a pull request. 29 | 30 | ## Directory Structure 31 | 32 | * /tutorials: Step-by-step instructions to help users build their own rollups with Rollkit. 33 | * /learn: Technical reference materials, such as configuration options and details about the Rollkit stack. 34 | * /blog: Blog posts for the Rollkit blog. 35 | 36 | * /public: Images, diagrams, and other media files used in the documentation. 37 | 38 | ## Feedback & Suggestions 39 | 40 | We value feedback from the community. If you have suggestions for improvements or find any discrepancies in the documentation, please raise an issue in this repository. 41 | -------------------------------------------------------------------------------- /blog/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This page provides an overview of all the blog posts. It serves as a central hub for all the blog content. 3 | --- 4 | 5 | # Blog 6 | 7 | Welcome to our blog! Here, you'll find a variety of articles on a range of topics. Use this overview to navigate through our content. 8 | 9 | ## Table of contents 10 | 11 | - [Sovereign rollups on Bitcoin with Rollkit](/blog/sovereign-rollups-on-bitcoin) 12 | - [Rollkit: The First Sovereign Rollup Framework](/blog/rollkit-the-first-sovereign-rollup-framework.md) 13 | 14 | Stay tuned for more exciting content! 15 | -------------------------------------------------------------------------------- /blog/rollkit-the-first-sovereign-rollup-framework.md: -------------------------------------------------------------------------------- 1 | --- 2 | head: 3 | - - meta 4 | - name: title 5 | content: "Rollkit: The First Sovereign Rollup Framework" 6 | - - meta 7 | - name: description 8 | content: Launch a sovereign, customizable blockchain as easily as a smart contract 9 | - - meta 10 | - name: keywords 11 | content: Rollkit, Cosmos-SDK 12 | --- 13 | 14 | 17 | 18 | # Rollkit: The First Sovereign Rollup Framework 19 | 20 | By Rollkit 21 | 22 | ![Rollkit blog cover](/img/Rollkit-cover.jpg) 23 | 24 | Bitcoin to Ethereum took 7 years. Ethereum to more scalable alt-L1s took 1–2 years. And then Cosmos SDK and CometBFT brought down time-to-launch a sovereign L1 to months. 25 | 26 | Now, Rollkit makes deploying any VM or application on its own sovereign chain as easy as typing **rollkit start**. 27 | 28 | 29 | 30 | Rollkit provides a path to one-click sovereignty for any crypto application, enabling any developer to launch their own [sovereign rollups](https://blog.celestia.org/sovereign-rollup-chains/) within seconds. 31 | 32 | Sovereign rollups combine the self-governance of a Layer 1 with the ease of deploying a rollup. They remove the need to recruit a secure validator set or bootstrap security by prematurely launching a token. Just like an independent L1, sovereign rollups retain the ability to hard fork which allows them to protect against hacks or bugs. This provides its community the ability to enforce social consensus and be sovereign. 33 | 34 | Without the overhead of a settlement layer, sovereign rollups can directly interoperate with shared security when using the same DA layer. 35 | 36 | By using a generic application interface like [ABCI++](https://docs.cometbft.com/v0.38/spec/abci/), Rollkit is compatible with the Cosmos SDK, the leading framework for building sovereign blockchains. This enables all Cosmos SDK developers to build a sovereign rollup and tap into all the powerful cosmos ecosystem tooling they’re used to including [IBC](https://www.ibcprotocol.dev/), [ABCI++](https://docs.cometbft.com/v0.38/spec/abci/), and Skip Protocol's [Slinky](https://docs.skip.money/slinky/overview/) and [BlockSDK](https://skip-protocol-docs.netlify.app/blocksdk/overview). 37 | 38 | Developers have full-freedom to deploy a VM or define their own execution environment, unconstrained by the overhead of an enshrined settlement layer that must process fraud or ZK proofs for their rollups. This means that instead of a canonical on-chain light client that comes with an enshrined settlement layer, sovereign rollups can define how they interoperate with other blockchains by having on-chain light clients of each other as needed. 39 | 40 | ## Take Control 41 | 42 | In the past, developers have been compelled to accept a degree of trust in convincing validators to organize and independently run nodes that secure a new blockchain. This requires launching premature tokens, inflating away their token supply in order to maintain incentive alignment with validators and offset their operational costs. This does not let developers focus on the core product they’re building. Sovereign rollups empower developers to get rid of this need to launch a token prematurely for bootstrapping a validator set and spending an excessively high amount of internal resources on blockchain development. 43 | 44 | Existing settled rollups come with the overhead of an enshrined settlement layer like Ethereum L1 where it is difficult and expensive to unwind a token on an L2 and move to another L2 without relying on trusted liquidity bridging intermediaries. This also comes with becoming subordinate to the social consensus of an enshrined settlement layer, which they may or may not align with. 45 | 46 | Sovereign rollups don’t need to settle to an external blockchain and can instead fully own their settlement. This allows them to protect against hacks and bugs, and facilitate upgrades via hard forks. They introduce rollup light clients that verify DA directly through data availability sampling and verify execution state proofs allowing asynchronous composability as needed. This in turn paves the path forward for trust-minimized interoperability between sovereign chains that share the same DA layer. 47 | 48 | Sovereign rollups remove the need to have a bridge contract that is upgradeable by an offchain council and instead allows the sovereign community to define rules via fully onchain governance. 49 | 50 | ## Build with the Best 51 | 52 | Cosmos SDK’s rich array of developer tooling, battle-tested and refined over the past several years, is available to Rollkit developers from day one. Developers can use popular [wallet infrastructure](https://cosmos.network/wallets/), [block explorers](https://cosmos.network/block-explorers/) and indexers supporting CometBFT RPCs, speak [IBC](https://www.ibcprotocol.dev/) across the interchain, have [Cosmwasm](https://cosmos.network/cosmwasm/) smart contracts along with [Abstract SDK](https://github.com/abstractsdk/abstract), utilize MEV and free lanes via the [BlockSDK](https://docs.skip.money/blocksdk/overview/) and enshrine oracles in block production with [Slinky](https://docs.skip.money/slinky/overview/) from Skip Protocol. [More cosmos related resources.](https://github.com/cosmos/awesome-cosmos) 53 | 54 | Rollkit rollups interact with a state machine via the Application Blockchain Interface ([ABCI++](https://docs.cometbft.com/v0.38/spec/abci/)). This allows it to be used as an alternative to CometBFT for any ABCI application. Rollkit comes with a [custom start handler](https://github.com/rollkit/cosmos-sdk-starter) that can be used by Cosmos SDK blockchains to use it as its ABCI client while still following the release branches of upstream Cosmos SDK. This compatibility enables developers to use tools like [abci-cli](https://docs.cometbft.com/v0.38/app-dev/abci-cli) to test and debug rollups. 55 | 56 | ## Optimize for your needs 57 | 58 | Rollkit allows developers to optimize between the different modular components of a sovereign chain as needed. Rollkit allows you to: 59 | 60 | - Choose between data availability layers that implement the [go-da interface](https://github.com/rollkit/go-da). 61 | 62 | - Choose any ABCI++ compatible virtual machine. 63 | - Utilize the Sequencing API to delegate sequencing to the shared sequencer network of your choice or even delegate sequencing to the DA layer to go [based](https://ethresear.ch/t/based-rollups-superpowers-from-l1-sequencing/15016). 64 | Choose between state validity modes: Pessimistic, Optimistic, or ZK or use a combination of both zk and optimistic schemes. 65 | Eliminate the need to launch a token or designate the native token or any token for gas fees. 66 | - Customize block time to just a couple hundred milliseconds and produce blocks only when needed. 67 | - Configure the fork choice rule. 68 | 69 | Rollkit rollups pay only for data availability on demand. There is no sequencer split required, nor will there ever be any kind of rent seeking model imposed on Rollkit rollups. Rollkit rollups preserve the advantages of a Cosmos SDK blockchain but reduce the overhead of deploying and maintaining a validator set. 70 | 71 | ## Break Free. Be Sovereign. 72 | 73 | [Get started](https://rollkit.dev/tutorials/quick-start) with launching your own sovereign chain with Rollkit. 74 | If you’re thinking of building a sovereign chain, we’d love to hear from you. Fill out this [form](https://forms.gle/yumLqipqr8weYmAb7). 75 | -------------------------------------------------------------------------------- /blog/sovereign-rollups-on-bitcoin.md: -------------------------------------------------------------------------------- 1 | --- 2 | head: 3 | - - meta 4 | - name: title 5 | content: "Sovereign rollups on Bitcoin with Rollkit" 6 | - - meta 7 | - name: description 8 | content: Today, we are proud to announce that Rollkit is the first rollup framework to support sovereign rollups on Bitcoin. This allows Rollkit rollups to use Bitcoin for data availability. The implementation is in alpha, but we invite curious developers to experiment with it. 9 | - - meta 10 | - name: keywords 11 | content: Rollkit, Celestia 12 | - - meta 13 | - name: og:image 14 | content: /img/Rollkit-cover.jpg 15 | --- 16 | 17 | # Sovereign rollups on Bitcoin with Rollkit 18 | 19 | By Rollkit 20 | 21 | ![rollkit-bitcoin](/bitcoin-rollkit/rollkit-bitcoin.png) 22 | _Originally published on 5 March 2023_ 23 | 24 | Today, we are proud to announce that Rollkit is the first rollup framework to support sovereign rollups on Bitcoin. An early research implementation allows Rollkit rollups to use Bitcoin for data availability. 25 | 26 | Rollkit is opening the door for developers to create rollups with arbitrary execution environments that inherit Bitcoin’s data availability guarantees and re-org resistance. With the new integration it is now possible to run the [EVM on Bitcoin as a Rollkit sovereign rollup](/docs/tutorials/bitcoin). Sovereign rollups on Bitcoin not only expand the possibilities for rollups, but also have the potential to help bootstrap a healthy blockspace fee market on Bitcoin, enabling a more sustainable security budget. 27 | 28 | ## Tl;dr 29 | 30 | - Sovereign rollups using Bitcoin for data availability are now a reality with Rollkit’s new early research integration. 31 | - Follow along with a [demo](#evm-on-bitcoin-demo) of the EVM running on Bitcoin as a sovereign Rollkit rollup. 32 | - The implementation was possible due to Bitcoin's Taproot upgrade and Ordinals' usage of Bitcoin for publishing arbitrary data. 33 | 34 | ## Posting data on Bitcoin with Taproot 35 | 36 | On Feb. 1, 2023, the Luxor mining pool mined the largest Bitcoin block (#774628) ever, approximately 4 MB. Most of the blockspace was used to inscribe a Taproot Wizards NFT with [Ordinals](https://ordinals.com/), a project that implements NFTs on Bitcoin by publishing the image data on-chain. 37 | 38 | Bitcoin NFTs use Taproot witnesses to inscribe arbitrary data, enabled by Bitcoin's Taproot upgrade. Taproot witnesses provide a slightly better payload-to-data ratio than SegWit transactions. A standard transaction can include up to around 390kB of arbitrary data while still passing through the public mempool. A non-standard transaction, included by a miner directly without passing through the mempool, can include close to 4MB of arbitrary data. In short, with SegWit, it became viable to post big blobs of data to the Bitcoin blockchain. 39 | 40 | Since then, the usage of Ordinals for NFT inscriptions and Taproot utilization has [kicked off](https://dune.com/dataalways/ordinals). Eric Wall found that at the time of [his tweet](https://twitter.com/ercwl/status/1619671451417862145), posting data on Bitcoin was 7x cheaper than Ethereum. Now that there are thousands of inscriptions on Bitcoin, it has become clear that sovereign rollups and an ecosystem of dapps on Bitcoin could become a reality. The missing piece: a rollup framework for easily integrating Bitcoin as a data availability layer. 41 | 42 | ## Integrating Bitcoin as a data availability layer into Rollkit 43 | 44 | Rollkit is a modular framework for rollups, where developers can plug-in custom execution layers and data availability layers. Initially, Rollkit only supported Celestia as an option for data availability and consensus. Now, Bitcoin is an option, thanks to an early research implementation of a Bitcoin data availability module for Rollkit. In this case, sovereign rollups manage their own execution and settlement while offloading consensus and data availability to Bitcoin. 45 | 46 | ![rollkit-bitcoin-rollup](/bitcoin-rollkit/rollkit-bitcoin-1.png) 47 | 48 | ## How Rollkit posts data to Bitcoin 49 | 50 | To write and read data on Bitcoin, we make use of Taproot transactions. To facilitate this, we implemented [a Go package called `bitcoin-da`](https://github.com/rollkit/bitcoin-da) that provides a reader/writer interface to Bitcoin. For details of how the interface works and how it uses Taproot, see [the specs](https://github.com/rollkit/rollkit-btc/blob/main/spec.md). The package can be re-used by any project that wants to read or write data on Bitcoin. 51 | 52 | Rollkit was built with modularity at its core. It has a data availability interface so that developers can simply implement specific methods to add a new data availability layer. To add a data availability layer, implementers need to satisfy the `DataAvailabilityLayerClient` interface which defines the behavior of the data availability client, and the `BlockRetriever` interface which defines how blocks can be synced. These interfaces live in the [da package](https://github.com/rollkit/rollkit/tree/main/da). The most important methods in these interfaces are `SubmitBlock` and `RetrieveBlock` for reading and writing the blocks. 53 | 54 | After implementing the Taproot reader/writer interface for Bitcoin (`bitcoin-da`), adding it as a data availability module for Rollkit took less than a day. We mostly only had to implement the `SubmitBlock` and `RetrieveBlocks` functions for Rollkit to call the `Read` and `Write` methods in `bitcoin-da`. 55 | 56 | ![rollkit-bitcoin-rollup-2](/bitcoin-rollkit/rollkit-bitcoin-2.png) 57 | 58 | ## EVM on Bitcoin demo 59 | 60 | Rollkit supports custom execution layers, including EVM, CosmWasm, or the Cosmos SDK. To test the integration, we used Rollkit to run the EVM (using Ethermint) as a sovereign rollup on a local Bitcoin test network. See below for a demo. 61 | 62 | 68 | 69 | ## Conclusion 70 | 71 | As we move towards a future where sovereign communities will form around different applications, asking them to incur the high cost and overhead of deploying a layer 1 blockchain to be sovereign is not sustainable. [Sovereign rollups](https://blog.celestia.org/sovereign-rollup-chains/) fix this by making it possible to deploy a sovereign chain that inherits the data availability and consensus of another layer 1 chain such as Bitcoin. 72 | 73 | Our goal with Rollkit is to make it easy to build and customize rollups. We invite you to play around Rollkit and build sovereign rollups on Bitcoin, or customize Rollkit with different execution environments and data availability layers. For details on how to run Rollkit with the Bitcoin data availability module, see the instructions [here](/docs/tutorials/bitcoin). Keep in mind that the integration is an early research implementation and it is not yet production-ready! 74 | 75 | Modularism, not maximalism. 76 | -------------------------------------------------------------------------------- /guides/block-times.md: -------------------------------------------------------------------------------- 1 | # How to change speed of block production 2 | 3 | If you have gone through both the [quick start tutorial](../tutorials/quick-start.md) and the 4 | [Full and sequencer node rollup setup](./full-and-sequencer-node) 5 | already, you're now ready to experiment with faster block times. 6 | 7 | In your `rollkit start [args...]` command, you will need to add a flag 8 | and then the argument for block time. 9 | 10 | The flag is: 11 | 12 | ```bash 13 | --rollkit.block_time 1s 14 | ``` 15 | 16 | Where `1s` can be adjusted to the speed of your choosing. 17 | 18 | Here is an example: 19 | 20 | ```bash 21 | # start the chain 22 | rollkit start [existing flags...] // [!code --] 23 | rollkit start [existing flags...] --rollkit.block_time 1s // [!code ++] 24 | ``` 25 | 26 | In the above example, we've changed it to one second blocks. 27 | Alternatively, you could slow your rollup down to 30 seconds: 28 | 29 | ```bash 30 | --rollkit.block_time 30s 31 | ``` 32 | 33 | Or speed it up even more, to sub-second block times (100 milliseconds): 34 | 35 | ```bash 36 | --rollkit.block_time 100ms 37 | ``` 38 | -------------------------------------------------------------------------------- /guides/cometbft-to-rollkit.md: -------------------------------------------------------------------------------- 1 | # How to Turn Your CometBFT App into a Rollkit App 2 | 3 | This guide will walk you through the process of turning your existing CometBFT app into a Rollkit app. By integrating Rollkit into your CometBFT-based blockchain, you can leverage enhanced modularity and data availability features. 4 | 5 | 6 | 10 | 11 | This guide assumes you have a CometBFT app set up and [Ignite CLI](https://docs.ignite.com) installed. 12 | 13 | ## Install Rollkit {#install-rollkit} 14 | 15 | You need to install Rollkit in your CometBFT app. Open a terminal in the directory where your app is located and run the following command: 16 | 17 | ```bash-vue 18 | ignite app install github.com/ignite/apps/rollkit@{{constants.rollkitIgniteAppVersion}} 19 | ``` 20 | 21 | ## Add Rollkit Features to Your CometBFT App {#add-rollkit-features} 22 | 23 | Now that Rollkit is installed, you can add Rollkit features to your existing blockchain app. Run the following command to integrate Rollkit: 24 | 25 | ```bash 26 | ignite rollkit add 27 | ``` 28 | 29 | ## Initialize Rollkit {#initialize-rollkit} 30 | 31 | To prepare your app for Rollkit, you'll need to initialize it. 32 | 33 | Run the following command to initialize Rollkit: 34 | 35 | ```bash 36 | ignite rollkit init 37 | ``` 38 | 39 | ## Initialize Rollkit CLI Configuration {#initialize-rollkit-cli-configuration} 40 | 41 | Next, you'll need to initialize the Rollkit CLI configuration by generating the `rollkit.toml` file. This file is crucial for Rollkit to understand the structure of your rollup. 42 | 43 | To create the `rollkit.toml` configuration, use this command: 44 | 45 | ```bash 46 | rollkit toml init 47 | ``` 48 | 49 | This command sets up the `rollkit.toml` file, where you can further customize configuration parameters as needed. 50 | 51 | ## Start Your Rollkit App {#start-rollkit-app} 52 | 53 | Once everything is configured, you can start your Rollkit-enabled CometBFT app or (simply rollkit app). Use the following command to start your blockchain: 54 | 55 | ```bash 56 | rollkit start --rollkit.aggregator 57 | ``` 58 | 59 | ## Summary 60 | 61 | By following this guide, you've successfully converted your CometBFT app into a Rollkit app. 62 | 63 | To learn more about how to config your DA, Sequencing, and Execution, please check out those tutorial sections. 64 | -------------------------------------------------------------------------------- /guides/create-genesis.md: -------------------------------------------------------------------------------- 1 | # How to create a genesis for your rollup 2 | 3 | This guide will walk you through the process of setting up a genesis for your rollup. Follow the steps below to initialize your rollup chain, add a genesis account, and start the chain. 4 | 5 | ## 0. Pre-requisities 6 | 7 | For this guide you need to have a chain directory where you have created and built your chain. 8 | 9 | If you don't have a chain directory yet, you can initialize a simple ignite chain by following [this guide](./ignite-rollkit.md) 10 | 11 | :::tip 12 | This guide will use the simple ignite chain created in linked guide. Make sure to update any relevant variables to match your chain. 13 | ::: 14 | 15 | ## 1. Setting variables 16 | 17 | First, set the necessary variables for your chain in the terminal, here is an example: 18 | 19 | ```sh 20 | VALIDATOR_NAME=validator1 21 | CHAIN_ID=gm 22 | KEY_NAME=rollup-key 23 | CHAINFLAG="--chain-id ${CHAIN_ID}" 24 | TOKEN_AMOUNT="10000000000000000000000000stake" 25 | STAKING_AMOUNT="1000000000stake" 26 | ``` 27 | 28 | ## 2. Rebuild your chain 29 | 30 | Ensure that `rollkit.toml` is present in the root of your rollup directory (if not, follow a [Guide](/guides/use-rollkit-cli) to set it up) and run the following command to (re)generate an entrypoint binary out of the code: 31 | 32 | ```sh 33 | rollkit rebuild 34 | ``` 35 | 36 | This (re)creates an `entrypoint` binary in the root of your rollup directory. which is used to run all the operations on the rollup chain. 37 | 38 | Ensure that the chain configuration directory is set correctly in the `rollkit.toml` file. 39 | 40 | For example: 41 | 42 | ```sh 43 | [chain] 44 | config_dir = "/Users/you/.gm" 45 | ``` 46 | 47 | :::tip 48 | You can always recreate the `rollkit.toml` file by deleting it and re-running the following command: 49 | 50 | ```sh 51 | rollkit toml init 52 | ``` 53 | ::: 54 | 55 | ## 3. Resetting existing genesis/chain data 56 | 57 | Reset any existing chain data: 58 | 59 | ```sh 60 | rollkit tendermint unsafe-reset-all 61 | ``` 62 | 63 | Reset any existing genesis data: 64 | 65 | ```sh 66 | rm -rf $HOME/.$CHAIN_ID/config/gentx 67 | rm $HOME/.$CHAIN_ID/config/genesis.json 68 | ``` 69 | 70 | ## 4. Initializing the validator 71 | 72 | Initialize the validator with the chain ID you set: 73 | 74 | ```sh 75 | rollkit init $VALIDATOR_NAME --chain-id $CHAIN_ID 76 | ``` 77 | 78 | ## 5. Adding a key to keyring backend 79 | 80 | Add a key to the keyring-backend: 81 | 82 | ```sh 83 | rollkit keys add $KEY_NAME --keyring-backend test 84 | ``` 85 | 86 | ## 6. Adding a genesis account 87 | 88 | Add a genesis account with the specified token amount: 89 | 90 | ```sh 91 | rollkit genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 92 | ``` 93 | 94 | ## 7. Setting the staking amount in the genesis transaction 95 | 96 | Set the staking amount in the genesis transaction: 97 | 98 | ```sh 99 | rollkit genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 100 | ``` 101 | 102 | ## 8. Collecting genesis transactions 103 | 104 | Collect the genesis transactions: 105 | 106 | ```sh 107 | rollkit genesis collect-gentxs 108 | ``` 109 | 110 | ## 9. Configuring the genesis file 111 | 112 | Copy the centralized sequencer address into `genesis.json`: 113 | 114 | ```sh 115 | ADDRESS=$(jq -r '.address' ~/.$CHAIN_ID/config/priv_validator_key.json) 116 | PUB_KEY=$(jq -r '.pub_key' ~/.$CHAIN_ID/config/priv_validator_key.json) 117 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.$CHAIN_ID/config/genesis.json > temp.json && mv temp.json ~/.$CHAIN_ID/config/genesis.json 118 | ``` 119 | 120 | ## 10. Starting the chain 121 | 122 | Finally, start the chain with your start command. 123 | 124 | For example, start the simple ignite chain with the following command: 125 | 126 | ```sh 127 | rollkit start --rollkit.aggregator --rollkit.sequencer_rollup_id $CHAIN_ID 128 | ``` 129 | 130 | ## Summary 131 | 132 | By following these steps, you will set up the genesis for your rollup, initialize the validator, add a genesis account, and started the chain. This guide provides a basic framework for configuring and starting your rollup using the Rollkit CLI. Make sure `rollkit.toml` is present in the root of your rollup directory, and use the `rollkit` command for all operations. 133 | -------------------------------------------------------------------------------- /guides/da-block-time.md: -------------------------------------------------------------------------------- 1 | # How to configure DA chain block syncing time 2 | 3 | The `--rollkit.da_block_time` flag is used to configure the time in seconds that the rollup will wait for a block to be synced from the DA chain. 4 | 5 | ```bash 6 | --rollkit.da_block_time duration 7 | ``` 8 | 9 | An example command would look like this: 10 | 11 | ```bash 12 | rollkit start [existing flags...] // [!code --] 13 | rollkit start [existing flags...] --rollkit.da_block_time=30s // [!code ++] 14 | ``` 15 | -------------------------------------------------------------------------------- /guides/full-node.md: -------------------------------------------------------------------------------- 1 | # Rollup Full Node Setup Guide 2 | 3 | ## Introduction 4 | 5 | This guide covers how to set up a full node to run alongside a sequencer node in a Rollkit-based blockchain network. A full node maintains a complete copy of the blockchain and helps validate transactions, improving the network's decentralization and security. 6 | 7 | ## Prerequisites 8 | 9 | Before starting, ensure you have: 10 | 11 | - A local Data Availability (DA) network node running on port `7980`. 12 | - A Rollkit sequencer node running and posting blocks to the DA network. 13 | - The Rollkit CLI installed on your system. 14 | 15 | ## Setting Up Your Full Node 16 | 17 | ### Initialize Chain Config and Copy Genesis File 18 | 19 | First, update the `config_dir` in the `rollkit.toml` file: 20 | 21 | ```bash 22 | [chain] 23 | config_dir = "/root/.yourrollupd" // [!code --] 24 | config_dir = "/root/.yourrollupd_fn" // [!code ++] 25 | ``` 26 | 27 | Let's set a terminal variable for the chain ID. 28 | 29 | ```sh 30 | CHAIN_ID=gm 31 | ``` 32 | 33 | Initialize the chain config for the full node, lets call it `FullNode` and set the chain ID to your rollup chain ID: 34 | 35 | ```bash 36 | rollkit init FullNode --chain-id=$CHAIN_ID 37 | ``` 38 | 39 | Copy the genesis file from the sequencer node: 40 | 41 | ```bash 42 | cp $HOME/.$CHAIN_ID/config/genesis.json $HOME/.${CHAIN_ID}_fn/config/genesis.json 43 | ``` 44 | 45 | ### Set Up P2P Connection to Sequencer Node 46 | 47 | Identify the sequencer node's P2P address from its logs. It will look similar to: 48 | 49 | ``` 50 | 1:55PM INF listening on address=/ip4/127.0.0.1/tcp/36656/p2p/12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh 51 | ``` 52 | 53 | Create an environment variable with the P2P address: 54 | 55 | ```bash 56 | export P2P_ID="12D3KooWJbD9TQoMSSSUyfhHMmgVY3LqCjxYFz8wQ92Qa6DAqtmh" 57 | ``` 58 | 59 | ### Start the Full Node 60 | 61 | We are now ready to run our full node. If we are running the full node on the same machine as the sequencer, we need to make sure we update the ports to avoid conflicts. 62 | 63 | Make sure to include these flags with your start command: 64 | 65 | ```sh 66 | --rpc.laddr tcp://127.0.0.1:46657 \ 67 | --grpc.address 127.0.0.1:9390 \ 68 | --p2p.laddr "0.0.0.0:46656" \ 69 | --api.address tcp://localhost:1318 70 | ``` 71 | 72 | Run your full node with the following command: 73 | 74 | ```bash 75 | rollkit start \ 76 | --rollkit.da_address http://127.0.0.1:7980 \ 77 | --p2p.seeds $P2P_ID@127.0.0.1:26656 \ 78 | --minimum-gas-prices 0stake \ 79 | --rpc.laddr tcp://127.0.0.1:46657 \ 80 | --grpc.address 127.0.0.1:9390 \ 81 | --p2p.laddr "0.0.0.0:46656" \ 82 | --api.address tcp://localhost:1318 \ 83 | --rollkit.sequencer_rollup_id gm 84 | ``` 85 | 86 | Key points about this command: 87 | - `rollkit.sequencer_rollup_id` is generally the `$CHAIN_ID`, which is `gm` in this case. 88 | - The ports and addresses are different from the sequencer node to avoid conflicts. Not everything may be necessary for your setup. 89 | - We use the `P2P_ID` environment variable to set the seed node. 90 | 91 | ## Verifying Full Node Operation 92 | 93 | After starting your full node, you should see output similar to: 94 | 95 | ``` 96 | 2:33PM DBG indexed transactions height=1 module=txindex num_txs=0 97 | 2:33PM INF block marked as DA included blockHash=7897885B959F52BF0D772E35F8DA638CF8BBC361C819C3FD3E61DCEF5034D1CC blockHeight=5532 module=BlockManager 98 | ``` 99 | 100 | This output indicates that your full node is successfully connecting to the network and processing blocks. 101 | 102 | :::tip 103 | If your rollup uses EVM as an execution layar and you see an error like `datadir already used by another process`, it means you have to remove all the state from rollup data directory (`/root/.yourrollup_fn/data/`) and specify a different data directory for the EVM client. 104 | ::: 105 | 106 | 107 | ## Conclusion 108 | 109 | You've now set up a full node running alongside your Rollkit sequencer. 110 | -------------------------------------------------------------------------------- /guides/gas-price.md: -------------------------------------------------------------------------------- 1 | # How to configure gas price 2 | 3 | In most cases, the gas price can be left to the defaults, which ensures that 4 | the price is greater than the minimum gas price accepted by the core node. 5 | 6 | The gas price can also be configured manually with the flag 7 | `--rollkit.da_gas_price`: 8 | 9 | ```bash 10 | rollkit start --rollkit.da_gas_price=0.1 [existing flags...] 11 | ``` 12 | 13 | This configures the rollup to always use the fixed gas price of `0.1utia/gas`. 14 | 15 | When running a rollup against a live network, the gas price may see 16 | occasional spikes during periods of high mempool congestion. 17 | 18 | To avoid such transient blob submission failures, the flag 19 | `--rollkit.da_gas_multiplier` may be used: 20 | 21 | ```bash 22 | rollkit start --rollkit.da_gas_price=0.1 --rollkit.da_gas_multiplier=1.2 [...] 23 | ``` 24 | 25 | This configures the rollup to keep increasing the gas price by a factor of 1.2x 26 | of the previous price until the transaction is accepted by the core node. 27 | 28 | When the blob submission transaction eventually succeeds, the gas price will 29 | gradually return to the default, decreasing by the same factor. 30 | 31 | The gas multiplier will only be used if the gas price has been manually 32 | configured. 33 | -------------------------------------------------------------------------------- /guides/ignite-rollkit.md: -------------------------------------------------------------------------------- 1 | # How to Use Ignite to Create a Rollkit App 2 | 3 | This guide will walk you through the process of using Ignite to create a Rollkit app. 4 | 5 | 6 | 10 | 11 | ## Install Ignite {#install-ignite} 12 | 13 | You can read more about Ignite [here](https://docs.ignite.com). 14 | 15 | To install Ignite, you can run this command in your terminal: 16 | 17 | ```bash-vue 18 | curl https://get.ignite.com/cli@{{constants.igniteVersionTag}}! | bash 19 | ``` 20 | 21 | Once Ignite is installed, scaffold a new blockchain with the following command: 22 | 23 | ```bash 24 | ignite scaffold chain gm --address-prefix gm --minimal --skip-proto 25 | ``` 26 | 27 | This will create the `gm` blockchain. Navigate to the blockchain directory: 28 | 29 | ```bash 30 | cd gm 31 | ``` 32 | 33 | ## Install Ignite App Rollkit {#install-ignite-app-rollkit} 34 | 35 | In a new terminal window, you'll now install and run the Ignite App Rollkit. 36 | 37 | Run the following command to install the Rollkit App: 38 | 39 | ```bash-vue 40 | ignite app install github.com/ignite/apps/rollkit@{{constants.rollkitIgniteAppVersion}} 41 | ``` 42 | 43 | This installs the Rollkit application, which will be integrated into your blockchain. 44 | 45 | ## Add Rollkit Features {#add-rollkit-features} 46 | 47 | Enhance your blockchain by adding Rollkit features. Use the following command: 48 | 49 | ```bash 50 | ignite rollkit add 51 | ``` 52 | 53 | ## Build your chain {#build-your-chain} 54 | 55 | Build your chain using the following command: 56 | 57 | ```bash 58 | ignite chain build 59 | ``` 60 | 61 | ## Initialize Your Blockchain {#initialize-your-blockchain} 62 | 63 | Before starting your blockchain, you need to initialize it with Rollkit support. Initialize the blockchain with Local DA as follows: 64 | 65 | ```bash 66 | ignite rollkit init 67 | ``` 68 | 69 | ### Initialize Rollkit CLI Configuration {#initialize-rollkit-cli-configuration} 70 | 71 | To initialize the Rollkit CLI configuration, generate the `rollkit.toml` file by running the following command: 72 | 73 | ```bash 74 | rollkit toml init 75 | ``` 76 | 77 | This will set up the Rollkit configuration file rollkit.toml, allowing you to use the Rollkit CLI for managing and running your blockchain. 78 | 79 | ## Start your chain {#start-your-chain} 80 | 81 | Now you are ready to start your chain. We need to include 2 flags: 82 | 83 | 1. `--rollkit.aggregator` to signal that this node is the block producer 84 | 2. `--rollkit.sequencer_rollup_id gm` to share the chain ID with the sequencer. 85 | 86 | Start your chain using the following command: 87 | 88 | ```bash 89 | rollkit start --rollkit.aggregator --rollkit.sequencer_rollup_id gm 90 | ``` 91 | 92 | Your rollkit chain is now up and running. 93 | 94 | ## Summary 95 | 96 | By following these steps, you've successfully installed Ignite, integrated Rollkit features into your blockchain, and configured the Rollkit CLI to run your chain against a mock DA and mock sequencer. 97 | -------------------------------------------------------------------------------- /guides/lazy-sequencing.md: -------------------------------------------------------------------------------- 1 | # How to Use Lazy Sequencing (Aggregation) 2 | 3 | In this guide, we'll go over how to use lazy sequencing. 4 | 5 | This feature was introduced in Rollkit v0.7.0 (with custom buffer time later in v0.13.7) and allows rollup operators to wait for transactions before building blocks. This prevents the rollup from building empty blocks. 6 | 7 | To turn on lazy sequencing, add the following flag to your start command: 8 | 9 | ```bash 10 | --rollkit.lazy_aggregator 11 | ``` 12 | 13 | Additionally, if you want to specify the time interval used for block production even if there are no transactions, use: 14 | 15 | ```bash 16 | --rollkit.lazy_block_time 17 | ``` 18 | 19 | An example command with a custom block time of 1 minute: 20 | 21 | ```bash 22 | # start the chain 23 | rollkit start [existing flags...] // [!code --] 24 | rollkit start [existing flags...] --rollkit.lazy_aggregator --rollkit.lazy_block_time=1m0s // [!code ++] 25 | ``` 26 | -------------------------------------------------------------------------------- /guides/max-pending-blocks.md: -------------------------------------------------------------------------------- 1 | # How to configure the maximum number of blocks pending DA submission 2 | 3 | The `--rollkit.max_pending_blocks` flag is used to configure the maximum limit of blocks pending DA submission (0 for no limit) 4 | 5 | ```bash 6 | --rollkit.max_pending_blocks uint 7 | ``` 8 | 9 | An example command would look like this: 10 | 11 | ```bash 12 | rollkit start [existing flags...] // [!code --] 13 | rollkit start [existing flags...] --rollkit.max_pending_blocks=100 // [!code ++] 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /guides/metrics.md: -------------------------------------------------------------------------------- 1 | # How to configure metrics 2 | 3 | Rollkit can report and serve the Prometheus metrics, which in their turn can 4 | be consumed by Prometheus collector(s). 5 | 6 | This functionality is disabled by default. 7 | 8 | To enable the Prometheus metrics, set `instrumentation.prometheus=true` in your 9 | CometBFT node's [config file](https://docs.cometbft.com/v0.38/core/configuration) 10 | located at `$CMTHOME/config/config.toml`. 11 | 12 | Metrics will be served under `/metrics` on 26660 port by default. 13 | The listening address (default: `localhost:26660`) can be changed in the config file using 14 | `instrumentation.prometheus_listen_addr`. 15 | 16 | ## List of available metrics 17 | 18 | The following metrics are available, grouped by their subsystem: 19 | 20 | ### ABCI 21 | 22 | | Name | Type | Tags | Description | 23 | |----------------------------------------------|-----------|-----------------------------|--------------------------------------------| 24 | | cometbft_abci_connection_method_timing_seconds | Histogram | chain_id, method, type | Timing for each ABCI method. | 25 | 26 | ### sequencer 27 | 28 | | Name | Type | Tags | Description | 29 | |--------------------------------------|-------|----------|------------------------------| 30 | | cometbft_sequencer_height | Gauge | chain_id | Height of the chain. | 31 | | cometbft_sequencer_num_txs | Gauge | chain_id | Number of transactions. | 32 | | cometbft_sequencer_block_size_bytes | Gauge | chain_id | Size of the block. | 33 | | cometbft_sequencer_total_txs | Gauge | chain_id | Total number of transactions. | 34 | | cometbft_sequencer_latest_block_height | Gauge | chain_id | The latest block height. | 35 | 36 | ### mempool 37 | 38 | | Name | Type | Tags | Description | 39 | |------------------------------------------|-----------|----------|--------------------------------------------------------------------------------| 40 | | cometbft_mempool_size | Gauge | chain_id | Size of the mempool (number of uncommitted transactions). | 41 | | cometbft_mempool_size_bytes | Gauge | chain_id | Total size of the mempool in bytes. | 42 | | cometbft_mempool_tx_size_bytes | Histogram | chain_id | Transaction sizes in bytes. | 43 | | cometbft_mempool_failed_txs | Counter | chain_id | Number of failed transactions. | 44 | | cometbft_mempool_rejected_txs | Counter | chain_id | Number of rejected transactions. | 45 | | cometbft_mempool_evicted_txs | Counter | chain_id | Number of evicted transactions. | 46 | | cometbft_mempool_recheck_times | Counter | chain_id | Number of times transactions are rechecked in the mempool. | 47 | 48 | ### p2p 49 | 50 | | Name | Type | Tags | Description | 51 | |--------------------------------------|---------|---------------------|--------------------------------------------------| 52 | | cometbft_p2p_peers | Gauge | chain_id | Number of peers. | 53 | | cometbft_p2p_peer_receive_bytes_total| Counter | peer_id, chID | Number of bytes received from a given peer. | 54 | | cometbft_p2p_peer_send_bytes_total | Counter | peer_id, chID | Number of bytes sent to a given peer. | 55 | | cometbft_p2p_peer_pending_send_bytes | Gauge | peer_id | Pending bytes to be sent to a given peer. | 56 | | cometbft_p2p_num_txs | Gauge | peer_id | Number of transactions submitted by each peer. | 57 | | cometbft_p2p_message_receive_bytes_total | Counter | message_type | Number of bytes of each message type received. | 58 | | cometbft_p2p_message_send_bytes_total | Counter | message_type | Number of bytes of each message type sent. | 59 | 60 | In addition to these, [go-libp2p metrics](https://github.com/libp2p/go-libp2p/tree/master/dashboards) are exported as well. 61 | 62 | ### state 63 | 64 | | Name | Type | Tags | Description | 65 | |--------------------------------------------|-----------|----------|--------------------------------------------------------------------------| 66 | | cometbft_state_block_processing_time | Histogram | chain_id | Time spent processing FinalizeBlock. | 67 | | cometbft_state_consensus_param_updates | Counter | chain_id | Number of consensus parameter updates returned by the application since process start. | 68 | 69 | ## centralized-sequencer 70 | 71 | The `centralized-sequencer` has its own metrics and configuration, see the [centralized sequencer docs](guides/centralized-sequencer) for details. 72 | -------------------------------------------------------------------------------- /guides/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This page provides a comprehensive overview of the how to guides available for Rollkit. 3 | --- 4 | 5 | # How To Guides 6 | 7 | Welcome to the Rollkit guides section! Here, you'll find a wide range of guides 8 | designed to help you understand and effectively use Rollkit, the first sovereign 9 | rollup framework. 10 | 11 | Hopefully you've gone through some of the tutorials and are ready to dive 12 | deeper. These guides will go into detail on some specific topics that will make 13 | your life easier when developing with Rollkit. 14 | 15 | In this section, you'll find: 16 | 17 | * [Use the Rollkit CLI](/guides/use-rollkit-cli) 18 | * [Create genesis for your rollup](/guides/create-genesis) 19 | * [Restart your rollup](/guides/restart-rollup) 20 | * [Run a rollup full node](/guides/full-node) 21 | * [Run a centralized sequencer](/guides/centralized-sequencer) 22 | * [Turn your CometBFT app into a Rollkit app](/guides/cometbft-to-rollkit) 23 | * [Use Ignite to create a Rollkit app](/guides/ignite-rollkit) 24 | * Configuration 25 | * [Configure gas price](/guides/gas-price) 26 | * [Configure max pending blocks](/guides/max-pending-blocks) 27 | * [Configure DA chain block sync time](/guides/da-block-time) 28 | * [Change speed of block production](/guides/block-times) 29 | * [Use lazy sequencing (aggregation)](/guides/lazy-sequencing) 30 | * [Configure Prometheus metrics](/guides/metrics) 31 | * Integrations 32 | * [Test and deploy cosmwasm smart-contracts](/guides/cw-orch) 33 | * [Add zkML to your EVM rollup](/guides/zkml) 34 | * [Add an IBC connection to your rollup](/guides/ibc-connection) 35 | * [Integrate Range with your rollup](/guides/rollkit-monitoring) 36 | * [Use IBC token (TIA) as gas token in your rollup](/guides/use-tia-for-gas) 37 | 38 | 39 | 40 | ## 💻 Support {#support} 41 | 42 | The guides will explore developing with Rollkit, which is still in Alpha stage. 43 | If you run into bugs, please write a GitHub 44 | [issue](https://github.com/rollkit/docs/issues/new) or let us know in our 45 | [Telegram](https://t.me/rollkit). 46 | -------------------------------------------------------------------------------- /guides/reset-state.md: -------------------------------------------------------------------------------- 1 | # How to reset the state of your chain 2 | 3 | This guide will walk you through how you reset the state of your chain. 4 | 5 | :::warning Disclaimer 6 | By definition, resetting the state is deleting your chain's data. Make sure you understand the implications of this prior to completing this guide. 7 | ::: 8 | 9 | Some reason you might need to reset the state of your chain are: 10 | * During testing and development 11 | * During upgrades with breaking changes 12 | * Hardforks 13 | 14 | ## Prerequisites 15 | 16 | In order to complete this guide, you will need to have completed either the [quick start tutorial](/tutorials/quick-start.md) or the [build our chain tutorial](/tutorials/wordle.md). 17 | 18 | ## Quick Start 19 | 20 | When you run your chain with `rollkit start` you will create a `.rollkit` directory in your root directory. 21 | 22 | This directory will look like the following. 23 | 24 | ```bash 25 | tree $HOME/.rollkit 26 | 27 | ├── config 28 | │   ├── config.toml 29 | │   ├── genesis.json 30 | │   ├── node_key.json 31 | │   └── priv_validator_key.json 32 | └── data 33 | ├── priv_validator_state.json 34 | └── rollkit 35 | ├── 000001.sst 36 | ├── 000001.vlog 37 | ├── 000002.sst 38 | ├── 000002.vlog 39 | ├── DISCARD 40 | ├── KEYREGISTRY 41 | └── MANIFEST 42 | ``` 43 | 44 | To reset the state of the chain, delete the entire `.rollkit` directory. 45 | 46 | ```bash 47 | rm -rf $HOME/.rollkit 48 | ``` 49 | 50 | When you launch your chain again with `rollkit start` your `.rollkit` directory will be re-created and you will see your chain starting at block height 1 again. 51 | 52 | ## Wordle 53 | 54 | When you ran your wordle chain in the [build your chain tutorial](/tutorials/wordle.md), it created a `.wordle` directory. 55 | 56 | This directory will look like the following: 57 | 58 | ```bash 59 | tree $HOME/.wordle 60 | 61 | ├── config 62 | │   ├── app.toml 63 | │   ├── client.toml 64 | │   ├── config.toml 65 | │   ├── genesis.json 66 | │   ├── gentx 67 | │   │   └── gentx-6e46bd1f53acead98b43e63fcf2bd5435499350d.json 68 | │   ├── node_key.json 69 | │   └── priv_validator_key.json 70 | ├── data 71 | │   ├── application.db 72 | │   │   ├── 000001.log 73 | │   │   ├── CURRENT 74 | │   │   ├── LOCK 75 | │   │   ├── LOG 76 | │   │   └── MANIFEST-000000 77 | │   ├── priv_validator_state.json 78 | │   ├── rollkit 79 | │   │   ├── 000001.sst 80 | │   │   ├── 000001.vlog 81 | │   │   ├── DISCARD 82 | │   │   ├── KEYREGISTRY 83 | │   │   └── MANIFEST 84 | │   └── snapshots 85 | │   └── metadata.db 86 | │   ├── 000001.log 87 | │   ├── CURRENT 88 | │   ├── LOCK 89 | │   ├── LOG 90 | │   └── MANIFEST-000000 91 | └── keyring-test 92 | ├── 4a90e750914792c2d7f98775c13a588d9d304bd0.address 93 | ├── 53dab037ac3bd380f4a9192b2c6eedbe95fce180.address 94 | ├── alice.info 95 | └── bob.info 96 | ``` 97 | 98 | The directories you need to delete to reset your state are in the `.wordle/data` directory. 99 | 100 | ```bash 101 | $HOME/.wordle/data/application.db 102 | $HOME/.wordle/data/rollkit 103 | $HOME/.wordle/data/snapshots 104 | ``` 105 | 106 | You can delete them with the following command: 107 | 108 | ```bash 109 | rollkit tendermint unsafe-reset-all 110 | ``` 111 | 112 | When you launch your chain again with your `rollkit start ` command, these data directories will be re-created and you will see your chain starting at block height 1 again. 113 | -------------------------------------------------------------------------------- /guides/restart-rollup.md: -------------------------------------------------------------------------------- 1 | # 🔄 How to restart your rollup 2 | 3 | This guide will teach you how to restart your Rollkit rollup. 4 | 5 | ## Restart rollup 6 | 7 | This section covers the case where you need to restart your rollup. 8 | 9 | In order to restart your rollup, you simply need to run the `d start [...args]` 10 | command for your rollup. 11 | 12 | For example, if you ran the [quick start](../tutorials/quick-start.md) tutorial, you started your rollup with: 13 | 14 | ```bash 15 | rollkit start 16 | ``` 17 | 18 | You would have see output similar to: 19 | 20 | ```bash 21 | I[2024-10-17|14:52:12.845] Creating and publishing block module=BlockManager height=7 22 | I[2024-10-17|14:52:12.845] finalized block module=BlockManager height=7 num_txs_res=0 num_val_updates=0 block_app_hash= 23 | I[2024-10-17|14:52:12.845] executed block module=BlockManager height=7 app_hash= 24 | I[2024-10-17|14:52:12.846] indexed block events module=txindex height=7 25 | ``` 26 | 27 | If you need to restart your rollup, you can run the same command again: 28 | 29 | ```bash 30 | rollkit start 31 | ``` 32 | 33 | You will see that the block height will continue from where it left off: 34 | 35 | ```bash 36 | I[2024-10-17|14:52:13.845] Creating and publishing block module=BlockManager height=8 37 | I[2024-10-17|14:52:13.845] finalized block module=BlockManager height=8 num_txs_res=0 num_val_updates=0 block_app_hash= 38 | I[2024-10-17|14:52:13.845] executed block module=BlockManager height=8 app_hash= 39 | I[2024-10-17|14:52:13.845] indexed block events module=txindex height=8 40 | ``` 41 | 42 | It is important to include any additional flags that you used when you first started your rollup. For example, if you used the `--rollkit.da_namespace` flag, you will need to include that flag when restarting your rollup to ensure your rollup continues to publish blobs to the same namespace. 43 | 44 | ## Restart rollup after running out of funds 45 | 46 | This section covers the case that the node that 47 | you are using to post blocks to your DA and consensus layer runs out of funds (tokens), 48 | and you need to restart your rollup. 49 | 50 | In this example, we're using Celestia's [Mocha testnet](https://docs.celestia.org/nodes/mocha-testnet/) 51 | and running the [quick start](../tutorials/quick-start.md). In this example, our Celestia DA light node 52 | ran out of Mocha testnet TIA and we are unable to post new blocks to Celestia due to a 53 | [`Code: 19`](https://github.com/cosmos/cosmos-sdk/blob/main/types/errors/errors.go#L95) 54 | error. This error is defined by Cosmos SDK as: 55 | 56 | ```go 57 | // ErrTxInMempoolCache defines an ABCI typed error where a tx already exists in the mempool. 58 | ErrTxInMempoolCache = Register(RootCodespace, 19, "tx already in mempool") 59 | ``` 60 | 61 | In order to get around this error, and the same error on other Rollkit rollups, you will need to re-fund your Celestia account and increase the gas fee. This will override the transaction that is stuck in the mempool. 62 | 63 | If you top up the balance of your node and don't increase the gas fee, you will still encounter the `Code: 19` error because there is a transaction (posting block to DA) that is duplicate to one that already exists. In order to get around this, you'll need to increase the gas fee and restart the chain. 64 | 65 | ### 🟠 Errors in this example {#errors} 66 | 67 | This is what the errors will look like if your DA node runs out of funding or you restart the chain without changing the gas fee: 68 | 69 | ```bash 70 | 4:51PM INF submitting block to DA layer height=28126 module=BlockManager 71 | 4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=1 module=BlockManager 72 | 4:51PM ERR DA layer submission failed Error="Codespace: 'sdk', Code: 19, Message: " attempt=2 module=BlockManager 73 | 4:51PM ERR DA layer submission failed error="Codespace: 'sdk', Code: 19, Message: " attempt=3 module=BlockManager 74 | ``` 75 | 76 | ### 💰 Re-fund your account {#refund-your-account} 77 | 78 | First, you'll need to send more tokens to the account running your Celestia node. If you didn't keep track of your key, you can run the following to get your address: 79 | 80 | ```bash 81 | cd $HOME && cd celestia-node 82 | ./cel-key list --keyring-backend test --node.type light --p2p.network 83 | ``` 84 | 85 | ### 🛑 Stopping your rollup {#stopping-your-rollup} 86 | 87 | You can stop your rollup by using `Control + C` in your terminal where the node is running. 88 | 89 | ### ⛽ Increase the gas fee {#increase-gas-fee} 90 | 91 | To reiterate, before restarting the chain, you will need to increase the gas fee in order to avoid a `Code: 19` error. See the [How to configure gas price](./gas-price.md) guide for more information. 92 | 93 | ### 🔁 Restarting your rollup {#restarting-your-rollup} 94 | 95 | Follow the [restart rollup](#restart-rollup) section above. 96 | 97 | ### 🛢️ Reduce gas fee & restart again {#reduce-gas-fee-restart-again} 98 | 99 | In order to save your TIA, we also recommend stopping the chain with `Control + C`, changing the gas fee back to the default (in our case, 8000 utia) and restarting the chain: 100 | 101 | 🎊 Congrats! You've successfully restarted your Rollkit rollup after running out of TIA. 102 | -------------------------------------------------------------------------------- /guides/rollkit-monitoring.md: -------------------------------------------------------------------------------- 1 | # How to integrate Range with your rollup 2 | 3 | This section illustrates how Rollkit developers can leverage the Range platform to monitor their rollup activity and explore relevant addresses and transactions in less than 5 minutes. 4 | 5 | ## Overview 6 | 7 | In this guide, we’ll go over the steps of the integration of our sample rollup GM, which is divided into three sections: 8 | 9 | 1. **Integrate your rollup with Range and start the indexing.** 10 | 2. **Add your addresses and contracts.** 11 | 3. **Create your first alert and explore transactions.** 12 | 13 | ## Prerequisites 14 | 15 | You need to have an operational rollkit rollup. If you haven't done so, you'll need to complete the [GM world](../tutorials/gm-world) tutorial first. 16 | 17 | ### 1. Integrate Your Rollup 18 | 19 | We’ll integrate our rollup GM into Range and start indexing blocks and transactions in real-time. 20 | 21 | ![custom-network](/public/range-rollkit/custom-network.png) 22 | 23 | #### Steps 24 | 25 | - Create an account in [Range](https://app.range.org) 26 | - Make sure you have a public RPC endpoint of your Rollkit rollup 27 | - Go to the settings tab on your account profile in the top-right corner 28 | - Click the **Add Network** button in the Custom Network section 29 | - Choose Rollkit and fill out the form 30 | - Congrats! Your rollup should be integrated in Range in less than 15 seconds. 31 | 32 | ### 2. Add Your Addresses and Contracts 33 | 34 | Now that your rollup is integrated into Range, you can customize your workspace. The first step is adding addresses and contracts that you want to monitor. For that, head to the Address section: 35 | 36 | ![import-address](/public/range-rollkit/import-address.png) 37 | 38 | Once you’ve added one or multiple addresses, you can start looking at the real-time transactions explorer in the Transactions tab. 39 | 40 | ### 3. Creating Your First Alert Rule 41 | 42 | Now, you can set up alerts to monitor specific events or transactions in your rollup. As an example, we can create an alert that notifies us every time our address is involved in a successful transaction: 43 | 44 | ![alert-rules](/public/range-rollkit/alert-rule.png) 45 | 46 | After executing a sample transaction: 47 | 48 | ```bash 49 | gmd tx bank send gm-991hesf7xgmjwttag2n2wzk43rvxh47nn4ckh3e6s gm-991rcctqc5l4px95k6tdg4pjrms70m2a9t35rl50t 4039stake --keyring-backend test --node tcp://127.0.0.1:36657 --chain-id gm --fees 5000stake 50 | ``` 51 | 52 | The alert events will appear both in the Overview tab and the Alerting section: 53 | 54 | ![alert-events](/public/range-rollkit/alert-events.png) 55 | 56 | 🎊 Congrats! You've detected the first monitored transaction in your GM rollup. 57 | -------------------------------------------------------------------------------- /guides/use-rollkit-cli.md: -------------------------------------------------------------------------------- 1 | # How to Use Rollkit CLI 2 | 3 | This guide will walk you through the basics of installing and using Rollkit CLI. You'll learn how to install the CLI, initialize a configuration file (`rollkit.toml`), and run rollup commands. 4 | 5 | ## 1. Installing Rollkit CLI 6 | 7 | 8 | 11 | 12 | To install Rollkit CLI, execute the following command: 13 | 14 | ```bash-vue 15 | curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}} 16 | ``` 17 | 18 | This command downloads and installs the Rollkit CLI of specified version. 19 | 20 | ## 2. Initializing `rollkit.toml` 21 | 22 | The `rollkit.toml` file is a configuration file that Rollkit uses to understand the structure and entry point of your rollup. To initialize this file, follow these steps: 23 | 24 | ### Steps to Generate `rollkit.toml`: 25 | 26 | 1. Run the following command to generate the `rollkit.toml` file: 27 | 28 | ```bash 29 | rollkit toml init 30 | ``` 31 | 32 | 2. You should see an output similar to this (example taken from [GM world](/tutorials/gm-world) tutorial): 33 | 34 | ```bash 35 | Found rollup entrypoint: /root/gm/cmd/gmd/main.go, adding to rollkit.toml 36 | Could not find rollup config under gm. Please put the chain.config_dir in the rollkit.toml file manually. 37 | Initialized rollkit.toml file in the current directory. 38 | ``` 39 | 40 | 3. The output indicates that the rollup entrypoint is `~/gm/cmd/gmd/main.go`. 41 | 42 | 4. Open the `rollkit.toml` file, and under the `[chain]` section, set `config_dir` to the appropriate directory where your chain configuration is. For GM World tutorial, `rollkit.toml` file looks like this: 43 | 44 | ```toml 45 | entrypoint = "./cmd/gmd/main.go" 46 | 47 | [chain] 48 | config_dir = "./.gm" 49 | ``` 50 | 51 | Adjust `entrypoint` and `config_dir` according to your project structure. 52 | 53 | ## 3. Running Rollup Commands Using Rollkit CLI 54 | 55 | Once you have the `rollkit.toml` file set up, you can run any rollup command using the Rollkit CLI. Ensure you are in the directory containing the `rollkit.toml` file when executing commands. 56 | 57 | ### Example: 58 | 59 | 1. Navigate to the directory containing the `rollkit.toml` file. 60 | 61 | 2. Now you could do: 62 | 63 | ```bash 64 | # instead of d start 65 | rollkit start 66 | # instead of d tx 67 | rollkit tx 68 | # for any d 69 | rollkit 70 | ``` 71 | ## Summary 72 | 73 | By following these steps, you can install the Rollkit CLI, initialize the `rollkit.toml` configuration file, and run rollup commands. This setup helps you manage and interact with your rollup project efficiently. 74 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | # https://vitepress.dev/reference/default-theme-home-page 3 | layout: home 4 | titleTemplate: ':title' 5 | 6 | hero: 7 | name: "Rollkit" 8 | text: "The unstoppable stack" 9 | tagline: Launch an unstoppable blockchain as easily as a smart contract 10 | image: 11 | src: /img/logo-big.svg 12 | alt: Rollkit 13 | actions: 14 | - theme: brand 15 | text: Quick start 16 | link: /tutorials/quick-start 17 | - theme: alt 18 | text: Introduction 19 | link: /learn/intro 20 | 21 | features: 22 | - title: Build with the Best 23 | details: Utilize all the existing powerful tooling in the Cosmos ecosystem including IBC, ABCI++, and CometBFT RPC equivalency. 24 | link: /learn/about#why-rollkit 25 | icon: ✨ 26 | - title: Optimize for your needs 27 | details: Take full advantage of modularity by optimizing your rollup to your needs. Tailor your block production. Choose your VM. Pick your DA layer. 28 | link: /learn/stack 29 | icon: ⚙️ 30 | - title: Take Control 31 | details: Retain the ability to upgrade via hard forks. Break free of offchain councils holding upgrade keys. Allow your community to be sovereign. 32 | link: /learn/intro 33 | icon: 🎮 34 | --- 35 | -------------------------------------------------------------------------------- /learn/about.md: -------------------------------------------------------------------------------- 1 | # About Rollkit 2 | 3 | Our mission is to allow anyone to launch their own sovereign, customizable blockchain as easily as a smart contract by utilizing the shared security of a modular data availability network. 4 | 5 | ::: tip 6 | In order to use Rollkit, it's important to have some familiarity with Cosmos SDK. You can get up to speed on Cosmos SDK by visiting their [official documentation page](https://docs.cosmos.network/main). 7 | 8 | If you're familiar with Rollkit, you may want to skip to the [tutorials section](/tutorials/gm-world). 9 | ::: 10 | 11 | ## What is Rollkit? 12 | 13 | Rollkit is a sovereign rollup framework that gives developers the freedom to deploy rollups throughout the modular stack, opening new possibilities for rapid experimentation and innovation. 14 | 15 | [Read more on the Celestia blog](https://blog.celestia.org/sovereign-rollup-chains/) to learn more about the concept of sovereign rollups. 16 | 17 | Rollkit is an [open-source framework](https://github.com/rollkit/rollkit). It features a modular node that can run rollups and exposes an [ABCI-compatible client interface](https://github.com/cometbft/cometbft/tree/main/abci), which can be used as a substitute for CometBFT in any ABCI-compatible blockchain application. 18 | 19 | Rollkit uses data availability (DA) layers by having a unified client interface which can be implemented for use with different DA networks, such as [Celestia](https://celestia.org/). 20 | 21 | Our goal is to empower developers to quickly innovate and create new classes of rollups with minimal trade-offs, and to make deploying a new chain as easy as deploying a smart contract. 22 | 23 | ## What problems is Rollkit solving? 24 | 25 | ### 1. Scalability and customizability 26 | 27 | Deploying your decentralized application as a smart contract on a shared blockchain has many limitations. Your smart contract has to share computational resources with every other application, so scalability is limited. 28 | 29 | Plus, you're restricted to the execution environment that the shared blockchain uses, so developer flexibility is limited. 30 | 31 | ### 2. Security and time to market 32 | 33 | Deploying a new chain might sound like the perfect solution for the problems listed above. While it's somewhat true, deploying a new layer 1 chain presents a complex set of challenges and trade-offs for developers looking to build blockchain products. 34 | 35 | Deploying a new layer 1 requires significant resources, including time, capital, and expertise, which can be a barrier to entry for some developers. 36 | 37 | In order to secure the network, developers must bootstrap a sufficiently secure set of validators, incurring the overhead of managing a full consensus network. This requires paying validators with inflationary tokens, putting the business sustainability of the network at risk. A strong community and network effect are also critical for success, but can be challenging to achieve as the network must gain widespread adoption to be secure and valuable. 38 | 39 | In a potential future with millions of chains, it's unlikely all of those chains will be able to sustainably attract a sufficiently secure and decentralized validator set. 40 | 41 | ## Why Rollkit? 42 | 43 | Rollkit solves the challenges encountered during the deployment of a smart contract or a new layer 1, by minimizing these tradeoffs through the implementation of rollup chains (rollups). 44 | 45 | With Rollkit, developers can benefit from: 46 | 47 | - **Shared security**: 48 | Rollups inherit security from a data availability layer, by posting blocks to it. Rollups reduce the trust assumptions placed on rollup sequencers by allowing full nodes to download and verify the transactions in the blocks posted by the sequencer. For optimistic or zk rollups, in case of fraudulent blocks, full nodes can generate fraud or zk proofs, which they can share with the rest of the network, including light nodes. Our roadmap includes the ability for light clients to receive and verify proofs, so that everyday users can enjoy high security guarantees. 49 | 50 | - **Scalability:** 51 | Rollkit rollups are deployed on specialized data availability layers like Celestia, which directly leverages the scalability of the DA layer. Additionally, rollup transactions are executed off-chain rather than the data availability layer. This means rollups have their own dedicated computational resources, rather than sharing computational resources with other applications. 52 | 53 | - **Customizability:** 54 | Rollkit is built as an open source modular framework, to make it easier for developers to reuse the four main components and customize their rollups. These components are data availability layers, execution environments, proof systems, and sequencer schemes. The components used by the [Rollkit stack](/learn/stack) are customizable. 55 | 56 | - **Faster time to market:** 57 | Rollkit eliminates the need to bootstrap a validator set, manage a consensus network, incur high economic costs, and face other trade-offs that come with deploying a new layer 1. Rollkit's goal is to make deploying a rollup as easy as it is to deploy a smart contract, cutting the time it takes to bring blockchain products to market from months or even years to just minutes. 58 | 59 | - **Sovereignty**: Rollkit also enables developers to deploy sovereign rollups for cases where communities require sovereignty. 60 | 61 | ## How can you use Rollkit? 62 | 63 | As briefly mentioned above, Rollkit could be used in many different ways. From sovereign rollups, to settlement layers, and in the future even to L3s. 64 | 65 | ### Rollup with any execution environment 66 | 67 | Rollkit gives developers the flexibility to use pre-existing ABCI-compatible state machines or create a custom state machine tailored to their rollup needs. Rollkit does not restrict the use of any specific virtual machine, allowing developers to experiment and bring innovative applications to life. 68 | 69 | ### Sovereign rollup with Cosmos SDK 70 | 71 | Similarly to how developers utilize the Cosmos SDK to build a sovereign layer 1 chain, the Cosmos SDK could be utilized to create a Rollkit-compatible rollup chain. 72 | Cosmos-SDK has great [documentation](https://docs.cosmos.network/main) and tooling that developers can leverage to learn. 73 | 74 | Another possibility is taking an existing layer 1 built with the Cosmos SDK and deploying it as a Rollkit rollup. This can provide a great opportunity for experimentation and growth. 75 | 76 | ### Build a settlement layer 77 | 78 | [Settlement layers](https://celestia.org/learn/modular-settlement-layers/settlement-in-the-modular-stack/) are ideal for developers who want to avoid deploying sovereign rollups. They provide a platform for rollups to verify proofs and resolve disputes. 79 | Additionally, they act as a hub for rollups to facilitate trust-minimized token transfers and liquidity sharing between rollups that share the same settlement layer. 80 | Think of settlement layers as a special type of execution layer. 81 | 82 | ## When can you use Rollkit? 83 | 84 | As of today, Rollkit is still in the alpha stage. The framework currently provides a centralized sequencer, an execution interface (ABCI or Cosmos SDK), and a connection to a data availability layer. 85 | 86 | We're currently working on implementing many new and exciting features such as light nodes and state fraud proofs. 87 | 88 | Head down to the next section to learn more about what's coming for Rollkit. If you're ready to start building, you can skip to the [Tutorials](/tutorials/gm-world) section. 89 | 90 | Spoiler alert, whichever you choose, it's going to be a great rabbit hole! 91 | -------------------------------------------------------------------------------- /learn/building-and-deploying-a-rollup.md: -------------------------------------------------------------------------------- 1 | # 🗞️ Building a rollup and testnet deployment 2 | 3 | The following tutorials will help you get started building 4 | Cosmos-SDK and EVM applications that connect to Celestia's data availability 5 | (DA) layer via Rollkit to Celestia's 6 | [Mocha testnet](https://docs.celestia.org/nodes/mocha-testnet) 7 | or [Arabica devnet](https://docs.celestia.org/nodes/arabica-devnet). We call those chains Sovereign Rollups. 8 | 9 | You can get started with the following tutorials: 10 | 11 | ## 1. Beginner {#beginner} 12 | 13 | - [GM world](/tutorials/gm-world) 14 | - [Restart your rollup](/guides/restart-rollup) 15 | 16 | ## 2️. Intermediate {#intermediate} 17 | 18 | - [Wordle game](/tutorials/wordle) 19 | - [CosmWasm rollup](/tutorials/cosmwasm) 20 | 21 | ## 3️. Advanced {#advanced} 22 | 23 | - [Full-stack modular dapp with Celestia](https://docs.celestia.org/developers/full-stack-modular-development-guide) 24 | 25 | ## 💻 Support {#support} 26 | 27 | The tutorials will explore developing with Rollkit, 28 | which is still in Alpha stage. If you run into bugs, please write a GitHub 29 | [issue](https://github.com/rollkit/docs/issues/new) 30 | or let us know in our [Telegram](https://t.me/rollkit). 31 | Furthermore, while Rollkit allows you to build sovereign rollups 32 | on Celestia, it currently does not support fraud proofs yet and is 33 | therefore running in "pessimistic" mode, where nodes would need to 34 | re-execute the transactions to check the validity of the chain 35 | (i.e. a full node). Furthermore, Rollkit currently only supports 36 | a single sequencer. 37 | -------------------------------------------------------------------------------- /learn/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Welcome to the Rollkit docs. We're happy you made it here! 4 | Rollkit allows anyone to launch an unstoppable blockchain as easily as a smart contract. 5 | 6 | Rollkit is the unstoppable stack. 7 | 8 | We're setting the bar high for developers' flexibility and ability to customize blockchains however they see fit. 9 | -------------------------------------------------------------------------------- /learn/specifications.md: -------------------------------------------------------------------------------- 1 | # Technical specifications 2 | 3 | [Rollkit specifications](https://rollkit.github.io/rollkit/index.html) - is comprehensive documentation on the inner components of Rollkit, including data storage, transaction processing, and more. It’s an essential resource for developers looking to understand, contribute to and leverage the full capabilities of Rollkit. 4 | 5 | Additional Rollkit documentation can be found in the [Rollkit godocs](https://pkg.go.dev/github.com/rollkit/rollkit). 6 | -------------------------------------------------------------------------------- /learn/transaction-flow.md: -------------------------------------------------------------------------------- 1 | # Transaction flow 2 | 3 | Rollup users use a light node to communicate with the rollup P2P network for two primary reasons: 4 | 5 | - submitting transactions 6 | - gossipping headers and fraud proofs 7 | 8 | ::: warning 9 | Light nodes are still a work in progress. 10 | ::: 11 | 12 | Here's what the typical transaction flow looks like: 13 | 14 | ## Transaction submission 15 | 16 | ```mermaid 17 | sequenceDiagram 18 | participant User 19 | participant LightNode 20 | participant FullNode 21 | 22 | User->>LightNode: Submit Transaction 23 | LightNode->>FullNode: Gossip Transaction 24 | FullNode-->>User: Refuse (if invalid) 25 | ``` 26 | 27 | ## Transaction validation and processing 28 | 29 | ```mermaid 30 | sequenceDiagram 31 | participant FullNode 32 | participant Sequencer 33 | 34 | FullNode->>FullNode: Check Validity 35 | FullNode->>FullNode: Add to Mempool (if valid) 36 | FullNode-->>User: Transaction Processed (if valid) 37 | FullNode->>Sequencer: Inform about Valid Transaction 38 | Sequencer->>DALayer: Add to Rollup Block 39 | ``` 40 | 41 | ## Block processing 42 | 43 | ```mermaid 44 | sequenceDiagram 45 | participant DALayer 46 | participant FullNode 47 | participant RollupChain 48 | 49 | DALayer->>RollupChain: Update State 50 | DALayer->>FullNode: Download & Validate Block 51 | FullNode->>FullNode: Generate Fraud Proofs (if invalid) 52 | ``` 53 | 54 | ## Fraud proof gossip and forking 55 | 56 | ```mermaid 57 | sequenceDiagram 58 | participant FullNode 59 | participant LightNode 60 | participant RollupChain 61 | 62 | FullNode->>LightNode: Gossip Fraud Proofs (if invalid) 63 | RollupChain->>RollupChain: Halt & Decide to Fork (if invalid) 64 | RollupChain->>DALayer: Submit New Block (after fork) 65 | ``` 66 | 67 | To transact, users submit a transaction to their light node, which gossips the transaction to a full node. Before adding the transaction to their mempool, the full node checks its validity. Valid transactions are included in the mempool, while invalid ones are refused, and the user's transaction will not be processed. 68 | 69 | If the transaction is valid and has been included in the mempool, the sequencer can add it to a rollup block, which is then submitted to the data availability (DA) layer. This results in a successful transaction flow for the user, and the state of the rollup is updated accordingly. 70 | 71 | After the block is submitted to the DA layer, the full nodes download and validate the block. 72 | However, there is a possibility that the sequencer may maliciously submit a block to the DA layer with invalid transactions or state. In such cases, the full nodes of the rollup chain will consider the block invalid. In the case of an optimistic rollup, if they find the block invalid, they generate fraud proofs and gossip them in the P2P network among other full and light nodes. 73 | 74 | As a result, the rollup chain will halt, and the network will decide to fork the chain through social consensus. In the future, when a decentralized sequencer scheme is in place, additional options will be available, such as slashing the sequencer or selecting another full node as the sequencer. However, in any case, a new block must be created and submitted to the DA layer. You can read more about sequencer nodes [here](/learn/stack#sequencer-node). 75 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "docs:dev": "vitepress dev", 4 | "docs:build": "vitepress build", 5 | "docs:preview": "vitepress preview" 6 | }, 7 | "devDependencies": { 8 | "@keplr-wallet/types": "0.12.212", 9 | "i": "^0.3.7", 10 | "mermaid": "^11.4.1", 11 | "vitepress": "^1.5.0", 12 | "vitepress-plugin-mermaid": "^2.0.17" 13 | }, 14 | "dependencies": { 15 | "node-fetch": "^3.3.2" 16 | }, 17 | "type": "module" 18 | } 19 | -------------------------------------------------------------------------------- /public/artela-evm-rollkit/artela-evm-rollkit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/artela-evm-rollkit/artela-evm-rollkit.png -------------------------------------------------------------------------------- /public/bitcoin-rollkit/rollkit-bitcoin-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/bitcoin-rollkit/rollkit-bitcoin-1.png -------------------------------------------------------------------------------- /public/bitcoin-rollkit/rollkit-bitcoin-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/bitcoin-rollkit/rollkit-bitcoin-2.png -------------------------------------------------------------------------------- /public/bitcoin-rollkit/rollkit-bitcoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/bitcoin-rollkit/rollkit-bitcoin.png -------------------------------------------------------------------------------- /public/cosmwasm/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=localwasm 6 | KEY_NAME=localwasm-key 7 | TOKEN_AMOUNT="10000000000000000000000000uwasm" 8 | STAKING_AMOUNT=1000000000uwasm 9 | CHAINFLAG="--chain-id ${CHAIN_ID}" 10 | TXFLAG="--chain-id ${CHAIN_ID} --gas-prices 0uwasm --gas auto --gas-adjustment 1.3" 11 | 12 | # reset any existing genesis/chain data 13 | wasmd tendermint unsafe-reset-all 14 | wasmd init $VALIDATOR_NAME --chain-id $CHAIN_ID 15 | 16 | # update wasmd configuration files to set chain details and enable necessary settings 17 | # the sed commands here are editing various configuration settings for the wasmd instance 18 | # such as setting minimum gas prices, enabling the api, setting the chain id, setting the rpc address, 19 | # adjusting time constants, and setting the denomination for bonds and minting. 20 | sed -i'' -e 's/^minimum-gas-prices *= .*/minimum-gas-prices = "0uwasm"/' "$HOME"/.wasmd/config/app.toml 21 | sed -i'' -e '/\[api\]/,+3 s/enable *= .*/enable = true/' "$HOME"/.wasmd/config/app.toml 22 | sed -i'' -e "s/^chain-id *= .*/chain-id = \"$CHAIN_ID\"/" "$HOME"/.wasmd/config/client.toml 23 | sed -i'' -e '/\[rpc\]/,+3 s/laddr *= .*/laddr = "tcp:\/\/0.0.0.0:26657"/' "$HOME"/.wasmd/config/config.toml 24 | sed -i'' -e 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/.wasmd/config/genesis.json 25 | sed -i'' -e 's/bond_denom": ".*"/bond_denom": "uwasm"/' "$HOME"/.wasmd/config/genesis.json 26 | sed -i'' -e 's/mint_denom": ".*"/mint_denom": "uwasm"/' "$HOME"/.wasmd/config/genesis.json 27 | 28 | # add a key to keyring-backend test 29 | wasmd keys add $KEY_NAME --keyring-backend test 30 | 31 | # add a genesis account 32 | wasmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 33 | 34 | # set the staking amounts in the genesis transaction 35 | wasmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 36 | 37 | # collect gentxs 38 | wasmd genesis collect-gentxs 39 | 40 | # copy centralized sequencer address into genesis.json 41 | # Note: validator and sequencer are used interchangeably here 42 | ADDRESS=$(jq -r '.address' ~/.wasmd/config/priv_validator_key.json) 43 | PUB_KEY=$(jq -r '.pub_key' ~/.wasmd/config/priv_validator_key.json) 44 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.wasmd/config/genesis.json > temp.json && mv temp.json ~/.wasmd/config/genesis.json 45 | 46 | echo "wasmd start --rollkit.aggregator --rollkit.da_address http://localhost:7980 --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025uwasm"" >> restart-wasmd.sh 47 | 48 | # start the chain 49 | wasmd start --rollkit.aggregator --rollkit.da_address http://localhost:7980 --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025uwasm" 50 | -------------------------------------------------------------------------------- /public/frontend-evm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/frontend-evm.png -------------------------------------------------------------------------------- /public/gm/gm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/gm/gm.png -------------------------------------------------------------------------------- /public/gm/init-arabica-testnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=gm 6 | KEY_NAME=gm-key 7 | KEY_2_NAME=gm-key-2 8 | CHAINFLAG="--chain-id ${CHAIN_ID}" 9 | TOKEN_AMOUNT="10000000000000000000000000stake" 10 | STAKING_AMOUNT="1000000000stake" 11 | 12 | # query the DA Layer start height, in this case we are querying 13 | # an RPC endpoint provided by Celestia Labs. The RPC endpoint is 14 | # to allow users to interact with Celestia's core network by querying 15 | # the node's state and broadcasting transactions on the Celestia 16 | # network. This is for Arabica, if using another network, change the RPC. 17 | DA_BLOCK_HEIGHT=$(curl https://rpc.celestia-arabica-11.com/block | jq -r '.result.block.header.height') 18 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 19 | 20 | AUTH_TOKEN=$(celestia light auth write --p2p.network arabica) 21 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 22 | 23 | # build the gm chain with Rollkit 24 | ignite chain build 25 | 26 | # reset any existing genesis/chain data 27 | gmd tendermint unsafe-reset-all 28 | 29 | # initialize the validator with the chain ID you set 30 | gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID 31 | 32 | # add keys for key 1 and key 2 to keyring-backend test 33 | gmd keys add $KEY_NAME --keyring-backend test 34 | gmd keys add $KEY_2_NAME --keyring-backend test 35 | 36 | # add these as genesis accounts 37 | gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 38 | gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test 39 | 40 | # set the staking amounts in the genesis transaction 41 | gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 42 | 43 | # collect genesis transactions 44 | gmd genesis collect-gentxs 45 | 46 | # copy centralized sequencer address into genesis.json 47 | # Note: validator and sequencer are used interchangeably here 48 | ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json) 49 | PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json) 50 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json 51 | 52 | # create a restart-testnet.sh file to restart the chain later 53 | [ -f restart-testnet.sh ] && rm restart-testnet.sh 54 | echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh 55 | echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh 56 | 57 | echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh 58 | 59 | # start the chain 60 | gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:26657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" 61 | -------------------------------------------------------------------------------- /public/gm/init-full-node.sh: -------------------------------------------------------------------------------- 1 | CHAIN_ID=gm 2 | BASE_DIR="$HOME/.gm_fn" 3 | P2P_ID="your-p2p-id" 4 | 5 | # notice that this will remove the existing rollkit.toml that was used to run sequencing node 6 | # if you need to run sequencing node again, you should update config_dir to the $HOME/gm/.gm 7 | rm -rf $BASE_DIR rollkit.toml 8 | 9 | cat << EOF > rollkit.toml 10 | entrypoint = "$HOME/gm/cmd/gmd/main.go" 11 | 12 | [chain] 13 | config_dir = "$BASE_DIR" 14 | EOF 15 | 16 | rollkit rebuild 17 | 18 | rollkit init FullNode --chain-id $CHAIN_ID 19 | 20 | cp -R "$HOME/gm/.gm/config/genesis.json" "$BASE_DIR/config/genesis.json" 21 | 22 | # rollkit logo 23 | cat <<'EOF' 24 | 25 | :=+++=. 26 | -++- .-++: 27 | .=+=. :++-. 28 | -++- .=+=: . 29 | .=+=: -%@@@* 30 | +%- .=#@@@@@@* 31 | -++- -*%@@@@@@%+: 32 | .=*=. .=#@@@@@@@%=. 33 | -++-.-++: =*#@@@@@%+:.-++-=- 34 | .=+=. :=+=.-: @@#=. .-*@@@@% 35 | =*=: .-==+- :+#@@@@@@%- 36 | :++- -*@@@@@@@#=: 37 | =%+=. .=#@@@@@@@#%: 38 | -++: -++- *+=@@@@%+: =#*##- 39 | =*=. :=+=---@*=. .=*@@@@@% 40 | .-+=: :-: :+%@@@@@@%+. 41 | :=+- -*@@@@@@@#=. 42 | .=+=: .=#@@@@@@%*- 43 | -++- *=.@@@#+: 44 | .====+*-. 45 | 46 | ______ _ _ _ _ _ 47 | | ___ \ | || || | (_)| | 48 | | |_/ / ___ | || || | __ _ | |_ 49 | | / / _ \ | || || |/ /| || __| 50 | | |\ \ | (_) || || || < | || |_ 51 | \_| \_| \___/ |_||_||_|\_\|_| \__| 52 | 53 | 54 | EOF 55 | 56 | rollkit start --rollkit.da_address http://127.0.0.1:7980 --rpc.laddr tcp://127.0.0.1:46657 --grpc.address 127.0.0.1:9390 --p2p.seeds $P2P_ID@127.0.0.1:36656 --p2p.laddr "0.0.0.0:46656" --log_level debug --minimum-gas-prices="0.025stake" 57 | -------------------------------------------------------------------------------- /public/gm/init-local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=gm 6 | KEY_NAME=gm-key 7 | KEY_2_NAME=gm-key-2 8 | KEY_RELAY=gm-relay 9 | CHAINFLAG="--chain-id ${CHAIN_ID}" 10 | TOKEN_AMOUNT="10000000000000000000000000stake" 11 | STAKING_AMOUNT="1000000000stake" 12 | 13 | # query the DA Layer start height, in this case we are querying 14 | # our local devnet at port 26657, the RPC. The RPC endpoint is 15 | # to allow users to interact with Celestia's nodes by querying 16 | # the node's state and broadcasting transactions on the Celestia 17 | # network. The default port is 26657. 18 | DA_BLOCK_HEIGHT=$(curl http://0.0.0.0:26657/block | jq -r '.result.block.header.height') 19 | 20 | AUTH_TOKEN=$(docker exec $(docker ps -q) celestia bridge auth admin --node.store /home/celestia/bridge) 21 | 22 | # rollkit logo 23 | cat <<'EOF' 24 | 25 | :=+++=. 26 | -++- .-++: 27 | .=+=. :++-. 28 | -++- .=+=: . 29 | .=+=: -%@@@* 30 | +%- .=#@@@@@@* 31 | -++- -*%@@@@@@%+: 32 | .=*=. .=#@@@@@@@%=. 33 | -++-.-++: =*#@@@@@%+:.-++-=- 34 | .=+=. :=+=.-: @@#=. .-*@@@@% 35 | =*=: .-==+- :+#@@@@@@%- 36 | :++- -*@@@@@@@#=: 37 | =%+=. .=#@@@@@@@#%: 38 | -++: -++- *+=@@@@%+: =#*##- 39 | =*=. :=+=---@*=. .=*@@@@@% 40 | .-+=: :-: :+%@@@@@@%+. 41 | :=+- -*@@@@@@@#=. 42 | .=+=: .=#@@@@@@%*- 43 | -++- *=.@@@#+: 44 | .====+*-. 45 | 46 | ______ _ _ _ _ _ 47 | | ___ \ | || || | (_)| | 48 | | |_/ / ___ | || || | __ _ | |_ 49 | | / / _ \ | || || |/ /| || __| 50 | | |\ \ | (_) || || || < | || |_ 51 | \_| \_| \___/ |_||_||_|\_\|_| \__| 52 | EOF 53 | 54 | # echo variables for the chain 55 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 56 | 57 | # build the gm chain with Rollkit 58 | ignite chain build 59 | 60 | # reset any existing genesis/chain data 61 | gmd tendermint unsafe-reset-all 62 | 63 | # initialize the validator with the chain ID you set 64 | gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID 65 | 66 | # add keys for key 1 and key 2 to keyring-backend test 67 | gmd keys add $KEY_NAME --keyring-backend test 68 | gmd keys add $KEY_2_NAME --keyring-backend test 69 | echo "milk verify alley price trust come maple will suit hood clay exotic" | gmd keys add $KEY_RELAY --keyring-backend test --recover 70 | 71 | # add these as genesis accounts 72 | gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 73 | gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test 74 | gmd genesis add-genesis-account $KEY_RELAY $TOKEN_AMOUNT --keyring-backend test 75 | 76 | # set the staking amounts in the genesis transaction 77 | gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 78 | 79 | # collect genesis transactions 80 | gmd genesis collect-gentxs 81 | 82 | # copy centralized sequencer address into genesis.json 83 | # Note: validator and sequencer are used interchangeably here 84 | ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json) 85 | PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json) 86 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json 87 | 88 | # create a restart-local.sh file to restart the chain later 89 | [ -f restart-local.sh ] && rm restart-local.sh 90 | echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh 91 | echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh 92 | 93 | echo "gmd start --rollkit.aggregator --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-local.sh 94 | 95 | # start the chain 96 | gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" 97 | -------------------------------------------------------------------------------- /public/gm/init-mainnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=gm 6 | KEY_NAME=gm-key 7 | KEY_2_NAME=gm-key-2 8 | CHAINFLAG="--chain-id ${CHAIN_ID}" 9 | TOKEN_AMOUNT="10000000000000000000000000stake" 10 | STAKING_AMOUNT="1000000000stake" 11 | 12 | # query the DA Layer start height, in this case we are querying 13 | # an RPC endpoint provided by Celestia Labs. The RPC endpoint is 14 | # to allow users to interact with Celestia's core network by querying 15 | # the node's state and broadcasting transactions on the Celestia 16 | # network. This is for Arabica, if using another network, change the RPC. 17 | DA_BLOCK_HEIGHT=$(curl https://rpc.lunaroasis.net/block | jq -r '.result.block.header.height') 18 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 19 | 20 | AUTH_TOKEN=$(celestia light auth write --p2p.network celestia) 21 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 22 | 23 | # build the gm chain with Rollkit 24 | ignite chain build 25 | 26 | # reset any existing genesis/chain data 27 | gmd tendermint unsafe-reset-all 28 | 29 | # initialize the validator with the chain ID you set 30 | gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID 31 | 32 | # add keys for key 1 and key 2 to keyring-backend test 33 | gmd keys add $KEY_NAME --keyring-backend test 34 | gmd keys add $KEY_2_NAME --keyring-backend test 35 | 36 | # add these as genesis accounts 37 | gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 38 | gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test 39 | 40 | # set the staking amounts in the genesis transaction 41 | gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 42 | 43 | # collect genesis transactions 44 | gmd genesis collect-gentxs 45 | 46 | # copy centralized sequencer address into genesis.json 47 | # Note: validator and sequencer are used interchangeably here 48 | ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json) 49 | PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json) 50 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json 51 | 52 | # create a restart-mainnet.sh file to restart the chain later 53 | [ -f restart-mainnet.sh ] && rm restart-mainnet.sh 54 | echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-mainnet.sh 55 | echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-mainnet.sh 56 | 57 | echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-mainnet.sh 58 | 59 | # start the chain 60 | gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" 61 | -------------------------------------------------------------------------------- /public/gm/init-mocha-testnet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=gm 6 | KEY_NAME=gm-key 7 | KEY_2_NAME=gm-key-2 8 | CHAINFLAG="--chain-id ${CHAIN_ID}" 9 | TOKEN_AMOUNT="10000000000000000000000000stake" 10 | STAKING_AMOUNT="1000000000stake" 11 | 12 | # query the DA Layer start height, in this case we are querying 13 | # an RPC endpoint provided by Celestia Labs. The RPC endpoint is 14 | # to allow users to interact with Celestia's core network by querying 15 | # the node's state and broadcasting transactions on the Celestia 16 | # network. This is for Arabica, if using another network, change the RPC. 17 | DA_BLOCK_HEIGHT=$(curl https://rpc-mocha.pops.one/block | jq -r '.result.block.header.height') 18 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 19 | 20 | AUTH_TOKEN=$(celestia light auth write --p2p.network mocha) 21 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 22 | 23 | # build the gm chain with Rollkit 24 | ignite chain build 25 | 26 | # reset any existing genesis/chain data 27 | gmd tendermint unsafe-reset-all 28 | 29 | # initialize the validator with the chain ID you set 30 | gmd init $VALIDATOR_NAME --chain-id $CHAIN_ID 31 | 32 | # add keys for key 1 and key 2 to keyring-backend test 33 | gmd keys add $KEY_NAME --keyring-backend test 34 | gmd keys add $KEY_2_NAME --keyring-backend test 35 | 36 | # add these as genesis accounts 37 | gmd genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 38 | gmd genesis add-genesis-account $KEY_2_NAME $TOKEN_AMOUNT --keyring-backend test 39 | 40 | # set the staking amounts in the genesis transaction 41 | gmd genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 42 | 43 | # collect genesis transactions 44 | gmd genesis collect-gentxs 45 | 46 | # copy centralized sequencer address into genesis.json 47 | # Note: validator and sequencer are used interchangeably here 48 | ADDRESS=$(jq -r '.address' ~/.gm/config/priv_validator_key.json) 49 | PUB_KEY=$(jq -r '.pub_key' ~/.gm/config/priv_validator_key.json) 50 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.gm/config/genesis.json > temp.json && mv temp.json ~/.gm/config/genesis.json 51 | 52 | # create a restart-testnet.sh file to restart the chain later 53 | [ -f restart-testnet.sh ] && rm restart-testnet.sh 54 | echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-testnet.sh 55 | echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-testnet.sh 56 | 57 | echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height \$DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices="0.025stake"" >> restart-testnet.sh 58 | 59 | # start the chain 60 | gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace 00000000000000000000000000000000000000000008e5f679bf7116cb --rollkit.da_start_height $DA_BLOCK_HEIGHT --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" 61 | -------------------------------------------------------------------------------- /public/ibc/init-osmosis-local.sh: -------------------------------------------------------------------------------- 1 | KEY="mykey" 2 | CHAINID="osmosis-testnet-1" 3 | MONIKER="localtestnet" 4 | KEYALGO="secp256k1" 5 | KEYRING="test" 6 | LOGLEVEL="info" 7 | # to trace evm 8 | #TRACE="--trace" 9 | TRACE="" 10 | KEY_RELAY="osmosis-relay" 11 | # remove existing daemon 12 | rm -rf ~/.osmosis* 13 | 14 | 15 | # validate dependencies are installed 16 | command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; } 17 | 18 | update_test_genesis () { 19 | cat $HOME/.osmosisd/config/genesis.json | jq "$1" > $HOME/.osmosisd/config/tmp_genesis.json && mv $HOME/.osmosisd/config/tmp_genesis.json $HOME/.osmosisd/config/genesis.json 20 | } 21 | 22 | # if $KEY exists it should be deleted 23 | osmosisd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO 24 | echo "milk verify alley price trust come maple will suit hood clay exotic" | osmosisd keys add $KEY_RELAY --keyring-backend $KEYRING --algo $KEYALGO --recover 25 | 26 | # Set moniker and chain-id for Evmos (Moniker can be anything, chain-id must be an integer) 27 | osmosisd init $MONIKER --chain-id $CHAINID 28 | 29 | # Allocate genesis accounts (cosmos formatted addresses) 30 | osmosisd add-genesis-account $KEY_RELAY 100000001000009000uosmo,100000000000000utest --keyring-backend $KEYRING 31 | osmosisd add-genesis-account $KEY 100000001000000000uosmo --keyring-backend $KEYRING 32 | 33 | # Sign genesis transaction 34 | osmosisd gentx $KEY 100000001000000000uosmo --keyring-backend $KEYRING --chain-id $CHAINID 35 | 36 | # Collect genesis tx 37 | osmosisd collect-gentxs 38 | update_test_genesis '.app_state["mint"]["params"]["mint_denom"]="uosmo"' 39 | update_test_genesis '.app_state["staking"]["params"]["bond_denom"]="uosmo"' 40 | update_test_genesis '.app_state["txfees"]["basedenom"]="uosmo"' 41 | 42 | # Run this to ensure everything worked and that the genesis file is setup correctly 43 | osmosisd validate-genesis 44 | 45 | if [[ $1 == "pending" ]]; then 46 | echo "pending mode is on, please wait for the first block committed." 47 | fi 48 | 49 | osmosisd config chain-id $CHAINID 50 | osmosisd config keyring-backend $KEYRING 51 | 52 | # Start the node (remove the --pruning=nothing flag if historical queries are not needed) 53 | osmosisd start --pruning-keep-recent 10000 --minimum-gas-prices=0.0001uosmo --rpc.laddr tcp://0.0.0.0:46657 --p2p.laddr tcp://0.0.0.0:2240 --grpc.address 0.0.0.0:2242 --grpc-web.address 0.0.0.0:2243 --api.address tcp://127.0.0.1:2317 54 | -------------------------------------------------------------------------------- /public/img/Rollkit-cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/Rollkit-cover.jpg -------------------------------------------------------------------------------- /public/img/color-scheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/color-scheme.png -------------------------------------------------------------------------------- /public/img/favicon-dark.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/favicon-dark.ico -------------------------------------------------------------------------------- /public/img/favicon-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/favicon-dark.png -------------------------------------------------------------------------------- /public/img/favicon-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/favicon.png -------------------------------------------------------------------------------- /public/img/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /public/img/gm-world-frontend-wallet-connected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/gm-world-frontend-wallet-connected.png -------------------------------------------------------------------------------- /public/img/logo-big.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 26 | 27 | -------------------------------------------------------------------------------- /public/img/logo-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /public/img/sequencing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/sequencing.jpg -------------------------------------------------------------------------------- /public/img/transaction-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/img/transaction-flow.png -------------------------------------------------------------------------------- /public/install-gm-rollup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Downloading GM tutorial rollup source code..." 4 | git clone https://github.com/rollkit/gm.git 5 | cd gm || { echo "Failed to find the downloaded repository"; exit 1; } 6 | git fetch && git checkout remotes/origin/tutorial-local-da-rollkit 7 | -------------------------------------------------------------------------------- /public/install-go.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # This script installs or updates to the latest version of Go. 4 | # Multi-platform (Linux and macOS) 5 | # Multi-architecture (amd64, arm64, arm) support 6 | 7 | # if curl is not installed then install it 8 | if ! command -v curl &> /dev/null; then 9 | echo "curl is not installed. Please install curl and try again." 10 | exit 1 11 | fi 12 | 13 | # if jq is not installed then install it using the script 14 | if ! command -v jq &> /dev/null; then 15 | echo "jq is not installed. Downloading and executing the script to install jq..." 16 | curl -sSL https://rollkit.dev/install-jq.sh | bash 17 | fi 18 | 19 | # Define the Go binary path 20 | GO_BIN_PATH="/usr/local/go/bin" 21 | GO_UNTAR_PATH="/usr/local" 22 | 23 | version="${1:-$(curl -sSL 'https://go.dev/dl/?mode=json' | jq -r '.[0].version')}" 24 | 25 | current="$($GO_BIN_PATH/go version 2>/dev/null | awk '{print $3}')" 26 | if [[ "$current" == "$version" ]]; then 27 | echo "Go is already up-to-date at version ${version}" 28 | exit 0 29 | fi 30 | 31 | update_go() { 32 | local arch="$1" 33 | local os="$2" 34 | 35 | local go_url="https://golang.org/dl/${version}.${os}-${arch}.tar.gz" 36 | 37 | echo "Downloading Go from ${go_url}" 38 | 39 | curl -so "/tmp/${version}.${os}-${arch}.tar.gz" -L "$go_url" 40 | if [ $? -eq 0 ]; then 41 | tar -C $GO_UNTAR_PATH -xzf "/tmp/${version}.${os}-${arch}.tar.gz" 42 | if [ $? -ne 0 ]; then 43 | echo "Failed to extract Go. Possibly corrupted download." 44 | rm "/tmp/${version}.${os}-${arch}.tar.gz" 45 | exit 1 46 | else 47 | echo "Go updated to version ${version}" 48 | fi 49 | else 50 | echo "Failed to download Go from ${go_url}" 51 | exit 1 52 | fi 53 | 54 | rm "/tmp/${version}.${os}-${arch}.tar.gz" 55 | } 56 | 57 | # Function to add path to the specific shell config file 58 | add_path_to_config() { 59 | local config_file="$1" 60 | 61 | if ! grep -q "export PATH=.*$GO_BIN_PATH" "$config_file" ; then 62 | echo "export PATH=\"\$PATH:$GO_BIN_PATH\"" >> "$config_file" 63 | echo "Added $GO_BIN_PATH to $config_file" 64 | else 65 | echo "$GO_BIN_PATH is already in $config_file" 66 | fi 67 | } 68 | 69 | case "$(uname -s)" in 70 | Linux) 71 | OS="linux" 72 | ;; 73 | Darwin) 74 | OS="darwin" 75 | ;; 76 | *) 77 | echo "Unsupported operating system: $(uname -s)" >&2 78 | exit 1 79 | ;; 80 | esac 81 | 82 | # Determine the architecture 83 | case "$(uname -m)" in 84 | armv6l) 85 | ARCH="armv6l" 86 | ;; 87 | armv7l) 88 | ARCH="armv7l" 89 | ;; 90 | arm64) 91 | ARCH="arm64" 92 | ;; 93 | x86_64) 94 | ARCH="amd64" 95 | ;; 96 | *) 97 | echo "Unsupported architecture: $(uname -m)" >&2 98 | exit 1 99 | ;; 100 | esac 101 | 102 | update_go "$ARCH" "$OS" 103 | 104 | # Determine shell and appropriate config file 105 | if [[ -n "$ZSH_VERSION" ]]; then 106 | # Assuming the user is using Zsh 107 | CONFIG_FILE="$HOME/.zshenv" 108 | elif [[ -n "$BASH_VERSION" ]]; then 109 | if [[ -f "$HOME/.bashrc" ]]; then 110 | CONFIG_FILE="$HOME/.bashrc" 111 | elif [[ -f "$HOME/.bash_profile" ]]; then 112 | CONFIG_FILE="$HOME/.bash_profile" 113 | else 114 | CONFIG_FILE="$HOME/.profile" 115 | fi 116 | else 117 | echo "Unsupported shell. Only Bash and Zsh are supported." 118 | exit 1 119 | fi 120 | 121 | add_path_to_config "$CONFIG_FILE" 122 | 123 | $(which go) version 124 | 125 | echo "Now run 'source $CONFIG_FILE' to update your environment" 126 | -------------------------------------------------------------------------------- /public/install-jq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$OSTYPE" == "darwin"* ]]; then 4 | echo "Detected macOS. Installing jq..." 5 | if ! command -v brew &> /dev/null; then 6 | echo "Homebrew is not installed. Installing Homebrew..." 7 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 8 | # adding /opt/homebrew/bin to the $PATH variable based on the shell 9 | if [[ -f "$HOME/.bash_profile" ]]; then 10 | echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.bash_profile" 11 | source "$HOME/.bash_profile" 12 | elif [[ -f "$HOME/.bashrc" ]]; then 13 | echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.bashrc" 14 | source "$HOME/.bashrc" 15 | elif [[ -f "$HOME/.zshrc" ]]; then 16 | echo "export PATH=\"/opt/homebrew/bin:\$PATH\"" >> "$HOME/.zshrc" 17 | source "$HOME/.zshrc" 18 | else 19 | echo "Unsupported shell. Please add /opt/homebrew/bin to your PATH manually." 20 | exit 1 21 | fi 22 | fi # Closing the brew installation check 23 | brew install jq 24 | echo "jq has been installed successfully." 25 | elif [[ "$OSTYPE" == "linux-gnu"* ]]; then 26 | echo "Detected Linux. Installing jq..." 27 | if command -v apt &> /dev/null; then 28 | sudo apt update 29 | sudo apt install -y jq 30 | elif command -v yum &> /dev/null; then 31 | sudo yum install -y epel-release 32 | sudo yum install -y jq 33 | else 34 | echo "Unsupported package manager. Please install jq manually." 35 | exit 1 36 | fi 37 | echo "jq has been installed successfully." 38 | else 39 | echo "Unsupported operating system." 40 | exit 1 41 | fi # Closing the OS type check 42 | 43 | -------------------------------------------------------------------------------- /public/install-local-da.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Downloading Local-DA source code..." 4 | git clone https://github.com/rollkit/local-da.git 5 | cd local-da || { echo "Failed to find the downloaded repository"; exit 1; } 6 | git checkout $1 7 | echo "Building and installing Local DA..." 8 | make build 9 | echo "Starting Local DA..." 10 | ./build/local-da 11 | -------------------------------------------------------------------------------- /public/install-local-sequencer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Downloading local sequencer source code..." 4 | git clone https://github.com/rollkit/go-sequencing.git 5 | cd go-sequencing || { echo "Failed to find the downloaded repository"; exit 1; } 6 | git fetch --all --tags 7 | git checkout $1 8 | echo "Building and installing Local Sequencer..." 9 | make build 10 | echo "Starting Local Sequencer..." 11 | ./build/local-sequencer -rollup-id $2 12 | -------------------------------------------------------------------------------- /public/install-yarn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | INSTALL_NODE_VER=21.7.2 6 | INSTALL_NVM_VER=0.39.7 7 | INSTALL_YARN_VER=1.22.19 8 | 9 | # You can pass node and yarn versions as arguments to this script 10 | if [ "$1" != '' ]; then 11 | echo "==> Using specified node version - $1" 12 | INSTALL_NODE_VER=$1 13 | fi 14 | if [ "$2" != '' ]; then 15 | echo "==> Using specified yarn version - $2" 16 | INSTALL_YARN_VER=$2 17 | fi 18 | 19 | echo "==> Ensuring .bashrc exists and is writable" 20 | touch ~/.bashrc 21 | 22 | echo "==> Installing node version manager (NVM). Version $INSTALL_NVM_VER" 23 | # Removed if already installed 24 | rm -rf ~/.nvm 25 | # Unset exported variable 26 | export NVM_DIR= 27 | 28 | # Install nvm 29 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$INSTALL_NVM_VER/install.sh | bash 30 | # Make nvm command available to terminal 31 | source ~/.nvm/nvm.sh 32 | 33 | echo "==> Installing node js version $INSTALL_NODE_VER" 34 | nvm install $INSTALL_NODE_VER 35 | 36 | echo "==> Make this version system default" 37 | nvm alias default $INSTALL_NODE_VER 38 | nvm use default 39 | 40 | echo "==> Installing Yarn package manager" 41 | rm -rf ~/.yarn 42 | curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $INSTALL_YARN_VER 43 | 44 | echo "==> Adding Yarn and Node to environment path" 45 | # Yarn configurations 46 | mv $HOME/.nvm/versions/node/v$INSTALL_NODE_VER/bin/node $HOME/.yarn/bin 47 | 48 | export PATH="$HOME/.yarn/bin:$PATH" 49 | yarn config set prefix ~/.yarn -g 50 | 51 | echo "==> Checking for versions" 52 | nvm --version 53 | node --version 54 | npm --version 55 | yarn --version 56 | 57 | echo "==> Print binary paths" 58 | which npm 59 | which node 60 | which yarn 61 | 62 | echo "==> List installed node versions" 63 | nvm ls 64 | 65 | nvm cache clear 66 | echo "==> Now you're all setup and ready for development. If changes are yet to take effect, I suggest you restart your computer" 67 | -------------------------------------------------------------------------------- /public/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define colors for output 4 | RED="\033[31m" 5 | GREEN="\033[32m" 6 | YELLOW="\033[33m" 7 | CYAN="\033[36m" 8 | BOLD="\033[1m" 9 | RESET="\033[0m" 10 | 11 | # Function to print headers 12 | print_header() { 13 | echo -e "${CYAN}${BOLD}--> $1${RESET}" 14 | } 15 | 16 | # Function to print success messages 17 | print_success() { 18 | echo -e "${GREEN}${BOLD}$1${RESET}" 19 | } 20 | 21 | # Function to print warnings 22 | print_warning() { 23 | echo -e "${YELLOW}${BOLD}$1${RESET}" 24 | } 25 | 26 | # Function to print errors 27 | print_error() { 28 | echo -e "${RED}${BOLD}$1${RESET}" 29 | } 30 | 31 | # Function to compare versions 32 | compare_versions() { 33 | if [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" = "$1" ]; then 34 | if [ "$1" = "$2" ]; then 35 | return 0 # Equal 36 | else 37 | return 1 # First is less 38 | fi 39 | else 40 | return 2 # First is greater 41 | fi 42 | } 43 | 44 | print_header "Downloading Rollkit source code..." 45 | git clone https://github.com/rollkit/rollkit.git 46 | echo "" 47 | 48 | cd rollkit || { print_error "Failed to find the downloaded repository."; exit 1; } 49 | 50 | print_header "Extracting Go version from go.mod..." 51 | go_mod_version=$(grep "^go " go.mod | cut -d' ' -f2) 52 | 53 | if [ -z "$go_mod_version" ]; then 54 | print_error "Error: Could not find a Go version in go.mod." 55 | exit 1 56 | fi 57 | formatted_go_version="go${go_mod_version}" 58 | echo -e " Required Go version: ${BOLD}${formatted_go_version}${RESET}\n" 59 | 60 | print_header "Checking if Go is installed..." 61 | if ! which go > /dev/null; then 62 | print_warning "Go is not installed. Attempting to install Go..." 63 | curl -sL "https://rollkit.dev/install-go.sh" | sh -s "$formatted_go_version" 64 | fi 65 | 66 | installed_version=$(go version | awk '{print $3}' | sed 's/go//') 67 | echo -e " Installed Go version: ${BOLD}${installed_version}${RESET}\n" 68 | 69 | print_header "Validating installed Go version..." 70 | compare_versions "$installed_version" "$go_mod_version" 71 | comparison_result=$? 72 | 73 | if [ $comparison_result -eq 1 ]; then 74 | print_error "ERROR: The installed Go version ($installed_version) is less than the required version ($go_mod_version)." 75 | echo " Please upgrade your version of Go." 76 | exit 1 77 | elif [ $comparison_result -eq 2 ]; then 78 | print_warning "INFO: The installed Go version ($installed_version) is greater than the required version ($go_mod_version)." 79 | echo " If you run into issues, try downgrading your version of Go." 80 | fi 81 | echo "" 82 | 83 | print_header "Fetching and checking out the specified branch or tag..." 84 | git fetch && git checkout "$1" 85 | echo "" 86 | 87 | print_header "Building and installing Rollkit..." 88 | make install 89 | print_success "Rollkit CLI installed successfully!" 90 | 91 | cd .. 92 | print_header "Cleaning up downloads..." 93 | rm -rf rollkit 94 | 95 | print_success "Installation completed successfully." 96 | -------------------------------------------------------------------------------- /public/polaris-evm/polaris-evm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/polaris-evm/polaris-evm.png -------------------------------------------------------------------------------- /public/polaris-evm/polaris-start-site.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/polaris-evm/polaris-start-site.png -------------------------------------------------------------------------------- /public/range-rollkit/alert-events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/range-rollkit/alert-events.png -------------------------------------------------------------------------------- /public/range-rollkit/alert-rule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/range-rollkit/alert-rule.png -------------------------------------------------------------------------------- /public/range-rollkit/custom-network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/range-rollkit/custom-network.png -------------------------------------------------------------------------------- /public/range-rollkit/import-address.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/range-rollkit/import-address.png -------------------------------------------------------------------------------- /public/wordle/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # set variables for the chain 4 | VALIDATOR_NAME=validator1 5 | CHAIN_ID=wordle 6 | KEY_NAME=wordle-key 7 | CHAINFLAG="--chain-id ${CHAIN_ID}" 8 | TOKEN_AMOUNT="10000000000000000000000000stake" 9 | STAKING_AMOUNT="1000000000stake" 10 | 11 | # build the wordle chain with Rollkit 12 | ignite chain build 13 | 14 | # reset any existing genesis/chain data 15 | wordled tendermint unsafe-reset-all 16 | 17 | # initialize the validator with the chain ID you set 18 | wordled init $VALIDATOR_NAME --chain-id $CHAIN_ID 19 | 20 | # add key to keyring-backend test 21 | wordled keys add $KEY_NAME --keyring-backend test 22 | 23 | # add a genesis account 24 | wordled genesis add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test 25 | 26 | # set the staking amount in the genesis transaction 27 | wordled genesis gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test 28 | 29 | # collect genesis transactions 30 | wordled genesis collect-gentxs 31 | 32 | # copy centralized sequencer address into genesis.json 33 | # Note: validator and sequencer are used interchangeably here 34 | ADDRESS=$(jq -r '.address' ~/.wordle/config/priv_validator_key.json) 35 | PUB_KEY=$(jq -r '.pub_key' ~/.wordle/config/priv_validator_key.json) 36 | jq --argjson pubKey "$PUB_KEY" '.consensus["validators"]=[{"address": "'$ADDRESS'", "pub_key": $pubKey, "power": "1000", "name": "Rollkit Sequencer"}]' ~/.wordle/config/genesis.json > temp.json && mv temp.json ~/.wordle/config/genesis.json 37 | 38 | # create a restart-testnet.sh file to restart the chain later 39 | [ -f restart-wordle.sh ] && rm restart-wordle.sh 40 | 41 | echo "wordled start --rollkit.aggregator --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr \"0.0.0.0:36656\" --minimum-gas-prices=\"0.025stake\" --rollkit.da_address \"http://localhost:7980\"" >> restart-wordle.sh 42 | 43 | # start the chain 44 | wordled start --rollkit.aggregator --rpc.laddr tcp://127.0.0.1:36657 --grpc.address 127.0.0.1:9290 --p2p.laddr "0.0.0.0:36656" --minimum-gas-prices="0.025stake" --rollkit.da_address "http://localhost:7980" 45 | -------------------------------------------------------------------------------- /public/wordle/wordle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/public/wordle/wordle.png -------------------------------------------------------------------------------- /testnets/cosmwasm-testnet.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This page provides details about Rollkit testnets. 3 | --- 4 | 5 | # CosmWasm Testnet 6 | 7 | Our CosmWasm testnet is deployed by following the [cosmwasm tutorial](/tutorials/cosmwasm.md). The [rollkit/wasmd](https://github.com/rollkit/wasmd/tree/v0.50.0) contains the code for the same. 8 | 9 | ## Details of ROSM testnet 10 | 11 | - Chain ID: `rosm` 12 | - Address Prefix: `wasm` 13 | - e.g., `wasm1lysztpn74kl40w6ghfhy7xr0v44r658szuysl5` 14 | - Rollkit version: `v0.13.1` 15 | - RPC: `https://rpc.rosm.rollkit.dev/` 16 | - Example: `https://rpc.rosm.rollkit.dev/block?height=1` 17 | 18 | ```json 19 | { 20 | "jsonrpc": "2.0", 21 | "result": { 22 | "block_id": { 23 | "hash": "9D5C710CD64D031752A7DB86E09C8EA8CE4CAE4E30878C6D0487C57806060A47", 24 | "parts": { 25 | "total": 0, 26 | "hash": "" 27 | } 28 | }, 29 | "block": { 30 | "header": { 31 | "version": { 32 | "block": "11" 33 | }, 34 | "chain_id": "rosm", 35 | "height": "1", 36 | "time": "2024-04-09T15:48:50.464427035Z", 37 | "last_block_id": { 38 | "hash": "", 39 | "parts": { 40 | "total": 0, 41 | "hash": "" 42 | } 43 | }, 44 | "last_commit_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", 45 | "data_hash": "6E340B9CFFB37A989CA544E6BB780A2C78901D3FB33738768511A30617AFA01D", 46 | "validators_hash": "036DA1AB230A4CE8654358F77CB426BA2F8EF9B81EA06FACA32085B0B0D25C2A", 47 | "next_validators_hash": "036DA1AB230A4CE8654358F77CB426BA2F8EF9B81EA06FACA32085B0B0D25C2A", 48 | "consensus_hash": "0000000000000000000000000000000000000000000000000000000000000000", 49 | "app_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", 50 | "last_results_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", 51 | "evidence_hash": "E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855", 52 | "proposer_address": "D7D4C5A2AC271061512789BEE3718305BEAA519B" 53 | }, 54 | "data": { 55 | "txs": [] 56 | }, 57 | "evidence": { 58 | "evidence": null 59 | }, 60 | "last_commit": { 61 | "height": "1", 62 | "round": 0, 63 | "block_id": { 64 | "hash": "9D5C710CD64D031752A7DB86E09C8EA8CE4CAE4E30878C6D0487C57806060A47", 65 | "parts": { 66 | "total": 0, 67 | "hash": "" 68 | } 69 | }, 70 | "signatures": [ 71 | { 72 | "block_id_flag": 2, 73 | "validator_address": "D7D4C5A2AC271061512789BEE3718305BEAA519B", 74 | "timestamp": "2024-04-09T15:48:50.464427035Z", 75 | "signature": "FWSRXEOvry/FC0KERmqyLP8voIVw8QFywgELDfLBAuFcMpm7TB7pTLb4OPwzjAoSt6Hbo/uIIny/pRhw8RoHDQ==" 76 | } 77 | ] 78 | } 79 | } 80 | }, 81 | "id": -1 82 | } 83 | ``` 84 | - Tendermint API endpoint (uses default 1317 port): `https://api.rosm.rollkit.dev` 85 | - Example: `https://api.rosm.rollkit.dev/cosmos/auth/v1beta1/accounts/wasm1lysztpn74kl40w6ghfhy7xr0v44r658szuysl5` 86 | ```json 87 | { 88 | "account": { 89 | "@type": "/cosmos.auth.v1beta1.BaseAccount", 90 | "address": "wasm1lysztpn74kl40w6ghfhy7xr0v44r658szuysl5", 91 | "pub_key": null, 92 | "account_number": "7", 93 | "sequence": "0" 94 | } 95 | } 96 | ``` 97 | - Block Explorer: [https://canary.modular.cloud/rollkit-cosmwasm](https://canary.modular.cloud/rollkit-cosmwasm) 98 | ::: warning 99 | The modular.cloud explorer is work in progress. In the meanwhile, the wasm CLI can be used to query the accounts. 100 | For example: to collect the transactions for any account, following command can be used. 101 | ``` 102 | wasmd query txs --query "message.sender='wasm1lysztpn74kl40w6ghfhy7xr0v44r658szuysl5'" --node https://rpc.rosm.rollkit.dev 103 | ``` 104 | ::: 105 | - Faucet: [https://faucet.rosm.rollkit.dev/](https://faucet.rosm.rollkit.dev/) 106 | - You can request 1 rosm (or 1000000urosm) every 24 hours. 107 | ![Faucet](/testnets/faucet.png) 108 | - Mocha Namespace: `000000000000000000000000000000000000b7b24d9321578eb83626`, [view it on Celenium](https://mocha.celenium.io/namespace/000000000000000000000000000000000000b7b24d9321578eb83626) 109 | - DA Block Time: `15s` 110 | - Rollup Block Time: `10s` 111 | 112 | ### Add Rosm to Keplr 113 | 114 | Don't have the Keplr Browser extension? [Add Keplr Wallet Here](https://chrome.google.com/webstore/detail/keplr/dmkamcknogkgcdfhhbddcghachkejeap?hl=en") 115 | 116 | 119 | 120 | Click to add Rosm testnet to your Keplr wallet 121 | -------------------------------------------------------------------------------- /testnets/faucet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rollkit/docs/828ad26e56ee96e0ebfe1a9ac62f1238f840f794/testnets/faucet.png -------------------------------------------------------------------------------- /tutorials/da/avail-da.md: -------------------------------------------------------------------------------- 1 | # Using Avail as DA 2 | 3 | ## 🌞 Introduction {#introduction} 4 | 5 | :::warning Disclaimer 6 | This tutorial is currently broken. 7 | Follow the work to fix this tutorial in [rollkit/avail-da issue 57](https://github.com/rollkit/avail-da/issues/57) 8 | ::: 9 | 10 | 11 | Avail DA offers scalable data availability that underpins the Avail ecosystem and ensures instantaneous and reliable data integrity, enabling rollups to grow, through the use of cutting-edge zero knowledge and KZG Polynomial commitments. 12 | 13 | This tutorial serves as a comprehensive guide for deploying your GM world rollup on Avail's data availability (DA) network. 14 | 15 | Before proceeding, ensure that you have completed the GM World rollup setup. 16 | 17 | Note : If you want to go through gm world setup docs for more information, you can refer [GM world rollup](/tutorials/gm-world) tutorial, which covers setting up a local sovereign gm-world rollup and connecting it to a local (mock) DA node. 18 | 19 | ## 🪶 Running an Avail light node 20 | 21 | Before you can start your rollup node, you need to initiate, sync, and possibly fund a light node on Turing Testnet which is the test network of Avail 22 | 23 | - [Local development](https://github.com/rollkit/avail-da/blob/main/README.md) 24 | - [Turing Testnet](https://docs.availproject.org/docs/networks) 25 | 26 | ### 🚀 Using Turing Testnet 27 | 28 | - To fund your wallet address for using Turing Testnet: get AVAIL tokens from [the faucet]((https://faucet.avail.tools/)) 29 | - Paste your mnemonic in the `identity.toml` file by creating a `identity.toml` with the following command: 30 | `touch identity.toml` 31 | Example: 32 | 33 | ```bash 34 | avail_secret_uri = '' 35 | ``` 36 | 37 | Running just an Avail light node is enough for Turing testnet. Run the Avail light node using the following command 38 | 39 | ```bash 40 | cargo run --release -- --network turing --app-id 1 --clean --identity identity.toml 41 | ``` 42 | 43 | If you want to sync Avail light node with your desired block number, you can add the following config in your `config.yaml` file from [here]( https://github.com/availproject/avail-light/blob/main/config.yaml.template ) 44 | 45 | ```bash 46 | http_server_host = '127.0.0.1' 47 | http_server_port = 8000 48 | port = 38000 49 | sync_start_block = 322264 50 | ``` 51 | 52 | After successfully starting a light node, it's time to start posting the batches of blocks of data that your rollup generates. 53 | 54 | ## 🧹 Cleaning previous chain history 55 | 56 | From the [GM world rollup]( /tutorials/gm-world ) tutorial, you should already have the `gmd` binary and the `$HOME/.gm` directory. 57 | 58 | To clear old rollup data: 59 | 60 | ```bash 61 | rm -r $(which gmd) && rm -rf $HOME/.gm 62 | ``` 63 | 64 | ## 🏗️ Building your rollup 65 | 66 | Now we need to rebuild our rollup by simply running the existing `init.sh` script: 67 | 68 | ```bash 69 | cd $HOME/gm && bash init.sh 70 | ``` 71 | 72 | This process creates a new `$HOME/.gm` directory and a new `gmd` binary. Next, we need to connect our rollup to the running Avail light node. 73 | 74 | ## 🛠️ Configuring flags for DA 75 | 76 | Now we're prepared to initiate our rollup and establish a connection with the Avail light node. The `gmd start` command requires two DA configuration flags: 77 | 78 | - `--rollkit.da_start_height` 79 | - `--rollkit.da_address` 80 | 81 | ::: tip 82 | Optionally, you could also set the `--rollkit.da_block_time` flag. This should be set to the finality time of the DA layer, not its actual block time, as Rollkit does not handle reorganization logic. The default value is 15 seconds. 83 | ::: 84 | 85 | Let's determine what to provide for each of them. 86 | 87 | First, let's query the DA Layer start height using an RPC endpoint provided by Avail Labs. For local, it would be - [https://localhost:8000/v1/latest_block]( https://localhost:8000/v1/latest_block ), and for Turing Testnet - [https://avail-turing-rpc.publicnode.com]( https://avail-turing-rpc.publicnode.com ) 88 | 89 | Here is an example for the local development (replace URL for Turing Testnet if needed): 90 | 91 | ```bash 92 | DA_BLOCK_HEIGHT=$(curl https://localhost:8000/v1/latest_block | jq -r '.result.block.header.height') 93 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 94 | ``` 95 | 96 | You will see the output like this: 97 | 98 | ```bash 99 | Your DA_BLOCK_HEIGHT is 35 100 | ``` 101 | 102 | ## 🔥 Running your rollup connected to an avail light node 103 | 104 | Now let's run our rollup node with all DA flags: 105 | 106 | ```bash 107 | gmd start \ 108 | --rollkit.aggregator \ 109 | --rollkit.da_address="grpc://localhost:3000" \ 110 | --rollkit.da_start_height $DA_BLOCK_HEIGHT \ 111 | --minimum-gas-prices="0.1stake" 112 | ``` 113 | 114 | Now, the rollup is running and posting blocks (aggregated in batches) to Avail. You can view your rollup by finding your account on [Turing testnet]( https://avail-turing.subscan.io/ ) 115 | 116 | ::: info 117 | For details on configuring gas prices specifically for the DA network, see our [DA Network Gas Price Guide](/guides/gas-price). This is separate from the `--minimum-gas-prices="0.025stake"` setting, which is used for rollup network operations. 118 | ::: 119 | 120 | ## 🎉 Next steps 121 | 122 | Congratulations! You've built a local rollup that posts to Avail's testnets as well as locally. Well done! Now, go forth and build something great! Good luck! 123 | -------------------------------------------------------------------------------- /tutorials/da/celestia-da.md: -------------------------------------------------------------------------------- 1 | # Using Celestia as DA 2 | 3 | 4 | 7 | 8 | ## 🌞 Introduction {#introduction} 9 | 10 | This tutorial serves as a comprehensive guide for deploying your rollup on Celestia's data availability (DA) network. From the Rollkit perspective, there's no difference in posting blocks to Celestia's testnets or Mainnet Beta. 11 | 12 | Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) tutorial, which covers installing the rollkit CLI and running a rollup against a local DA network. 13 | 14 | ## 🪶 Running a Celestia light node 15 | 16 | Before you can start your rollup node, you need to initiate, sync, and fund a light node on one of Celestia's networks on a compatible version: 17 | 18 | ::: code-group 19 | 20 | ```sh-vue [Arabica] 21 | Rollkit Version: {{constants.celestiaNodeArabicaRollkitTag}} 22 | Celestia Node Version: {{constants.celestiaNodeArabicaTag}} 23 | ``` 24 | 25 | ```sh-vue [Mocha] 26 | Rollkit Version: {{constants.celestiaNodeMochaRollkitTag}} 27 | Celestia Node Version: {{constants.celestiaNodeMochaTag}} 28 | ``` 29 | 30 | ```sh-vue [Mainnet] 31 | Rollkit Version: {{constants.celestiaNodeMainnetRollkitTag}} 32 | Celestia Node Version: {{constants.celestiaNodeMainnetTag}} 33 | ``` 34 | 35 | ::: 36 | 37 | - [Arabica Devnet](https://docs.celestia.org/nodes/arabica-devnet) 38 | - [Mocha Testnet](https://docs.celestia.org/nodes/mocha-testnet) 39 | - [Mainnet Beta](https://docs.celestia.org/nodes/mainnet) 40 | 41 | The main difference lies in how you fund your wallet address: using testnet TIA or [TIA](https://docs.celestia.org/learn/tia#overview-of-tia) for Mainnet Beta. 42 | 43 | After successfully starting a light node, it's time to start posting the batches of blocks of data that your rollup generates to Celestia. 44 | 45 | ## 🏗️ Prerequisites {#prerequisites} 46 | 47 | * `rollkit` CLI installed from the [quick start](/tutorials/quick-start) tutorial. 48 | 49 | ## 🛠️ Configuring flags for DA 50 | 51 | Now that we are posting to the Celestia DA instead of the local DA, the `rollkit start` command requires three DA configuration flags: 52 | 53 | - `--rollkit.da_start_height` 54 | - `--rollkit.da_auth_token` 55 | - `--rollkit.da_namespace` 56 | 57 | :::tip 58 | Optionally, you could also set the `--rollkit.da_block_time` flag. This should be set to the finality time of the DA layer, not its actual block time, as Rollkit does not handle reorganization logic. The default value is 15 seconds. 59 | ::: 60 | 61 | Let's determine which values to provide for each of them. 62 | 63 | First, let's query the DA layer start height using our light node. 64 | 65 | ```bash 66 | DA_BLOCK_HEIGHT=$(celestia header network-head | jq -r '.result.header.height') 67 | echo -e "\n Your DA_BLOCK_HEIGHT is $DA_BLOCK_HEIGHT \n" 68 | ``` 69 | 70 | The output of the command above will look similar to this: 71 | 72 | ```bash 73 | Your DA_BLOCK_HEIGHT is 2127672 74 | ``` 75 | 76 | Now, let's obtain the authentication token of your light node using the following command: 77 | 78 | ::: code-group 79 | 80 | ```bash [Arabica Devnet] 81 | AUTH_TOKEN=$(celestia light auth write --p2p.network arabica) 82 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 83 | ``` 84 | 85 | ```bash [Mocha Testnet] 86 | AUTH_TOKEN=$(celestia light auth write --p2p.network mocha) 87 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 88 | ``` 89 | 90 | ```bash [Mainnet Beta] 91 | AUTH_TOKEN=$(celestia light auth write) 92 | echo -e "\n Your DA AUTH_TOKEN is $AUTH_TOKEN \n" 93 | ``` 94 | 95 | ::: 96 | 97 | The output of the command above will look similar to this: 98 | 99 | ```bash 100 | Your DA AUTH_TOKEN is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJwdWJsaWMiLCJyZWFkIiwid3JpdGUiXX0.cSrJjpfUdTNFtzGho69V0D_8kyECn9Mzv8ghJSpKRDE 101 | ``` 102 | 103 | Next, let's set up the namespace to be used for posting data on Celestia: 104 | 105 | ```bash 106 | DA_NAMESPACE=00000000000000000000000000000000000000000008e5f679bf7116cb 107 | ``` 108 | 109 | :::tip 110 | `00000000000000000000000000000000000000000008e5f679bf7116cb` is a default namespace for Mocha testnet. You can set your own by using a command similar to this (or, you could get creative 😎): 111 | 112 | ```bash 113 | openssl rand -hex 10 114 | ``` 115 | 116 | Replace the last 20 characters (10 bytes) in `00000000000000000000000000000000000000000008e5f679bf7116cb` with the newly generated 10 bytes. 117 | 118 | [Learn more about namespaces](https://docs.celestia.org/developers/node-tutorial#namespaces). 119 | ::: 120 | 121 | Lastly, set your DA address for your light node, which by default runs at 122 | port 26658: 123 | 124 | ```bash 125 | DA_ADDRESS=http://localhost:26658 126 | ``` 127 | 128 | ## 🔥 Running your rollup connected to Celestia light node 129 | 130 | Finally, let's initiate the rollup node with all the flags: 131 | 132 | ```bash 133 | rollkit start \ 134 | --rollkit.aggregator \ 135 | --rollkit.da_auth_token $AUTH_TOKEN \ 136 | --rollkit.da_namespace $DA_NAMESPACE \ 137 | --rollkit.da_start_height $DA_BLOCK_HEIGHT \ 138 | --rollkit.da_address $DA_ADDRESS 139 | ``` 140 | 141 | Now, the rollup is running and posting blocks (aggregated in batches) to Celestia. You can view your rollup by using your namespace or account on one of Celestia's block explorers. 142 | 143 | For example, [here on Celenium for Arabica](https://arabica.celenium.io/). 144 | 145 | Other explorers: 146 | - [Arabica testnet](https://docs.celestia.org/nodes/arabica-testnet#explorers) 147 | - [Mocha testnet](https://docs.celestia.org/nodes/mocha-testnet#explorers) 148 | - [Mainnet Beta](https://docs.celestia.org/nodes/mainnet#explorers) 149 | 150 | ## 🎉 Next steps 151 | 152 | Congratulations! You've built a local rollup that posts data to Celestia's DA layer. Well done! Now, go forth and build something great! Good luck! 153 | -------------------------------------------------------------------------------- /tutorials/da/local-da.md: -------------------------------------------------------------------------------- 1 | # Using Local DA 2 | 3 | 4 | 7 | 8 | ## Introduction {#introduction} 9 | 10 | This tutorial serves as a comprehensive guide for using the [local-da](https://github.com/rollkit/local-da) with your chain. 11 | 12 | Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) or [build a chain](/tutorials/wordle) tutorial, which covers installing the rollkit CLI, building your chain, and running your chain. 13 | 14 | ## Setting Up a Local DA Network 15 | 16 | To set up a local DA network node on your machine, run the following script to install and start the local DA node: 17 | 18 | ```bash-vue 19 | curl -sSL https://rollkit.dev/install-local-da.sh | bash -s {{constants.localDALatestTag}} 20 | ``` 21 | 22 | This script will build and run the node, which will then listen on port `7980`. 23 | 24 | ## Configuring your rollup to connect to the local DA network 25 | 26 | To connect your rollup to the local DA network, you need to pass the `--rollkit.da_address` flag with the local DA node address. 27 | 28 | ## Run your rollup 29 | 30 | Start your rollup node with the following command, ensuring to include the DA address flag: 31 | 32 | ::: code-group 33 | 34 | ```sh [Quick Start] 35 | rollkit start --rollkit.da_address http://localhost:7980 36 | ``` 37 | 38 | ```sh [Wordle Chain] 39 | rollkit start \ 40 | --rollkit.aggregator \ 41 | --rollkit.da_address http://localhost:7980 \ 42 | --rollkit.sequencer_rollup_id wordle 43 | ``` 44 | 45 | ::: 46 | 47 | You should see the following log message indicating that your rollup is connected to the local DA network: 48 | 49 | ```shell 50 | I[2024-11-15|14:54:19.842] DA server is already running module=main address=http://localhost:7980 51 | ``` 52 | 53 | ## Summary 54 | 55 | By following these steps, you will set up a local DA network node and configure your rollup to post data to it. This setup is useful for testing and development in a controlled environment. 56 | -------------------------------------------------------------------------------- /tutorials/da/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This page provides an overview of how rollkit integrates with DA. 3 | --- 4 | 5 | 6 | 7 | # DA 8 | 9 | Now that you have the foundations of running and building a rollup with Rollkit, it is time to start customizing it to fit your needs. 10 | 11 | The first choice you need to make is which data availability (DA) layer to use. The DA layer is a critical component of a blockchain, as it provides the data availability and finality guarantees that your chain needs to operate securely. 12 | 13 | Rollkit uses the [go-da interface](https://github.com/rollkit/go-da) to communicate to DA layers. Any DA layer that implements this interface can be used with Rollkit. 14 | 15 | ## Go DA {#go-da} 16 | 17 | The [go-da interface](https://github.com/rollkit/go-da) defines the core functions required to interact with a DA layer. Probably the two most important functions being `Get` and `Submit`. 18 | 19 | ```go 20 | // DA defines very generic interface for interaction with Data Availability layers. 21 | type DA interface { 22 | // Get returns Blob for each given ID, or an error. 23 | Get(ctx context.Context, ids []ID, namespace Namespace) ([]Blob, error) 24 | 25 | // Submit submits the Blobs to Data Availability layer. 26 | Submit(ctx context.Context, blobs []Blob, gasPrice float64, namespace Namespace) ([]ID, error) 27 | } 28 | ``` 29 | 30 | DA layers can integrate the `go-da` interface directly into their node like [Celestia](celestia-da), or they can define a middleware service like [Avail](avail-da). 31 | 32 | ## Mock DA {#mock-da} 33 | 34 | You might have noticed that we did not define any DA layer during the [quick start](../quick-start.md) or [build a chain](../wordle.md) tutorials. This is because we used a mock DA layer that is built into Rollkit. 35 | 36 | If you revisit the logs from those tutorials, you will see one of the first lines being: 37 | 38 | ```shell 39 | I[2024-11-15|14:09:41.735] Starting mock DA server module=main address=http://localhost:26658 40 | ``` 41 | 42 | The mock DA layer is a simple in-memory DA layer that is great for testing and development. It is not suitable for production use, as it does not provide the data availability and finality guarantees that a real DA layer would. 43 | 44 | ## DA Layers {#da-layers} 45 | 46 | Now that you have a better understanding of what a DA layer is, you can start to explore the different DA layers that are available to use with Rollkit. 47 | 48 | * [Local DA](local-da.md) 49 | * [Celestia DA](celestia-da.md) 50 | * [Avail DA](avail-da.md) 51 | -------------------------------------------------------------------------------- /tutorials/deploy-overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: This page provides an overview of some common ways to deploy rollups. 3 | --- 4 | 5 | # Deploying Your Rollup 6 | 7 | One of the benefits of building rollups with Rollkit is the flexibility you have as a developer to choose things like the DA layer, the settlement scheme, and the execution environment. 8 | 9 | The challenge that comes with this flexibility is that there are more services that now need to be deployed and managed while running your rollup. 10 | 11 | In the tutorials so far, you've seen various helper scripts used to make things easier. While great for tutorials, there are better ways to deploy and manage rollups than using various bash scripts. 12 | 13 | In this section, you'll see a few examples of how you can deploy your rollup environment with all your services running in a more production-ready way. 14 | 15 | :::warning Disclaimer 16 | These examples are for educational purposes only. Before deploying your rollup for production use you should fully understand the services you are deploying and your choice in deployment method. 17 | ::: 18 | 19 | * [Deploy with Docker Compose](/tutorials/docker-compose) 20 | 21 | -------------------------------------------------------------------------------- /tutorials/docker-compose.md: -------------------------------------------------------------------------------- 1 | # 🐳 Docker Compose 2 | 3 | This tutorial is going to show you how to deploy the [wordle chain](/tutorials/wordle.md) using Docker Compose. 4 | 5 | You can learn more about Docker Compose [here](https://docs.docker.com/compose/). 6 | 7 | 8 | 12 | 13 | :::tip 14 | 15 | ::: 16 | 17 | 18 | ## 💻 Pre-requisites {#prerequisites} 19 | 20 | Make sure you have your wordle chain ready by completing [the Build your chain tutorial](/tutorials/wordle.md). 21 | 22 | ## 🛠️ Dependencies {#dependencies} 23 | 24 | ### 💻 Docker Compose {#docker-compose} 25 | 26 | You can [install docker compose here](https://docs.docker.com/compose/install/). 27 | 28 | Once installed, you can verify the installation by running: 29 | 30 | ```bash 31 | docker compose version 32 | ``` 33 | ```bash 34 | Docker Compose version v2.23.0-desktop.1 35 | ``` 36 | 37 | ## 🛠️ Setting up your environment {#setting-up-your-environment} 38 | 39 | In addition to our chain, we need to run a DA and Sequencer node. 40 | 41 | We will use the [local-da](https://github.com/rollkit/local-da) and [local-sequencer](https://github.com/rollkit/go-sequencing) for this tutorial and run it with our chain. 42 | 43 | To save time, we can use their respective Dockerfiles: 44 | * [local-da Dockerfile](https://github.com/rollkit/local-da/blob/main/Dockerfile) 45 | * [local-sequencer Dockerfile](https://github.com/rollkit/go-sequencing/blob/main/Dockerfile) 46 | 47 | This will allow us to focus on how we can run the wordle chain with Docker Compose. 48 | 49 | ### 🐳 Dockerfile {#dockerfile} 50 | 51 | First, we need to create a Dockerfile for our wordle chain. Create a new file called `Dockerfile` in the root of the `wordle` directory and add the following code: 52 | 53 | ```dockerfile-vue 54 | # Stage 1: Install ignite CLI and rollkit 55 | FROM golang as base 56 | 57 | # Install dependencies 58 | RUN apt update && \ 59 | apt-get install -y \ 60 | build-essential \ 61 | ca-certificates \ 62 | curl 63 | 64 | # Install rollkit 65 | RUN curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}} 66 | 67 | # Install ignite 68 | RUN curl https://get.ignite.com/cli@{{constants.igniteVersionTag}}! | bash 69 | 70 | # Set the working directory 71 | WORKDIR /app 72 | 73 | # cache dependencies. 74 | COPY ./go.mod . 75 | COPY ./go.sum . 76 | RUN go mod download 77 | 78 | # Copy all files from the current directory to the container 79 | COPY . . 80 | 81 | # Remove the rollkit.toml and entrypoint files if they exist. This is to avoid cross OS issues. 82 | RUN rm entrypoint rollkit.toml 83 | 84 | # Build the chain 85 | RUN ignite chain build && ignite rollkit init 86 | 87 | # Initialize the rollkit.toml file 88 | RUN rollkit toml init 89 | 90 | # Run rollkit command to initialize the entrypoint executable 91 | RUN rollkit 92 | 93 | # Stage 2: Set up the runtime environment 94 | FROM debian:bookworm-slim 95 | 96 | # Install jq 97 | RUN apt update && \ 98 | apt-get install -y \ 99 | jq 100 | 101 | # Set the working directory 102 | WORKDIR /root 103 | 104 | # Copy over the rollkit binary from the build stage 105 | COPY --from=base /go/bin/rollkit /usr/bin 106 | 107 | # Copy the entrypoint and rollkit.toml files from the build stage 108 | COPY --from=base /app/entrypoint ./entrypoint 109 | COPY --from=base /app/rollkit.toml ./rollkit.toml 110 | 111 | # Copy the $HOME/.wordle directory from the build stage. 112 | # This directory contains all your chain config. 113 | COPY --from=base /root/.wordle /root/.wordle 114 | 115 | # Ensure the entrypoint script is executable 116 | RUN chmod +x ./entrypoint 117 | 118 | # Keep the container running after it has been started 119 | # CMD tail -f /dev/null 120 | 121 | ENTRYPOINT [ "rollkit" ] 122 | CMD [ "start", "--rollkit.aggregator", "--rollkit.sequencer_rollup_id", "wordle"] 123 | 124 | ``` 125 | 126 | This Dockerfile sets up the environment to build the chain and run the wordle node. It then sets up the runtime environment to run the chain. This allows you as the developer to modify any files, and then simply rebuild the Docker image to run the new chain. 127 | 128 | Build the docker image by running the following command: 129 | 130 | ```bash 131 | docker build -t wordle . 132 | ``` 133 | 134 | You can then see the built image by running: 135 | 136 | ```bash 137 | docker images 138 | ``` 139 | 140 | You should see the following output: 141 | 142 | ```bash 143 | REPOSITORY TAG IMAGE ID CREATED SIZE 144 | wordle latest 5d3533c1ea1c 8 seconds ago 443MB 145 | ``` 146 | 147 | ### 🐳 Docker Compose file {#docker-compose-file} 148 | 149 | Next we need to create our `compose.yaml` file for docker compose to use. 150 | 151 | In the root of the `wordle` directory, create a new file called `compose.yaml` and add the following code: 152 | 153 | ```yml-vue 154 | services: 155 | # Define the wordle chain service 156 | wordle: 157 | # Set the name of the docker container for ease of use 158 | container_name: wordle 159 | # Use the image we just built 160 | image: wordle 161 | # Used for networking between the two services 162 | network_mode: host 163 | # The command config is used for launching the chain once the Docker container is running 164 | command: 165 | [ 166 | "start", 167 | "--rollkit.aggregator", 168 | "--rollkit.da_address", 169 | "http://0.0.0.0:7980", 170 | "--rollkit.sequencer_address", 171 | "0.0.0.0:50051", 172 | "--rollkit.sequencer_rollup_id", 173 | "wordle", 174 | ] 175 | # Ensures the local-da service is up and running before starting the chain 176 | depends_on: 177 | - local-da 178 | - local-sequencer 179 | 180 | # Define the local DA service 181 | local-da: 182 | # Use the published image from rollkit 183 | image: 184 | ghcr.io/rollkit/local-da:{{constants.localDALatestTag}} 185 | # Set the name of the docker container for ease of use 186 | container_name: local-da 187 | # Publish the ports to connect 188 | ports: 189 | - "7980:7980" 190 | 191 | # Define the local sequencer service 192 | local-sequencer: 193 | # Use the published image from rollkit 194 | image: 195 | ghcr.io/rollkit/go-sequencing:{{constants.goSequencingLatestTag}} 196 | # Set the name of the docker container for ease of use 197 | container_name: local-sequencer 198 | # Start the sequencer with the listen all flag and the rollup id set to wordle 199 | command: ["-listen-all", "-rollup-id=wordle"] 200 | # Publish the ports to connect 201 | ports: 202 | - "50051:50051" 203 | ``` 204 | 205 | We now have all we need to run the wordle chain and connect to a local DA node. 206 | 207 | ### 🚀 Run Wordle chain {#run-wordle-chain} 208 | 209 | Run your wordle chain by running the following command: 210 | 211 | ```bash 212 | docker compose up 213 | ``` 214 | 215 | You'll see logs of your chain being output. 216 | 217 | Congratulations! You have successfully run the wordle chain with Docker Compose. 218 | 219 | ## 🚀 Interacting with the chain {#interacting-with-the-chain} 220 | 221 | Since we are using docker images, we can interact with the chain by entering the docker container. 222 | 223 | You can see the docker containers running with the wordle chain and the local DA node by running the following command: 224 | 225 | ```bash 226 | docker ps 227 | ``` 228 | 229 | You should see output like the following: 230 | 231 | ```bash 232 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 233 | 86f9bfa5b6d2 wordle "rollkit start --rol…" 7 minutes ago Up 3 seconds wordle 234 | 67a2c3058e01 local-sequencer "local-sequencer -li…" 11 minutes ago Up 3 seconds 0.0.0.0:50051->50051/tcp local-sequencer 235 | dae3359665f8 local-da "local-da -listen-all" 2 hours ago Up 3 seconds 0.0.0.0:7980->7980/tcp local-da 236 | ``` 237 | 238 | We can see the wordle chain running in container `wordle` and the local DA network running in container `local-da`. 239 | 240 | Since our chain is running in a docker container, we want to enter the docker container to interact with it via the Rollkit CLI. We can do this by running: 241 | 242 | ```bash 243 | docker exec -it wordle sh 244 | ``` 245 | 246 | Now that you are in the docker container, you can interact with the chain using the Rollkit CLI and the example commands you used in the [Wordle tutorial](/tutorials/wordle#interacting-with-the-chain). 247 | 248 | Once you are done interacting with your chain, you can exit out of your docker container with: 249 | 250 | ```bash 251 | exit 252 | ``` 253 | 254 | Then you can shut down your chain environment by running `CRTL+C` in your terminal. 255 | 256 | ## 🎉 Next steps 257 | 258 | Congratulations again! You now know how to run your chain with docker compose and interact with it using the Rollkit CLI in the docker container. 259 | -------------------------------------------------------------------------------- /tutorials/execution/artela-evm-plus-plus.md: -------------------------------------------------------------------------------- 1 | # Quick Start Guide for Artela EVM++ with Rollkit 2 | 3 | 4 | 9 | 10 | 11 | :::tip 12 | 13 | ::: 14 | :::warning 15 | 16 | ::: 17 | 18 | This guide will assist you to quickly set up a rollup node with [Artela EVM++](https://docs.artela.network/main/Artela-Blockchain/EVM++) execution layer using Rollkit and local-DA. 19 | 20 | ![artela-evm-rollkit](/artela-evm-rollkit/artela-evm-rollkit.png) 21 | 22 | EVM++ is a modular dual-VM execution layer that supports the dynamic creation of native extension modules for blockchain at runtime. It enables developers to leverage WasmVM to build native extensions that co-process with EVM, offering enhanced customization capabilities. More than just a dual-VM setup, these native extensions facilitate blockchain-level customization. They allow for the integration of custom logic throughout the transaction lifecycle, providing access to an expanded runtime context. 23 | 24 | ## 📦 Clone the Artela Rollkit Repository 25 | 26 | Start by cloning the Artela Rollkit repository: 27 | 28 | ```bash 29 | git clone https://github.com/artela-network/artela-rollkit.git 30 | cd artela-rollkit 31 | ``` 32 | 33 | ## 🛥️ Run with Docker Compose 34 | 35 | Ensure Docker is installed on your system before setting up the Artela rollup node. If not already installed, download and follow the setup instructions available [here](https://www.docker.com/products/docker-desktop/). 36 | 37 | :::tip 38 | Make sure you meet these [prerequisites](https://docs.docker.com/engine/network/tutorials/host/#prerequisites) of enabling host network mode in Docker. 39 | ::: 40 | 41 | After installing Docker, run the following command to start a local development node: 42 | 43 | ```bash 44 | docker compose up -d 45 | ``` 46 | 47 | This command launches the Artela rollup node with Rollkit and local-DA. To monitor the logs, use this command: 48 | 49 | ```bash 50 | docker logs artroll -f 51 | ``` 52 | 53 | If you observe the following output, the local development node is running properly: 54 | 55 | ```bash 56 | ... 57 | 7:09AM INF finalized block block_app_hash=E483920A1E1E7E492E47036300003769420813BB13BB3F25CFAFDB0DF19C144A height=3 module=BlockManager num_txs_res=0 num_val_updates=0 58 | 7:09AM INF executed block app_hash=E483920A1E1E7E492E47036300003769420813BB13BB3F25CFAFDB0DF19C144A height=3 module=BlockManager 59 | 7:09AM INF indexed block events height=3 module=txindex 60 | 7:09AM INF Creating and publishing block height=4 module=BlockManager 61 | ... 62 | ``` 63 | 64 | ## 🔑 Get prefunded test accounts 65 | 66 | Access testing accounts by entering the `artroll` Docker container: 67 | 68 | ```bash 69 | docker exec -ti artroll /bin/bash 70 | ``` 71 | 72 | Retrieve the address and private key of testing accounts using: 73 | 74 | ```bash 75 | # 👇 Alternatively, you can use myKey2.info, myKey3.info, myKey4.info 76 | ./entrypoint keyinfo --file ~/.artroll/keyring-test/mykey.info --passwd test 77 | ``` 78 | 79 | This will display the testing private key and its address: 80 | 81 | ```bash 82 | private key: { Plain Private Key in Hex Format } 83 | address: { Address Associated with the Private Key } 84 | ``` 85 | 86 | There are four testing accounts available in the local development node for interacting with the EVM chain. 87 | 88 | ## ⚙️ Configuring the Node 89 | 90 | You can modify runtime parameters of the Artela development node by adjusting its configuration files. Follow the steps below to make these changes. 91 | 92 | To configure the development node, first access the Docker container by running the following command: 93 | 94 | ```bash 95 | docker exec -it artroll /bin/bash 96 | ``` 97 | 98 | Inside the container, you will need to modify the following configuration files: 99 | 100 | - /root/.artroll/config/app.toml 101 | - /root/.artroll/config/config.toml 102 | 103 | After making the necessary changes, return to the Docker host and restart the container to apply the new configuration: 104 | 105 | ```bash 106 | docker compose restart artroll 107 | ``` 108 | 109 | ## 🧪 Build on EVM++ 110 | 111 | Let’s dive into Artela EVM++ by kicking off with the Hello World project, the following code will guide you through the essentials: 112 | 113 | 👉 [Contract interaction tutorial](/tutorials/evm-contract-interaction): Get hands-on experience with deploying and interacting with smart contracts on the Artela rollup node. 114 | 115 | :::tip 116 | When you are following the Contract interaction tutorial, you need to make the following replacements: 117 | 1. Use https://github.com/artela-network/gm-portal.git instead of the original `gm-portal` repo. 118 | 2. Use the private key you obtained from the previous step in this tutorial instead of the one used in the Contract interaction tutorial. 119 | 3. The contract address should be `0x9fcEbD70654D360b41ccD123dADAAad6ce13C788` instead of the one starts with `0x18D...`. 120 | ::: 121 | 122 | 👉 [Quick Start for Aspect on EVM++](https://docs.artela.network/develop/get-started/dev-aspect): Try your first [Aspect](https://docs.artela.network/develop/core-concepts/aspect-programming) with Artela rollup node. 123 | 124 | :::tip 125 | Please note that when you are following the Aspect on EVM++ tutorial, you need to make the following replacements: 126 | 1. Replace `npm install -g @artela/aspect-tool` with `npm install -g @artela-next/aspect-tool` 127 | 2. Replace the Artela Testnet node URL in `project.config.json` with `http://localhost:8545` to connect to your local rollup node. 128 | 3. Use the private key you obtained from the previous step in this tutorial instead of creating a new account. 129 | ::: 130 | 131 | By now, we assume that you: 132 | 133 | - Have a basic understanding of Artela technology. 134 | - Have installed and played with Artela development tools. 135 | - Understand how Aspect functions and its impact on making dApps distinct and superior. 136 | - May already have numerous innovative ideas for building on Artela. 137 | 138 | ### 📖 More to know 139 | 140 | If you want to gain a deeper understanding of Aspect’s capabilities and limitations to fully grasp how it can enhance or constrain your project, make sure not to overlook these essential concepts: 141 | 142 | - [Aspect Runtime](https://docs.artela.network/develop/core-concepts/aspect-runtime) 143 | - [Aspect Lifecycle](https://docs.artela.network/develop/core-concepts/lifecycle) 144 | - [Join Point](https://docs.artela.network/develop/core-concepts/join-point) 145 | - [Aspect Tool](https://docs.artela.network/develop/reference/aspect-tool/overview) 146 | - [Aspect Libs](https://docs.artela.network/develop/reference/aspect-lib/overview) 147 | 148 | ### 💥 Build with examples 149 | 150 | Our community has built numbers of projects with Aspect, you can refer to these projects and modify them to learn how to use Aspect more effectively. 151 | 152 | Simple examples that use the basic functionalities of Aspect: 153 | 154 | - Example 1: [Aspect Reentrancy Guard](https://github.com/artela-network/example/blob/rollkit/curve_reentrance/README.md) 155 | - Example 2: [Black List Aspect](https://github.com/artela-network/blacklist-aspect/tree/rollkit) 156 | - Example 3: [Throttler Aspect](https://github.com/artela-network/throttler-aspect/tree/rollkit) 157 | 158 | Real-world use cases that show how to build more complex projects with Aspect: 159 | 160 | - [Session key Aspect](https://github.com/artela-network/session-key-aspect/tree/rollkit): use Aspect to extend EoA with session keys and improve 161 | - [JIT-gaming Aspect](https://github.com/artela-network/jit-gaming/tree/rollkit): use Aspect to add automatic on-chain NPC for a fully on-chain game. 162 | 163 | 164 | ## 🛑 Stopping the Node 165 | 166 | To cease operations and shutdown the Artela rollup node, use: 167 | 168 | ```bash 169 | docker compose down 170 | ``` 171 | 172 | This command halts all running containers and clears the environment. 173 | 174 | ## 🎉 Conclusion 175 | 176 | Congratulations! You have successfully learnt some basic knowledge of EVM++ and have set up an Artela EVM++ rollup using Rollkit and local-DA. This setup enables you to test the integrated capabilities of Artela’s EVM++ with Rollkit. 177 | -------------------------------------------------------------------------------- /tutorials/execution/beaconkit.md: -------------------------------------------------------------------------------- 1 | # Building a Sovereign Rollup with BeaconKit and Rollkit 2 | 3 | 4 | 9 | 10 | 11 | :::tip 12 | 13 | ::: 14 | :::warning 15 | 16 | ::: 17 | 18 | ![beaconkit](https://camo.githubusercontent.com/b4a9b2b1d1536bb3dbbc32a5f3885b02dd1da8cdf9e34a160830d00ebee9120f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6475763067343032792f696d6167652f75706c6f61642f76313731383033343331322f426561636f6e4b697442616e6e65722e706e67) 19 | 20 | ## Introduction 21 | 22 | This tutorial guides developers through the process of building and running a sovereign rollup using BeaconKit and Rollkit. BeaconKit is a modular framework for building EVM-based consensus clients, while Rollkit is a modular framework for building sovereign rollups. By combining these tools, you can create your own customizable rollup chain using the Ethereum Virtual Machine (EVM). 23 | 24 | ## Prerequisites 25 | 26 | Before you begin, ensure you have the following software installed on your machine: 27 | 28 | ### Rollkit 29 | 30 | [Rollkit](https://rollkit.dev/) is a modular framework for sovereign rollups. Follow our [Quick Start Guide](https://rollkit.dev/tutorials/quick-start#%F0%9F%93%A6-install-rollkit-cli) to walk through the installation process. The installation script will install the Rollkit CLI, Golang, and jq if they are not already present on your machine. 31 | 32 | ### Docker 33 | 34 | [Docker](https://www.docker.com/desktop/install/linux-install/) is essential for running containerized applications. Follow the provided link to install Docker on your system. 35 | 36 | ## Run a local Data Availability (DA) node {#run-local-da-node} 37 | 38 | First, set up a local data availability network node: 39 | 40 | ```bash-vue 41 | cd $HOME && curl -sSL https://rollkit.dev/install-local-da.sh | sh -s {{constants.localDALatestTag}} 42 | ``` 43 | 44 | This script builds and runs a DA node, which will listen on port `7980`. 45 | 46 | ## Clone the BeaconKit repository {#clone-the-repo} 47 | 48 | Clone the BeaconKit repository and switch to the Rollkit branch: 49 | 50 | ```bash 51 | cd $HOME 52 | git clone -b rollkit https://github.com/rollkit/beacon-kit.git 53 | cd beacon-kit && git checkout rollkit 54 | ``` 55 | 56 | ## Start the Go Ethereum (Geth) client {#start-go-ethereum-client} 57 | 58 | Start local ephemeral Go Ethereum client to provide the execution layer: 59 | 60 | ```bash 61 | cd $HOME/beacon-kit 62 | make start-geth 63 | ``` 64 | 65 | Notice within logs indicating that your Geth client is running the RPC server is listening on port `8545`. You will need that port to deploy and interact with smart contracts on the BeaconKit EVM. 66 | 67 | ## Build and run the BeaconKit node {#build-and-run-beaconkit-node} 68 | 69 | Open a new terminal and run: 70 | 71 | ```bash 72 | cd $HOME/beacon-kit 73 | make start 74 | ``` 75 | 76 | This command builds, configures, and starts an ephemeral `beacond` node as a Rollkit sequencer. 77 | 78 | You should now see output indicating that your Rollkit node is running, with log messages about creating and publishing blocks, computing state roots, and other node activities: 79 | 80 | ```bash 81 | ... 82 | 11:45AM INF indexed block events height=39 module=txindex 83 | 11:45AM INF Creating and publishing block height=40 module=BlockManager 84 | 11:45AM INF requesting beacon block assembly 🙈 module=server service=validator slot=40 85 | 11:45AM INF payload retrieved from local builder 🏗️ for_slot=40 module=server num_blobs=0 override_builder=false parent_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 payload_block_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 service=payload-builder 86 | 11:45AM INF computing state root for block 🌲 module=server service=validator slot=40 87 | 11:45AM INF state root computed for block 💻 module=server service=validator slot=40 state_root=0x5f75afde5c6a596fa11c17e8c60ca291ffb31ae5c9a40392e0ceb4d45ab42037 88 | 11:45AM INF beacon block successfully built 🛠️ duration=46.93036ms module=server service=validator slot=40 state_root=0x5f75afde5c6a596fa11c17e8c60ca291ffb31ae5c9a40392e0ceb4d45ab42037 89 | 11:45AM INF received proposal with beacon_block=true blob_sidecars=true module=baseapp service=prepare-proposal 90 | 11:45AM INF no blob sidecars to verify, skipping verifier 🧢 module=server service=blockchain slot=0x28 91 | 11:45AM INF received proposal with beacon_block=true blob_sidecars=true module=baseapp service=prepare-proposal 92 | 11:45AM INF no blob sidecars to verify, skipping verifier 🧢 module=server service=blockchain slot=0x28 93 | 11:45AM INF received incoming beacon block 📫 module=server service=blockchain state_root=0x5f75afde5c6a596fa11c17e8c60ca291ffb31ae5c9a40392e0ceb4d45ab42037 94 | 11:45AM INF calling new payload is_optimistic=false module=server payload_block_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 payload_parent_block_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 service=execution-engine 95 | 11:45AM INF state root verification succeeded - accepting incoming beacon block 🏎️ module=server service=blockchain state_root=0x5f75afde5c6a596fa11c17e8c60ca291ffb31ae5c9a40392e0ceb4d45ab42037 96 | 11:45AM INF optimistically triggering payload build for next slot 🛩️ module=server next_slot=41 service=blockchain 97 | 11:45AM INF notifying forkchoice update finalized_eth1_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 has_attributes=true head_eth1_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 module=server safe_eth1_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 service=execution-engine 98 | 11:45AM WRN suggested fee recipient is not configured 🔆 fee-recipent="0x000000...000000 (20B)" module=server service=engine.client 99 | 11:45AM INF calling new payload is_optimistic=true module=server payload_block_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 payload_parent_block_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 service=execution-engine 100 | 11:45AM INF bob the builder; can we forkchoice update it?; bob the builder; yes we can 🚧 for_slot=41 head_eth1_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 module=server parent_block_root=0x9676648a3c292540562b082c20c4b6663986182f5d8733f84fb3f1445b66a4ce payload_id=0x03bc2b46dc4bef55 service=payload-builder 101 | 11:45AM INF finalized block block_app_hash=004216246AE7750D578035EA1C6CD13330BD91A0C3FDD628F96D514ACF691BE5 height=40 module=BlockManager num_txs_res=2 num_val_updates=0 102 | 11:45AM INF executed block app_hash=004216246AE7750D578035EA1C6CD13330BD91A0C3FDD628F96D514ACF691BE5 height=40 module=BlockManager 103 | 11:45AM INF notifying forkchoice update finalized_eth1_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 has_attributes=false head_eth1_hash=0x2ff9329ffecc7f395cb72acb9fd81a6085e5d75101ab14b508f6418fbcd7d0b4 module=server safe_eth1_hash=0x88081d5e4c48de2f82464f2c8b4b46df8892fe921e5e9b13113ed2a62081d843 service=execution-engine 104 | 11:45AM INF indexed block events height=40 module=txindex 105 | 11:45AM INF successfully refreshed engine auth token module=server service=engine.client 106 | 11:45AM INF Creating and publishing block height=41 module=BlockManager 107 | ... 108 | ``` 109 | 110 | ## Smart Contract Deployment and Interaction 111 | 112 | To deploy and interact with smart contracts on the BeaconKit EVM, you can use the tools you are already familiar with, follow our [Contract interaction tutorial](/tutorials/evm-contract-interaction) to get a hands on experience. 113 | 114 | To fund your account with some tokens, modify a Geth genesis file and restart the Geth client: 115 | Open `$HOME/beacon-kit/testing/files/eth-genesis.json`, and add your account address and balance: 116 | 117 | ```bash 118 | "nonce": "0x0000000000000000", 119 | "timestamp": "0x0", 120 | "alloc": { 121 | "": { // [!code focus] 122 | "balance": "0x12345000000000000000000" // [!code focus] 123 | }, // [!code focus] 124 | "0x20f33ce90a13a4b5e7697e3544c3083b8f8a51d4": { 125 | "balance": "0x123450000000000000000" 126 | }, 127 | ``` 128 | 129 | ## Conclusion 130 | 131 | Congratulations! You've successfully set up a BeaconKit node using Rollkit, creating your own sovereign rollup. This setup demonstrates the basic functionality of combining BeaconKit with Rollkit. 132 | 133 | ## Next Steps 134 | 135 | To further customize your rollup chain: 136 | 1. Experiment with different Rollkit settings to optimize performance. 137 | 2. Consider implementing custom smart contracts on your rollup. 138 | 3. Test the scalability and performance of your rollup under various conditions. 139 | 140 | ## Troubleshooting 141 | 142 | If you encounter issues: 143 | 144 | - Ensure all prerequisites are correctly installed and up to date. 145 | - Check that your local DA node is running correctly on port 7980. 146 | - Verify that the Geth client is properly initialized and running. 147 | - Review the BeaconKit logs for any specific error messages. 148 | 149 | For more detailed information and updates, visit the [BeaconKit GitHub repository](https://github.com/rollkit/beacon-kit) and the [Rollkit documentation](https://rollkit.dev/). 150 | 151 | -------------------------------------------------------------------------------- /tutorials/execution/evm-contract-interaction.md: -------------------------------------------------------------------------------- 1 | # Smart Contract Interaction on EVM Rollup 2 | 3 | 4 | 9 | 10 | 11 | :::tip 12 | 13 | ::: 14 | :::warning 15 | 16 | ::: 17 | 18 | In this tutorial, you will deploy a smart contract to your EVM rollup and interact with it on a frontend. This tutorial assumes that you spinned up an EVM rollup, know it's RPC URL, and have funded an account on it. 19 | 20 | ## Install Foundry 21 | 22 | To install Foundry, run the following commands: 23 | 24 | ```bash 25 | curl -L https://foundry.paradigm.xyz | bash 26 | foundryup 27 | ``` 28 | 29 | ## Funds 30 | 31 | Here is the private key and derived address of the account for you to be used in this tutorial (make sure to fund it with some ETH): 32 | 33 | ```bash 34 | PrivateKey: 0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 35 | Address: 0x20f33CE90A13a4b5E7697E3544c3083B8F8A51D4 36 | ``` 37 | 38 | ## Frontend 39 | 40 | Now we will make a frontend with a smart contract on our EVM rollup. First, clone the GM Portal repository: 41 | 42 | ```bash 43 | cd $HOME 44 | git clone https://github.com/rollkit/gm-portal.git 45 | cd gm-portal 46 | ``` 47 | 48 | ### Deploy the ooga booga portal contract 49 | 50 | Next, you will deploy the smart contract. 51 | Export the funded private key and RPC URL: 52 | 53 | ```bash 54 | export PRIVATE_KEY=0xfffdbb37105441e14b0ee6330d855d8504ff39e705c3afa8f859ac9865f99306 55 | export RPC_URL=http://localhost:8545 // or for Octane EVM the port is 8000 56 | ``` 57 | 58 | Use Foundry to deploy the contract to your EVM: 59 | 60 | ```bash 61 | cd contracts 62 | forge script script/GmPortal.s.sol:GmPortalScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast 63 | ``` 64 | 65 | A successful deployment's output will look similar to: 66 | 67 | ```bash 68 | forge script script/GmPortal.s.sol:GmPortalScript --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast 69 | [⠒] Compiling... 70 | [⠑] Compiling 18 files with 0.8.20 71 | [⠘] Solc 0.8.20 finished in 1.52s 72 | Compiler run successful! 73 | Script ran successfully. 74 | 75 | == Logs == 76 | i am a smart contract on EVM x Rollkit. gm! 77 | 78 | [...] 79 | 80 | ## 81 | Waiting for receipts. 82 | ⠉ [00:00:00] [######################] 1/1 receipts (0.0s) 83 | ##### 2061 84 | ✅ [Success]Hash: 0xa174e9389633972458e6dce431d84736e0709e9406c1c3b14b5fa9ae0cdd6860 85 | Contract Address: 0x18Df82C7E422A42D47345Ed86B0E935E9718eBda // [!code focus] 86 | Block: 682 87 | Paid: 0.001528707003566983 ETH (509569 gas * 3.000000007 gwei) 88 | 89 | [...] 90 | ``` 91 | 92 | From the contract deployment output, export your contract address: 93 | 94 | ```bash 95 | export CONTRACT_ADDRESS=0x18Df82C7E422A42D47345Ed86B0E935E9718eBda 96 | ``` 97 | 98 | ### Interact with the contract 99 | 100 | Send an "ooga booga" to the contract: 101 | 102 | ```bash 103 | cast send $CONTRACT_ADDRESS \ 104 | "gm(string)" "ooga booga" \ 105 | --private-key $PRIVATE_KEY \ 106 | --rpc-url $RPC_URL 107 | ``` 108 | 109 | Get total (hex-encoded) GMs (ooga boogas): 110 | 111 | ```bash 112 | cast call $CONTRACT_ADDRESS "getTotalGms()" --rpc-url $RPC_URL 113 | ``` 114 | 115 | ### Start and update the frontend 116 | 117 | Now, change into the frontend directory: 118 | 119 | ```bash 120 | cd $HOME/gm-portal/frontend 121 | yarn && yarn dev 122 | ``` 123 | 124 | Now, your frontend is running! We'll display and interact with our smart contract 125 | on our frontend. 126 | 127 | First, you will need to change the contract address on `gm-portal/frontend/src/App.tsx` to your contract address from above before you can interact with the contract on the frontend: 128 | 129 | ::: tip 130 | **Only if you changed the contract**, you will need to update the ABI in `gm-portal/frontend/GmPortal.json` from `gm-portal/contracts/out/GmPortal.sol/GmPortal.json`. This can be done with: 131 | 132 | ```bash 133 | cd $HOME 134 | cp gm-portal/contracts/out/GmPortal.sol/GmPortal.json gm-portal/frontend 135 | ``` 136 | ::: 137 | 138 | ### Interact with the frontend 139 | 140 | In order to interact with the contract on the frontend, you'll need to fund an account that you have in your Ethereum wallet 141 | or add the private key from above into your wallet. 142 | 143 | To transfer to an external account, use this command: 144 | 145 | ```bash 146 | export RECEIVER= 147 | cast send --private-key $PRIVATE_KEY $RECEIVER --value 1ether --rpc-url $RPC_URL 148 | ``` 149 | 150 | _If you are in a different terminal than the one you set the private key in originally, 151 | you may need to set it again._ 152 | 153 | Now, login with your wallet that you funded, and post a ooga booga on your ooga booga portal! 154 | 155 | ![frontend-evm](/frontend-evm.png) 156 | 157 | ### Conclusion 158 | 159 | You have successfully deployed a smart contract to your EVM rollup and interacted with it on a frontend. You can now build more complex applications on your EVM rollup! 160 | -------------------------------------------------------------------------------- /tutorials/execution/octane-evm.md: -------------------------------------------------------------------------------- 1 | # Quick start guide for Omni Octane with Rollkit 2 | 3 | 4 | 9 | 10 | 11 | :::tip 12 | 13 | ::: 14 | :::warning 15 | 16 | ::: 17 | 18 | This guide will help you quickly set up and run an Omni node using Rollkit and local-DA. 19 | 20 | ## 📦 Clone the Omni repository 21 | 22 | To get started, clone the Omni repository with the Rollkit branch: 23 | 24 | ```bash 25 | git clone -b rollkit https://github.com/rollkit/omni.git 26 | cd omni 27 | ``` 28 | 29 | ## 🏗️ Build Docker images 30 | 31 | Before running Omni, you need to build the Docker images. This step requires GoReleaser to be installed on your system. If you don't have GoReleaser, you'll need to install it first: 32 | 33 | - On macOS with Homebrew: 34 | ```bash 35 | brew install goreleaser 36 | ``` 37 | - On Linux or Windows with Go installed: 38 | ```bash 39 | go install github.com/goreleaser/goreleaser@latest 40 | ``` 41 | 42 | Make sure GoReleaser is in your PATH after installation. 43 | 44 | Once GoReleaser is installed, run the following command to build the Docker images: 45 | 46 | ```bash 47 | make build-docker 48 | ``` 49 | 50 | This command will build all the necessary Docker images for running Omni with Rollkit. 51 | 52 | If you encounter any issues with GoReleaser or the build process, make sure you have sufficient free space on your machine. You can check your available disk space using the `df -h` command on Linux/macOS or `powershell -command "Get-PSDrive -PSProvider 'FileSystem'"` on Windows. 53 | 54 | ## 🚀 Deploy Omni with Rollkit and local-DA 55 | 56 | To start your Omni node with Rollkit and local-DA, execute: 57 | 58 | ```bash 59 | make devnet-zero-deploy 60 | ``` 61 | 62 | Upon execution, the command will set up and start your Omni node. You should see output indicating the progress and status of your node. Notice the `EVM Chain RPC available` message, which indicates that the Omni node is ready to accept EVM transactions: 63 | 64 | ```bash 65 | 24-07-22 20:29:03.655 INFO EVM Chain RPC available chain_id=1651 chain_name=omni_evm url=http://127.0.0.1:8000 66 | ``` 67 | 68 | ## 🧪 Smart Contract Deployment and Interaction 69 | 70 | To deploy and interact with smart contracts on the Omni EVM, you can use the tools you are already familiar with, follow our [Contract interaction tutorial](/tutorials/evm-contract-interaction) to get a hands on experience. 71 | 72 | To fund your account with some tokens, you can use the omni-cli, which needs to be installed first: 73 | 74 | ```bash 75 | make install-cli # install omni cli 76 | omni devnet fund --rpc-url http://127.0.0.1:8000 --address= 77 | ``` 78 | 79 | ## 🛑 Stopping the node 80 | 81 | When you're done and want to stop the Omni node, use the following command: 82 | 83 | ```bash 84 | make devnet-zero-clean 85 | ``` 86 | 87 | This will stop all running containers and clean up the environment. 88 | 89 | ## 🎉 Conclusion 90 | 91 | That's it! You've successfully set up and run an Omni node with Rollkit and local-DA. This setup allows you to experiment with Omni's capabilities integrated with Rollkit. 92 | -------------------------------------------------------------------------------- /tutorials/quick-start.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Quickly start a rollup node using the Rollkit CLI. 3 | --- 4 | 5 | 8 | 9 | # Quick start guide 10 | 11 | Welcome to Rollkit, a sovereign rollup framework! The easiest way to launch your sovereign rollup node is by using the Rollkit CLI. 12 | 13 | ## 📦 Install Rollkit (CLI) 14 | 15 | To install Rollkit, run the following command in your terminal: 16 | 17 | ```bash-vue 18 | curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}} 19 | ``` 20 | 21 | Verify the installation by checking the Rollkit version: 22 | 23 | ```bash 24 | rollkit version 25 | ``` 26 | 27 | A successful installation will display the version number and its associated git commit hash. 28 | 29 | ## 🚀 Run your sovereign rollup node 30 | 31 | To start a basic sovereign rollup node, execute: 32 | 33 | ```bash 34 | rollkit start 35 | ``` 36 | 37 | Upon execution, the CLI will output log entries that provide insights into the node's initialization and operation: 38 | 39 | ```bash 40 | I[2024-05-01|09:58:46.001] Found private validator module=main keyFile=/root/.rollkit/config/priv_validator_key.json stateFile=/root/.rollkit/data/priv_validator_state.json 41 | I[2024-05-01|09:58:46.002] Found node key module=main path=/root/.rollkit/config/node_key.json 42 | I[2024-05-01|09:58:46.002] Found genesis file module=main path=/root/.rollkit/config/genesis.json 43 | ... 44 | I[2024-05-01|09:58:46.080] Started node module=main 45 | I[2024-05-01|09:58:46.081] Creating and publishing block module=BlockManager height=223 46 | I[2024-05-01|09:58:46.082] Finalized block module=BlockManager height=223 num_txs_res=0 num_val_updates=0 block_app_hash= 47 | ``` 48 | 49 | ## 🎉 Conclusion 50 | 51 | That's it! Your sovereign rollup node is now up and running. It's incredibly simple to start a blockchain (which is essentially what a rollup is) these days using Rollkit. Explore further and discover how you can build useful applications on Rollkit. Good luck! 52 | -------------------------------------------------------------------------------- /tutorials/sequencing/astria.md: -------------------------------------------------------------------------------- 1 | # Astria Sequencing 2 | 3 | Coming soon ... 4 | 5 | Track progress on the [GitHub](https://github.com/rollkit/astria-sequencer) 6 | -------------------------------------------------------------------------------- /tutorials/sequencing/based.md: -------------------------------------------------------------------------------- 1 | # Based Sequencing 2 | 3 | Coming soon ... 4 | 5 | Track progress on the [GitHub](https://github.com/rollkit/based-sequencer) 6 | -------------------------------------------------------------------------------- /tutorials/sequencing/centralized.md: -------------------------------------------------------------------------------- 1 | # Centralized Sequencer 2 | 3 | 4 | 7 | 8 | A centralized sequencer is a sequencing middleware that receives rollup transactions and provides a local sequencing capabilities. Meaning, the transactions are ordered in the order they are received by the sequencer without any censorship. Further, the sequenced batches are made available in the DA network (such as Celestia). Under the hood, the centralized sequencer is a GRPC server that implements `go-sequencing` interface and the server is hosted by the same node that is running the aggregator for the Rollkit rollup. 9 | 10 | ![Rollkit with Centralized Sequencer](/public/img/sequencing.jpg) 11 | 12 | ## Prerequisites {#prerequisites} 13 | 14 | This tutorial serves as a comprehensive guide for using the [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) with your chain. 15 | 16 | Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) or [build a chain](/tutorials/wordle) tutorial, which covers installing the rollkit CLI, building your chain, and running your chain. 17 | 18 | :::tip 19 | It is important to note that the centralized sequencer expects a DA layer to be running when it starts. This means that you need to launch your DA Layer before starting the centralized sequencer. 20 | ::: 21 | 22 | Additionally, you should have completed one of the [DA Layer tutorials](../da/overview) and have your DA layer ready to use with the centralized sequencer. This tutorial will use the [local-da layer](../da/local) as an example. 23 | 24 | ## Installation the Centralized Sequencer {#installation-centralized-sequencer} 25 | 26 | ```sh-vue 27 | git clone --depth 1 --branch {{constants.centralizedSequencerLatestTag}} https://github.com/rollkit/centralized-sequencer.git 28 | cd centralized-sequencer 29 | make build 30 | ./build/centralized-sequencer -h 31 | ``` 32 | 33 | You should see the following output: 34 | 35 | ```sh 36 | Usage: 37 | -host string 38 | centralized sequencer host (default "localhost") 39 | -port string 40 | centralized sequencer port (default "50051") 41 | -listen-all 42 | listen on all network interfaces (0.0.0.0) instead of just localhost 43 | -rollup-id string 44 | rollup id (default "rollupId") 45 | -batch-time duration 46 | time in seconds to wait before generating a new batch (default 2s) 47 | -da_address string 48 | DA address (default "http://localhost:26658") 49 | -da_auth_token string 50 | auth token for the DA 51 | -da_namespace string 52 | DA namespace where the sequencer submits transactions 53 | -db_path string 54 | path to the database 55 | ... 56 | ``` 57 | 58 | As shown by the help command, a centralized sequencer is configured to serve a rollup (via `rollup_id`). The DA network to persist the sequenced batches are specified using `da_address`, `da_auth_token` and `da_namespace`. 59 | 60 | 61 | ## Run the centralized sequencer {#run-the-centralized-sequencer} 62 | 63 | :::tip 64 | As mentioned in the prerequisities, you should have your DA layer running. These steps assume the local-da is running on `http://localhost:7980`. 65 | ::: 66 | 67 | Start your centralized sequencer with the following command: 68 | 69 | ::: code-group 70 | 71 | ```sh [Quick Start] 72 | ./build/centralized-sequencer -rollup-id my-rollup -da_address http://localhost:7980 73 | ``` 74 | 75 | ```sh [Build a Chain] 76 | ./build/centralized-sequencer -rollup-id wordle -da_address http://localhost:7980 77 | ``` 78 | ::: 79 | 80 | 81 | ## Run your chain {#run-your-chain} 82 | 83 | To connect your chain to the centralized sequencer, you need to pass the `--rollkit.sequencer_address` flag with the local sequencer address and the `--rollkit.sequencer_rollup_id` to ensure your rollup id matches what the sequencer is expecting. 84 | 85 | Start your chain with the following command, ensuring to include the sequencer flag: 86 | 87 | ::: code-group 88 | 89 | ```sh [Quick Start] 90 | rollkit start \ 91 | --rollkit.da_address http://localhost:7980 \ 92 | --rollkit.sequencer_address localhost:50051 \ 93 | --rollkit.sequencer_rollup_id my-rollup 94 | ``` 95 | 96 | ```sh [Wordle Chain] 97 | rollkit start \ 98 | --rollkit.aggregator \ 99 | --rollkit.da_address http://localhost:7980 \ 100 | --rollkit.sequencer_address localhost:50051 \ 101 | --rollkit.sequencer_rollup_id wordle 102 | ``` 103 | 104 | ::: 105 | 106 | You should see the following log messages indicating that your chain is connected to the local sequencer: 107 | 108 | ```sh 109 | I[2024-11-15|15:22:33.636] sequencer already running module=main address=localhost:50051 110 | I[2024-11-15|15:22:33.636] make sure your rollupID matches your sequencer module=main rollupID=my-rollup 111 | ``` 112 | 113 | Then after a few blocks you should see this message confirming that your sequencer is successfully submitting batches to the DA layer: 114 | 115 | ```sh 116 | I[2024-11-15|16:04:07.698] successfully submitted Rollkit headers to DA layer module=BlockManager gasPrice=-1 daHeight=1 headerCount=14 117 | ``` 118 | 119 | ## Metrics {#metrics} 120 | 121 | The `centralized-sequencer` node reports Prometheus metrics when the `-metrics` flag is enabled. 122 | 123 | By default, metrics are exported to `http://localhost:8080/metrics`. 124 | 125 | The listening address and port can be configured with the `-metrics-address` flag. 126 | 127 | The following metrics are available: 128 | 129 | | **Name** | **Type** | **Tags** | **Description** | 130 | |-------------------------------------------|-----------|-----------|------------------------------------------------------------------------| 131 | | sequencer_gas_price | Gauge | | Gas price of the DA transaction | 132 | | sequencer_last_blob_size | Gauge | | Last blob size submitted to the DA | 133 | | sequencer_transaction_status | Gauge | | Transaction status of the DA transaction | 134 | | sequencer_num_pending_blocks | Gauge | | Number of blocks pending DA submission | 135 | | sequencer_included_block_height | Gauge | | Block height of the last DA transaction | 136 | 137 | ## Summary {#summary} 138 | 139 | By following these steps, you will have successfully set up and connected your chain to the centralized sequencer. You can now start submitting transactions to your chain. 140 | -------------------------------------------------------------------------------- /tutorials/sequencing/forced-inclusion.md: -------------------------------------------------------------------------------- 1 | # Forced Inclusion 2 | 3 | Coming soon ... -------------------------------------------------------------------------------- /tutorials/sequencing/local.md: -------------------------------------------------------------------------------- 1 | # Local Sequencer 2 | 3 | 4 | 7 | 8 | ## Introduction {#introduction} 9 | 10 | This tutorial serves as a comprehensive guide for using the [local-sequencer](https://github.com/rollkit/go-sequencing) with your chain. 11 | 12 | Before proceeding, ensure that you have completed the [quick start](/tutorials/quick-start) or [build a chain](/tutorials/wordle) tutorial, which covers installing the rollkit CLI, building your chain, and running your chain. 13 | 14 | ## Setting Up a Local Local Sequencer 15 | 16 | To set up a local sequencer on your machine, run the following script to install and start the local sequencer: 17 | 18 | ::: code-group 19 | 20 | ```bash-vue [Quick Start] 21 | curl -sSL https://rollkit.dev/install-local-sequencer.sh | bash -s {{constants.goSequencingLatestTag}} my-rollup 22 | ``` 23 | 24 | ```bash-vue [Build a Chain] 25 | curl -sSL https://rollkit.dev/install-local-sequencer.sh | bash -s {{constants.goSequencingLatestTag}} wordle 26 | ``` 27 | 28 | ::: 29 | 30 | This script will build and run the sequencer, which will then listen on port `50051` with the `rollup-id` of your chain. 31 | 32 | ## Configuring your chain to connect to the local sequencer 33 | 34 | To connect your chain to the local sequencer, you need to pass the `--rollkit.sequencer_address` flag with the centralized sequencer address and the `--rollkit.sequencer_rollup_id` to ensure your rollup id matches what the sequencer is expecting. 35 | 36 | ## Run your chain 37 | 38 | Start your chain with the following command, ensuring to include the sequencer flag: 39 | 40 | ::: code-group 41 | 42 | ```sh [Quick Start] 43 | rollkit start \ 44 | --rollkit.sequencer_address localhost:50051 \ 45 | --rollkit.sequencer_rollup_id my-rollup 46 | ``` 47 | 48 | ```sh [Wordle Chain] 49 | rollkit start \ 50 | --rollkit.aggregator \ 51 | --rollkit.sequencer_address localhost:50051 \ 52 | --rollkit.sequencer_rollup_id wordle 53 | ``` 54 | 55 | ::: 56 | 57 | You should see the following log messages indicating that your chain is connected to the local sequencer: 58 | 59 | ```sh 60 | I[2024-11-15|15:22:33.636] sequencer already running module=main address=localhost:50051 61 | I[2024-11-15|15:22:33.636] make sure your rollupID matches your sequencer module=main rollupID=my-rollup 62 | ``` 63 | 64 | ## Summary 65 | 66 | By following these steps, you will have successfully set up and connected your chain to the local sequencer. You can now start submitting transactions to your chain. 67 | -------------------------------------------------------------------------------- /tutorials/sequencing/overview.md: -------------------------------------------------------------------------------- 1 | # Sequencing 2 | 3 | The next step after choosing your DA layer is to choose your sequencing scheme. 4 | 5 | ## Rollkit prior to Sequencing 6 | Rollkit's aggregator node was responsible for selecting and ordering transactions for including in the rollup blocks. The Rollkit aggregator used to follow a FCFS strategy, where every transaction submitted gets included in the block in order without any censorship. Use of a different sequencing strategy or connecting to a sequencing network (e.g., Astria) was not possible. Rollkit [v0.14.0](https://github.com/rollkit/rollkit/releases/tag/v0.14.0) onwards makes it possible for rollkit to connect to a sequencing network and communicate via grpc. 7 | 8 | ## Sequencing Interface {#sequencing-interface} 9 | 10 | [go-sequencing](https://github.com/rollkit/go-sequencing) defines a sequencing interface for communicating between any sequencing network and Rollkit. The key functions of the interface are defined as shown below. 11 | 12 | ```go 13 | SubmitRollupTransaction(rollupId, data) returns (error) 14 | 15 | GetNextBatch(rollupId, lastBatchHash, maxBytes) returns (batch, timestamp) 16 | 17 | VerifyBatch(rollupId, batchHash) returns (status) 18 | ``` 19 | 20 | It mainly consists of: 21 | * `SubmitRollupTransaction` relays the rollup transactions from Rollkit rollup to the sequencing network 22 | * `GetNextBatch` returns the next batch of transactions along with a deterministic timestamp 23 | * `VerifyBatch` validates the sequenced batch 24 | 25 | ## Mock Sequencer {#mock-sequencer} 26 | 27 | You might have noticed that we did not define a specific sequencer during the [quick start](../quick-start.md) or [build a chain](../wordle.md) tutorials. This is because we used a mock sequencer that is built into Rollkit. 28 | 29 | If you revisit the logs from those tutorials, you will see one of the first lines being: 30 | 31 | ```shell 32 | I[2024-11-15|14:54:19.843] Starting mock sequencer module=main address=localhost:50051 rollupID=test-rollup-a736683c 33 | ``` 34 | 35 | The mock sequencer is a simple in-memory sequencer that is great for testing and development. It is not suitable for production use. 36 | 37 | ## Sequencing Implementations {#sequencing-implementations} 38 | 39 | An implementation of the sequencing interface mainly acts as a middleware that connects Rollkit rollup and the sequencing layer. It implements the sequencing interface functions described above. For example, [centralized-sequencer](https://github.com/rollkit/centralized-sequencer) is the refactored functionality from the Rollkit prior to `v0.14.0`. The centralized sequencer is the middleware run by the aggregator node of the Rollkit rollup. The aggregator node relays rollup transactions to centralized sequencer which then submits them to the DA network (such as Celestia). The header producer node then retrieves (via `GetNextBatch`) the batched transaction from the centralized sequencer to execute the transactions and produce the updated rollup state. Similarly, there are other sequencing middlewares which can be built for various sequencing strategies or even for connecting to different third-party sequencing networks. 40 | 41 | The sequencing implementations that are currently work in progress: 42 | * [local-sequencer](local) 43 | * [centralized-sequencer](centralized) 44 | * [based-sequencer](based) 45 | * [forced-inclusion-sequencer](forced-inclusion) 46 | * [astria-sequencer](astria) 47 | --------------------------------------------------------------------------------