Skip to content

Commit

Permalink
Merge branch 'main' into yarik/full-node-local-da
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikbratashchuk authored Sep 5, 2024
2 parents 7cda96a + abea250 commit 50cdf7d
Show file tree
Hide file tree
Showing 12 changed files with 200 additions and 28 deletions.
1 change: 1 addition & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ function sidebarHome() {
items: [
{ text: "Omni Octane EVM", link: "/tutorials/octane-evm" },
{ text: "BeaconKit EVM", link: "/tutorials/beaconkit" },
{ text: "Artela EVM++", link: "/tutorials/artela-evm-plus-plus" },
{ text: "Contract interaction", link: "/tutorials/evm-contract-interaction" },
]
},
Expand Down
8 changes: 4 additions & 4 deletions guides/block-times.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ If you have gone through both the [GM world](./gm-world) and the
[Full and sequencer node rollup setup](./full-and-sequencer-node)
already, you're now ready to experiment with faster block times.

In your `gmd start [args...]` command, you will need to add a flag
In your `rollkit start [args...]` command, you will need to add a flag
and then the argument for block time.

The flag is:
Expand All @@ -19,8 +19,8 @@ Here is an example:

```bash
# start the chain
gmd start [existing flags...] // [!code --]
gmd start [existing flags...] --rollkit.block_time 1s // [!code ++]
rollkit start [existing flags...] // [!code --]
rollkit start [existing flags...] --rollkit.block_time 1s // [!code ++]
```

In the above example, we've changed it to one second blocks.
Expand All @@ -33,5 +33,5 @@ Alternatively, you could slow your rollup down to 30 seconds:
Or speed it up even more, to sub-second block times (100 milliseconds):

```bash
--rollkit.block_time 0.1ms
--rollkit.block_time 100ms
```
4 changes: 2 additions & 2 deletions guides/gas-price.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The gas price can also be configured manually with the flag
`--rollkit.da_gas_price`:

```bash
gmd start --rollkit.da_gas_price=0.1 [existing flags...]
rollkit start --rollkit.da_gas_price=0.1 [existing flags...]
```

This configures the rollup to always use the fixed gas price of `0.1utia/gas`.
Expand All @@ -19,7 +19,7 @@ To avoid such transient blob submission failures, the flag
`--rollkit.da_gas_multiplier` may be used:

```bash
gmd start --rollkit.da_gas_price=0.1 --rollkit.da_gas_multiplier=1.2 [...]
rollkit start --rollkit.da_gas_price=0.1 --rollkit.da_gas_multiplier=1.2 [...]
```

This configures the rollup to keep increasing the gas price by a factor of 1.2x
Expand Down
10 changes: 5 additions & 5 deletions guides/lazy-sequencing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ To turn on lazy sequencing, add the following flag to your start command:
--rollkit.lazy_aggregator
```

Optionally, if you want to specify a custom time to wait to accumulate transactions in lazy mode, use:
Additionally, if you want to specify the time interval used for block production even if there are no transactions, use:

```bash
--rollkit.lazy_buffer_time <duration>
--rollkit.lazy_block_time <duration>
```

An example command with a custom buffer wait time would look like this:
An example command with a custom block time of 1 minute:

```bash
# start the chain
gmd start [existing flags...] // [!code --]
gmd start [existing flags...] --rollkit.lazy_aggregator --rollkit.lazy_buffer_time=30s // [!code ++]
rollkit start [existing flags...] // [!code --]
rollkit start [existing flags...] --rollkit.lazy_aggregator --rollkit.lazy_block_time=1m0s // [!code ++]
```
8 changes: 4 additions & 4 deletions guides/restart-rollup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For the GM world tutorial, you can restart the chain by
Use the `DA_START_HEIGHT`, `NAMESPACE`, and `AUTH_TOKEN` variables from your original
start command.

Using the `gmd` rollup as an example, you can add something similar to your
Using the `rollkit` rollup as an example, you can add something similar to your
respective start script to make it easier to save variables for later use:

```bash
Expand All @@ -27,7 +27,7 @@ rm restart-local.sh
echo "DA_BLOCK_HEIGHT=$DA_BLOCK_HEIGHT" >> restart-local.sh
echo "NAMESPACE=$NAMESPACE" >> restart-local.sh
echo "AUTH_TOKEN=$AUTH_TOKEN" >> restart-local.sh
echo "gmd start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace \$NAMESPACE --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\"" >> restart-local.sh
echo "rollkit start --rollkit.aggregator --rollkit.da_auth_token=\$AUTH_TOKEN --rollkit.da_namespace \$NAMESPACE --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\"" >> restart-local.sh
```


Expand Down Expand Up @@ -81,7 +81,7 @@ You can stop your gm chain (or other Rollkit rollup) by using `Control + C` in y
To reiterate, before restarting the chain, you will need to increase the gas fee in order to avoid a `Code: 19` error:

```bash
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
rollkit start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
```

### 🔁 Restarting your rollup {#restarting-your-rollup}
Expand All @@ -93,7 +93,7 @@ Follow the [restart rollup](#restart-rollup) section above.
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:

```bash
gmd start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
rollkit start --rollkit.aggregator --rollkit.da_auth_token=$AUTH_TOKEN --rollkit.da_namespace $NAMESPACE --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"
```

🎊 Congrats! You've successfully restarted your Rollkit rollup after running out of TIA.
12 changes: 12 additions & 0 deletions learn/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ The following RPC protocols are currently supported:
- JSON-RPC over HTTP
- JSON-RPC over WebSockets

The RPC provides an additional query for DA included blocks using the `height` parameter:

```sh
curl http://127.0.0.1:26657/block?height=1

curl http://127.0.0.1:26657/block?height=included
```

#### Parameters
- height (integer or string): height of the requested block. If no height is specified the latest block will be used. If height is set to the string "included", the latest DA included block will be returned.


### P2P layer

Rollkit's [P2P layer](https://github.com/rollkit/rollkit/tree/main/p2p) enables
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/artela-evm-rollkit/artela-evm-rollkit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 changes: 144 additions & 0 deletions tutorials/artela-evm-plus-plus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# Quick Start Guide for Artela EVM++ with Rollkit

<script setup>
import constants from '../.vitepress/constants/constants.js'
</script>

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.

![artela-evm-rollkit](/artela-evm-rollkit/artela-evm-rollkit.png)

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.

## 📦 Clone the Artela Rollkit Repository

Start by cloning the Artela Rollkit repository:

```bash
git clone https://github.com/artela-network/artela-rollkit.git
cd artela-rollkit
```

## 🛥️ Run with Docker Compose

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/).

:::tip
Make sure you meet these [prerequisites](https://docs.docker.com/engine/network/tutorials/host/#prerequisites) of enabling host network mode in Docker.
:::

After installing Docker, run the following command to start a local development node:

```bash
docker compose up -d
```

This command launches the Artela rollup node with Rollkit and local-DA. To monitor the logs, use this command:

```bash
docker logs artroll -f
```

If you observe the following output, the local development node is running properly:

```bash
...
7:09AM INF finalized block block_app_hash=E483920A1E1E7E492E47036300003769420813BB13BB3F25CFAFDB0DF19C144A height=3 module=BlockManager num_txs_res=0 num_val_updates=0
7:09AM INF executed block app_hash=E483920A1E1E7E492E47036300003769420813BB13BB3F25CFAFDB0DF19C144A height=3 module=BlockManager
7:09AM INF indexed block events height=3 module=txindex
7:09AM INF Creating and publishing block height=4 module=BlockManager
...
```

## 🔑 Get prefunded test accounts

Access testing accounts by entering the `artroll` Docker container:

```bash
docker exec -ti artroll /bin/bash
```

Retrieve the address and private key of testing accounts using:

```bash
# 👇 Alternatively, you can use myKey2.info, myKey3.info, myKey4.info
./entrypoint keyinfo --file ~/.artroll/keyring-test/mykey.info --passwd test
```

This will display the testing private key and its address:

```bash
private key: { Plain Private Key in Hex Format }
address: { Address Associated with the Private Key }
```
There are four testing accounts available in the local development node for interacting with the EVM chain.
## 🧪 Build on EVM++
Let’s dive into Artela EVM++ by kicking off with the Hello World project, the following code will guide you through the essentials:
👉 [Contract interaction tutorial](/tutorials/evm-contract-interaction): Get hands-on experience with deploying and interacting with smart contracts on the Artela rollup node.
:::tip
When you are following the Contract interaction tutorial, you need to make the following replacements:
1. Use https://github.com/artela-network/gm-portal.git instead of the original `gm-portal` repo.
2. Use the private key you obtained from the previous step in this tutorial instead of the one used in the Contract interaction tutorial.
3. The contract address should be `0x9fcEbD70654D360b41ccD123dADAAad6ce13C788` instead of the one starts with `0x18D...`.
:::
👉 [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.
:::tip
Please note that when you are following the Aspect on EVM++ tutorial, you need to make the following replacements:
1. Replace `npm install -g @artela/aspect-tool` with `npm install -g @artela-next/aspect-tool`
2. Replace the Artela Testnet node URL in `project.config.json` with `http://localhost:8545` to connect to your local rollup node.
3. Use the private key you obtained from the previous step in this tutorial instead of creating a new account.
:::
By now, we assume that you:
- Have a basic understanding of Artela technology.
- Have installed and played with Artela development tools.
- Understand how Aspect functions and its impact on making dApps distinct and superior.
- May already have numerous innovative ideas for building on Artela.
### 📖 More to know
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:
- [Aspect Runtime](https://docs.artela.network/develop/core-concepts/aspect-runtime)
- [Aspect Lifecycle](https://docs.artela.network/develop/core-concepts/lifecycle)
- [Join Point](https://docs.artela.network/develop/core-concepts/join-point)
- [Aspect Tool](https://docs.artela.network/develop/reference/aspect-tool/overview)
- [Aspect Libs](https://docs.artela.network/develop/reference/aspect-lib/overview)
### 💥 Build with examples
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.
Simple examples that use the basic functionalities of Aspect:
- Example 1: [Aspect Reentrancy Guard](https://github.com/artela-network/example/blob/rollkit/curve_reentrance/README.md)
- Example 2: [Black List Aspect](https://github.com/artela-network/blacklist-aspect/tree/rollkit)
- Example 3: [Throttler Aspect](https://github.com/artela-network/throttler-aspect/tree/rollkit)
Real-world use cases that show how to build more complex projects with Aspect:
- [Session key Aspect](https://github.com/artela-network/session-key-aspect/tree/rollkit): use Aspect to extend EoA with session keys and improve
- [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.
## 🛑 Stopping the Node
To cease operations and shutdown the Artela rollup node, use:
```bash
docker compose down
```
This command halts all running containers and clears the environment.
## 🎉 Conclusion
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.
2 changes: 1 addition & 1 deletion tutorials/beaconkit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import constants from '../.vitepress/constants/constants.js'
</script>

![beaconkit](https://camo.githubusercontent.com/8aaae79e171969a2a9c950582d512cd1e3746e67d3aea6410afc04e9b6cb8055/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6475763067343032792f696d6167652f75706c6f61642f76313731383033343331322f426561636f6e4b697442616e6e65722e706e67)
![beaconkit](https://camo.githubusercontent.com/b4a9b2b1d1536bb3dbbc32a5f3885b02dd1da8cdf9e34a160830d00ebee9120f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6475763067343032792f696d6167652f75706c6f61642f76313731383033343331322f426561636f6e4b697442616e6e65722e706e67)

## Introduction

Expand Down
21 changes: 18 additions & 3 deletions tutorials/celestia-da.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ After successfully starting a light node, it's time to start posting the batches

## 🏗️ Prerequisites {#prerequisites}

From the [GM world rollup](/tutorials/gm-world) tutorial, you should already have the `rollkit` CLI and `ignite` CLI installed.

* `rollkit` CLI installed from the [GM world rollup](/tutorials/gm-world) tutorial.
* `ignite` CLI v28.4.0 installed `curl https://get.ignite.com/[email protected]! | bash`

## 🏗️ Building your sovereign rollup {#building-your-sovereign-rollup}

Remove the existing `gm` project and create a new one using ignite:
Expand All @@ -49,6 +50,12 @@ Add the Rollkit app:
ignite rollkit add
```

Build the rollup node binary to use it for the chain configuration and to initialize:

```bash
ignite chain build
```

Initialize the Rollkit chain configuration:

```bash
Expand Down Expand Up @@ -120,7 +127,7 @@ The output of the command above will look similar to this:
Your DA AUTH_TOKEN is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBbGxvdyI6WyJwdWJsaWMiLCJyZWFkIiwid3JpdGUiXX0.cSrJjpfUdTNFtzGho69V0D_8kyECn9Mzv8ghJSpKRDE
```

Lastly, let's set up the namespace to be used for posting data on Celestia:
Next, let's set up the namespace to be used for posting data on Celestia:

```bash
DA_NAMESPACE=00000000000000000000000000000000000000000008e5f679bf7116cb
Expand All @@ -138,6 +145,13 @@ Replace the last 20 characters (10 bytes) in `0000000000000000000000000000000000
[Learn more about namespaces](https://docs.celestia.org/developers/node-tutorial#namespaces).
:::

Lastly, set your DA address for your light node, which by default runs at
port 26658:

```bash
DA_ADDRESS=http://localhost:26658
```

## 🔥 Running your rollup connected to Celestia light node

Finally, let's initiate the rollup node with all the flags:
Expand All @@ -148,6 +162,7 @@ rollkit start \
--rollkit.da_auth_token $AUTH_TOKEN \
--rollkit.da_namespace $DA_NAMESPACE \
--rollkit.da_start_height $DA_BLOCK_HEIGHT \
--rollkit.da_address $DA_ADDRESS \
--minimum-gas-prices="0.025stake"
```

Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@

"@keplr-wallet/[email protected]":
version "0.12.82"
resolved "https://registry.yarnpkg.com/@keplr-wallet/types/-/types-0.12.82.tgz#182e542a6463d70933f8b3125bf771cfeef3cc09"
resolved "https://registry.npmjs.org/@keplr-wallet/types/-/types-0.12.82.tgz"
integrity sha512-cNjkSvIHpWQEaM0cS9eQRJWTdwL55J9LQtRyCfOaB8bSEsFwBOvwcb2vpwMjLCJ3t0zkQ6VirOjvZWPutydpMQ==
dependencies:
long "^4.0.0"
Expand Down Expand Up @@ -1414,7 +1414,7 @@ uvu@^0.5.0:

vite@^4.4.9:
version "4.5.3"
resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a"
resolved "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz"
integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==
dependencies:
esbuild "^0.18.10"
Expand Down

0 comments on commit 50cdf7d

Please sign in to comment.