You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/docker-compose.md
+33-55Lines changed: 33 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -37,24 +37,22 @@ Docker Compose version v2.23.0-desktop.1
37
37
38
38
## 🛠️ Setting up your environment {#setting-up-your-environment}
39
39
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.
41
41
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.
43
43
44
-
To save time, we can use their respective Dockerfiles:
This will allow us to focus on how we can run the gm-world chain with Docker Compose.
50
48
51
49
### 🐳 Dockerfile {#dockerfile}
52
50
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:
54
52
55
53
```dockerfile-vue
56
54
# Stage 1: Install ignite CLI and rollkit
57
-
FROM golang as base
55
+
FROM golang AS base
58
56
59
57
# Install dependencies
60
58
RUN apt update && \
@@ -63,11 +61,11 @@ RUN apt update && \
63
61
ca-certificates \
64
62
curl
65
63
64
+
RUN curl -sSL https://rollkit.dev/install.sh | bash
66
65
# Install rollkit
67
-
RUN curl -sSL https://rollkit.dev/install.sh | sh -s {{constants.rollkitLatestTag}}
68
66
69
67
# Install ignite
70
-
RUN curl https://get.ignite.com/cli@{{constants.igniteVersionTag}}! | bash
68
+
RUN curl https://get.ignite.com/cli! | bash
71
69
72
70
# Set the working directory
73
71
WORKDIR /app
@@ -80,17 +78,10 @@ RUN go mod download
80
78
# Copy all files from the current directory to the container
81
79
COPY . .
82
80
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
-
86
81
# 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
94
85
95
86
# Stage 2: Set up the runtime environment
96
87
FROM debian:bookworm-slim
@@ -104,33 +95,32 @@ RUN apt update && \
104
95
WORKDIR /root
105
96
106
97
# 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
108
99
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
112
100
113
101
# Copy the $HOME/.gm directory from the build stage.
114
102
# This directory contains all your chain config.
115
103
COPY --from=base /root/.gm /root/.gm
116
104
117
-
# Ensure the entrypoint script is executable
118
-
RUN chmod +x ./entrypoint
119
-
120
105
# Keep the container running after it has been started
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.
129
113
130
114
Build the docker image by running the following command:
131
115
132
116
```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 ..
134
124
```
135
125
136
126
You can then see the built image by running:
@@ -166,42 +156,24 @@ services:
166
156
command:
167
157
[
168
158
"start",
169
-
"--rollkit.aggregator",
159
+
"--rollkit.node.aggregator",
170
160
"--rollkit.da.address",
171
161
"http://0.0.0.0:7980",
172
-
"--rollkit.sequencer_address",
173
-
"0.0.0.0:50051",
174
-
"--rollkit.sequencer_rollup_id",
175
-
"gm",
176
162
]
177
163
# Ensures the local-da service is up and running before starting the chain
0 commit comments