Skip to content

Commit e8997dd

Browse files
authored
Merge pull request #130 from Lay3rLabs/better-localnode
Fix up localnode
2 parents c158c8b + 7038e29 commit e8997dd

17 files changed

Lines changed: 112 additions & 20 deletions

docker/Dockerfile.gateway

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# docker build . -f docker/Dockerfile.gateway -t ghcr.io/lay3rlabs/gateway:latest
22
# docker run --rm -it ghcr.io/lay3rlabs/gateway:latest /bin/bash
33

4-
FROM golang:1.20 AS build-env
4+
FROM golang:1.22-bookworm AS build-env
55

66
COPY ./gateway /src/gateway
77
ENV CGO_ENABLED=0
88
RUN cd /src/gateway && go build -o /app
99

1010
# Production stage
1111
# FROM scratch
12-
FROM debian:bullseye-slim
12+
FROM debian:bookworm-slim
1313
COPY --from=build-env /app /
1414

1515
# ENTRYPOINT ["/app"]

docker/Dockerfile.slay3rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
### BUILDING
55

6-
FROM rust:1.77-bookworm AS builder
6+
FROM rust:1.80-bookworm AS builder
77
WORKDIR /myapp
88

99
RUN apt update && apt install -y clang

localnode/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,48 @@ the following command. Without it, we maintain the blockchain state between rest
1313
./localnode/reset_volumes.sh
1414
```
1515

16+
We also need to build the docker images for the chain (slay3rd and gateway) one
17+
time before running a localnode, and each time you want to update the codebase.
18+
19+
```bash
20+
./scripts/build_docker.sh
21+
```
22+
23+
### Debugging
24+
25+
Sometimes (only on OSX?), it won't automatically pull the missing packages listed
26+
in the docker compose files and you must manually pull them before running the node, or potentially building the docker images. If you get an error like this:
27+
28+
```
29+
ERROR: failed to solve: debian:bookworm-slim: failed to resolve source metadata for docker.io/library/debian:bookworm-slim: error getting credentials - err: exit status 1, out: ``
30+
```
31+
32+
Do the following before building:
33+
34+
```bash
35+
36+
docker pull debian:bookworm-slim
37+
docker pull rust:1.80-bookworm
38+
docker pull golang:1.22-bookworm
39+
docker pull alpine:latest
40+
```
41+
42+
And the following before running a node (`./localnode/run*.sh`)
43+
44+
```bash
45+
# This may work?
46+
docker compose -f ./localnode/docker-compose.yml -f ./localnode/jaeger-elastic-compose.yml pull
47+
48+
# If not, do this manually
49+
docker pull cometbft/cometbft:v0.38.12
50+
docker pull jaegertracing/all-in-one:1.59
51+
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.15.1
52+
docker pull jaegertracing/jaeger-collector:1.59
53+
docker pull jaegertracing/jaeger-agent:1.59
54+
docker pull jaegertracing/jaeger-query:1.59
55+
```
56+
57+
1658
### Minimal Run
1759

1860
To run without a facuet and just in-memory tracing, run the following:
@@ -45,6 +87,9 @@ curl localhost:9200/_search
4587
sudo docker ps -a
4688
```
4789

90+
Note: if you want elastic search but have errors running the faucet locally, try `run_elastic.sh` which serves elastic search at port 9200,
91+
but doesn't start the faucet at all.
92+
4893
## Interacting with a Node
4994

5095
There are a few ways you can interact with a localnode.

localnode/abci/config/slay3r.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
host = "0.0.0.0"
2+
jaeger = "http://jaeger:14268"
3+
log = "debug"
4+
rocksdb = "/root/.slay3r/data/app"
5+
rpc_url = "http://cometbft:26657"
File renamed without changes.
File renamed without changes.

localnode/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ volumes:
2020
external: true
2121
comet_data:
2222
external: true
23-
esdata:
24-
driver: local
2523

2624
services:
2725
slay3r:
@@ -41,7 +39,7 @@ services:
4139
- RUST_BACKTRACE=1
4240

4341
cometbft:
44-
image: "cometbft/cometbft:v0.38.7"
42+
image: "cometbft/cometbft:v0.38.12"
4543
expose:
4644
# for slay3r grpc callbacks
4745
- "26657"
@@ -56,7 +54,7 @@ services:
5654

5755
# Default all-memory Jaeger
5856
jaeger:
59-
image: jaegertracing/all-in-one:1.46
57+
image: jaegertracing/all-in-one:1.59
6058
expose:
6159
- "6831/udp"
6260
- "6832/udp"

0 commit comments

Comments
 (0)