Skip to content

Commit 6c59be2

Browse files
authored
Merge branch 'main' into pierrick/markdown_link_checker
2 parents a51bab9 + 341a815 commit 6c59be2

File tree

3 files changed

+43
-65
lines changed

3 files changed

+43
-65
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"devDependencies": {
88
"i": "^0.3.7",
9-
"mermaid": "^11.7.0",
9+
"mermaid": "^11.8.0",
1010
"vitepress": "^1.5.0",
1111
"vitepress-plugin-mermaid": "^2.0.17"
1212
},

tutorials/docker-compose.md

Lines changed: 33 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,22 @@ Docker Compose version v2.23.0-desktop.1
3737

3838
## 🛠️ Setting up your environment {#setting-up-your-environment}
3939

40-
In addition to our chain, we need to run a DA and Sequencer node.
40+
In addition to our chain, we need to run a DA.
4141

42-
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+
We will use the [local-da](https://github.com/rollkit/local-da) for this tutorial and run it with our chain.
4343

44-
To save time, we can use their respective Dockerfiles:
45-
46-
* [local-da Dockerfile](https://github.com/rollkit/local-da/blob/main/Dockerfile)
47-
* [local-sequencer Dockerfile](https://github.com/rollkit/go-sequencing/blob/main/Dockerfile)
44+
To save time, we can use the local-da Dockerfile:
4845

46+
* [local-da Dockerfile](https://github.com/rollkit/rollkit/blob/main/Dockerfile.da)
4947
This will allow us to focus on how we can run the gm-world chain with Docker Compose.
5048

5149
### 🐳 Dockerfile {#dockerfile}
5250

53-
First, we need to create a Dockerfile for our gm-world chain. Create a new file called `Dockerfile` in the root of the `gm` directory and add the following code:
51+
First, we need to create a Dockerfile for our gm-world chain. Create a new file called `Dockerfile.gm` in the root of the `gm` directory and add the following code:
5452

5553
```dockerfile-vue
5654
# Stage 1: Install ignite CLI and rollkit
57-
FROM golang as base
55+
FROM golang AS base
5856
5957
# Install dependencies
6058
RUN apt update && \
@@ -63,11 +61,11 @@ RUN apt update && \
6361
ca-certificates \
6462
curl
6563
64+
RUN curl -sSL https://rollkit.dev/install.sh | bash
6665
# Install rollkit
67-
RUN curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}}
6866
6967
# Install ignite
70-
RUN curl https://get.ignite.com/cli@{{constants.igniteVersionTag}}! | bash
68+
RUN curl https://get.ignite.com/cli! | bash
7169
7270
# Set the working directory
7371
WORKDIR /app
@@ -80,17 +78,10 @@ RUN go mod download
8078
# Copy all files from the current directory to the container
8179
COPY . .
8280
83-
# Remove the rollkit.toml and entrypoint files if they exist. This is to avoid cross OS issues.
84-
RUN rm entrypoint rollkit.toml
85-
8681
# Build the chain
87-
RUN ignite chain build && ignite rollkit init
88-
89-
# Initialize the rollkit.toml file
90-
RUN rollkit toml init
91-
92-
# Run rollkit command to initialize the entrypoint executable
93-
RUN rollkit
82+
RUN ignite app install -g github.com/ignite/apps/rollkit
83+
RUN ignite chain build -y
84+
RUN ignite rollkit init
9485
9586
# Stage 2: Set up the runtime environment
9687
FROM debian:bookworm-slim
@@ -104,33 +95,32 @@ RUN apt update && \
10495
WORKDIR /root
10596
10697
# Copy over the rollkit binary from the build stage
107-
COPY --from=base /go/bin/rollkit /usr/bin
98+
COPY --from=base /go/bin/gmd /usr/bin
10899
109-
# Copy the entrypoint and rollkit.toml files from the build stage
110-
COPY --from=base /app/entrypoint ./entrypoint
111-
COPY --from=base /app/rollkit.toml ./rollkit.toml
112100
113101
# Copy the $HOME/.gm directory from the build stage.
114102
# This directory contains all your chain config.
115103
COPY --from=base /root/.gm /root/.gm
116104
117-
# Ensure the entrypoint script is executable
118-
RUN chmod +x ./entrypoint
119-
120105
# Keep the container running after it has been started
121106
# CMD tail -f /dev/null
122107
123-
ENTRYPOINT [ "rollkit" ]
124-
CMD [ "start", "--rollkit.aggregator", "--rollkit.sequencer_rollup_id", "gmd"]
125-
108+
ENTRYPOINT ["gmd"]
109+
CMD ["start","--rollkit.node.aggregator"]
126110
```
127111

128112
This Dockerfile sets up the environment to build the chain and run the gm-world 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.
129113

130114
Build the docker image by running the following command:
131115

132116
```bash
133-
docker build -t gm-world .
117+
docker build -t gm-world -f Dockerfile.gm .
118+
```
119+
120+
```bash
121+
cd rollkit
122+
docker build -t local-da -f Dockerfile.da .
123+
cd ..
134124
```
135125

136126
You can then see the built image by running:
@@ -166,42 +156,24 @@ services:
166156
command:
167157
[
168158
"start",
169-
"--rollkit.aggregator",
159+
"--rollkit.node.aggregator",
170160
"--rollkit.da.address",
171161
"http://0.0.0.0:7980",
172-
"--rollkit.sequencer_address",
173-
"0.0.0.0:50051",
174-
"--rollkit.sequencer_rollup_id",
175-
"gm",
176162
]
177163
# Ensures the local-da service is up and running before starting the chain
178164
depends_on:
179165
- local-da
180-
- local-sequencer
181166
182167
# Define the local DA service
183168
local-da:
184169
# Use the published image from rollkit
185-
image:
186-
ghcr.io/rollkit/local-da:{{constants.localDALatestTag}}
170+
image: local-da
187171
# Set the name of the docker container for ease of use
188172
container_name: local-da
189173
# Publish the ports to connect
190174
ports:
191175
- "7980:7980"
192176
193-
# Define the local sequencer service
194-
local-sequencer:
195-
# Use the published image from rollkit
196-
image:
197-
ghcr.io/rollkit/go-sequencing:{{constants.goSequencingLatestTag}}
198-
# Set the name of the docker container for ease of use
199-
container_name: local-sequencer
200-
# Start the sequencer with the listen all flag and the rollup id set to gm
201-
command: ["-listen-all", "-rollup-id=gm"]
202-
# Publish the ports to connect
203-
ports:
204-
- "50051:50051"
205177
```
206178

207179
We now have all we need to run the gm-world chain and connect to a local DA node.
@@ -231,10 +203,9 @@ docker ps
231203
You should see output like the following:
232204

233205
```bash
234-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
235-
86f9bfa5b6d2 gm-world "rollkit start --rol…" 7 minutes ago Up 3 seconds gm-world
236-
67a2c3058e01 local-sequencer "local-sequencer -li…" 11 minutes ago Up 3 seconds 0.0.0.0:50051->50051/tcp local-sequencer
237-
dae3359665f8 local-da "local-da -listen-all" 2 hours ago Up 3 seconds 0.0.0.0:7980->7980/tcp local-da
206+
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
207+
d50c7f2fffde local-da "local-da -listen-all" 10 seconds ago Up 9 seconds 0.0.0.0:7980->7980/tcp local-da
208+
b9d5e80e81fb gm-world "gmd start --rollkit…" 27 minutes ago Up 9 seconds gm-world
238209
```
239210

240211
We can see the gm-world chain running in container `gm-world` and the local DA network running in container `local-da`.
@@ -255,6 +226,13 @@ exit
255226

256227
Then you can shut down your chain environment by running `CRTL+C` in your terminal.
257228

229+
230+
If you want to stop the docker containers without shutting down your terminal, you can run:
231+
232+
```bash
233+
docker compose down
234+
```
235+
258236
## 🎉 Next steps
259237

260238
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.

yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,10 @@
413413
khroma "^2.0.0"
414414
non-layered-tidy-tree-layout "^2.0.2"
415415

416-
"@mermaid-js/parser@^0.5.0":
417-
version "0.5.0"
418-
resolved "https://registry.yarnpkg.com/@mermaid-js/parser/-/parser-0.5.0.tgz#63d676e930b0cfd6abfeadee46fb228761438ce6"
419-
integrity sha512-AiaN7+VjXC+3BYE+GwNezkpjIcCI2qIMB/K4S2/vMWe0q/XJCBbx5+K7iteuz7VyltX9iAK4FmVTvGc9kjOV4w==
416+
"@mermaid-js/parser@^0.6.0":
417+
version "0.6.0"
418+
resolved "https://registry.yarnpkg.com/@mermaid-js/parser/-/parser-0.6.0.tgz#91ee90eaa4af80bc3d5e85ad6b58e0abdd6c768e"
419+
integrity sha512-7DNESgpyZ5WG1SIkrYafVBhWmImtmQuoxOO1lawI3gQYWxBX3v1FW3IyuuRfKJAO06XrZR71W0Kif5VEGGd4VA==
420420
dependencies:
421421
langium "3.3.1"
422422

@@ -1652,14 +1652,14 @@ mdast-util-to-hast@^13.0.0:
16521652
unist-util-visit "^5.0.0"
16531653
vfile "^6.0.0"
16541654

1655-
mermaid@^11.7.0:
1656-
version "11.7.0"
1657-
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-11.7.0.tgz#53f319147632db15e499c5ccb72b24b277a00bae"
1658-
integrity sha512-/1/5R0rt0Z1Ak0CuznAnCF3HtQgayRXUz6SguzOwN4L+DuCobz0UxnQ+ZdTSZ3AugKVVh78tiVmsHpHWV25TCw==
1655+
mermaid@^11.8.0:
1656+
version "11.8.0"
1657+
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-11.8.0.tgz#d075d48fc4038daf8091b39d590175ddece70e46"
1658+
integrity sha512-uAZUwnBiqREZcUrFw3G5iQ5Pj3hTYUP95EZc3ec/nGBzHddJZydzYGE09tGZDBS1VoSoDn0symZ85FmypSTo5g==
16591659
dependencies:
16601660
"@braintree/sanitize-url" "^7.0.4"
16611661
"@iconify/utils" "^2.1.33"
1662-
"@mermaid-js/parser" "^0.5.0"
1662+
"@mermaid-js/parser" "^0.6.0"
16631663
"@types/d3" "^7.4.3"
16641664
cytoscape "^3.29.3"
16651665
cytoscape-cose-bilkent "^4.1.0"

0 commit comments

Comments
 (0)