Skip to content

Commit a634254

Browse files
committed
Interchaintest setup to test ICS27 between Osmosis and Lumera
0 parents  commit a634254

16 files changed

Lines changed: 26066 additions & 0 deletions

Dockerfile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Dockerfile for Lumerad - Downloads pre-built binary from GitHub releases
2+
# Build context should be the interchaintest directory (for claims.csv)
3+
4+
ARG LUMERA_VERSION=v1.10.1
5+
6+
FROM alpine:3.19
7+
8+
ARG LUMERA_VERSION
9+
10+
# Install runtime dependencies (libc6-compat needed for glibc-linked lumerad on Alpine)
11+
RUN apk add --no-cache \
12+
ca-certificates \
13+
bash \
14+
jq \
15+
curl \
16+
libc6-compat \
17+
libgcc
18+
19+
# Download and install lumerad binary + libwasmvm from GitHub releases
20+
# The real binary is installed as lumerad-bin; lumerad is a wrapper that strips
21+
# --x-crisis-skip-assert-invariants (hardcoded by interchaintest but unsupported)
22+
RUN mkdir -p /tmp/release && \
23+
curl -sSfL "https://github.com/LumeraProtocol/lumera/releases/download/${LUMERA_VERSION}/lumera_${LUMERA_VERSION}_linux_amd64.tar.gz" \
24+
| tar -xz -C /tmp/release && \
25+
cp /tmp/release/lumerad /usr/local/bin/lumerad-bin && \
26+
chmod +x /usr/local/bin/lumerad-bin && \
27+
cp /tmp/release/libwasmvm.*.so /usr/local/lib/ 2>/dev/null || true && \
28+
rm -rf /tmp/release && \
29+
lumerad-bin version
30+
31+
# Create wrapper script that filters unsupported flags and ensures claims.csv exists
32+
RUN cat > /usr/local/bin/lumerad <<'WRAPPER'
33+
#!/bin/bash
34+
# Ensure claims.csv exists (lumerad requires it at startup)
35+
[ -f /tmp/claims.csv ] || touch /tmp/claims.csv
36+
args=()
37+
for arg in "$@"; do
38+
case "$arg" in
39+
--x-crisis-skip-assert-invariants) ;;
40+
*) args+=("$arg") ;;
41+
esac
42+
done
43+
exec lumerad-bin "${args[@]}"
44+
WRAPPER
45+
RUN chmod +x /usr/local/bin/lumerad
46+
47+
# Copy claims.csv to temp location
48+
COPY claims.csv /tmp/claims.csv
49+
50+
# Create lumera user
51+
RUN addgroup -g 1025 lumera && \
52+
adduser -D -u 1025 -G lumera lumera
53+
54+
# Create entrypoint script that ensures claims.csv is in .lumera/config
55+
RUN cat > /usr/local/bin/entrypoint.sh <<'ENTRY'
56+
#!/bin/bash
57+
set -e
58+
if [ -f /tmp/claims.csv ] && [ -s /tmp/claims.csv ]; then
59+
mkdir -p $HOME/.lumera/config
60+
if [ ! -f $HOME/.lumera/config/claims.csv ]; then
61+
cp /tmp/claims.csv $HOME/.lumera/config/claims.csv
62+
fi
63+
fi
64+
exec "$@"
65+
ENTRY
66+
RUN chmod +x /usr/local/bin/entrypoint.sh
67+
68+
USER lumera
69+
WORKDIR /home/lumera
70+
71+
EXPOSE 26656 26657 1317 9090
72+
73+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
74+
CMD ["lumerad", "start"]

Makefile

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
.PHONY: help build-docker clean-docker docker-info verify
2+
.PHONY: test test-local test-v1.9.1 test-v1.10.1 test-v1.9.1-local test-v1.10.1-local
3+
.PHONY: test-genesis test-genesis-local test-genesis-v1.9.1 test-genesis-v1.10.1 test-genesis-v1.9.1-local test-genesis-v1.10.1-local
4+
.PHONY: test-ica test-ica-local test-ica-v1.9.1 test-ica-v1.10.1 test-ica-v1.9.1-local test-ica-v1.10.1-local
5+
.PHONY: test-all-versions test-all-versions-local full-test
6+
7+
# Default target
8+
help:
9+
@echo "Lumera Interchaintest Makefile"
10+
@echo ""
11+
@echo "Docker:"
12+
@echo " build-docker Build lumerad Docker image from local source"
13+
@echo " clean-docker Remove local Docker images"
14+
@echo " docker-info Show Docker image info"
15+
@echo " verify Verify local setup"
16+
@echo ""
17+
@echo "Genesis tests:"
18+
@echo " test-genesis-v1.9.1 Test genesis for v1.9.1"
19+
@echo " test-genesis-v1.10.1 Test genesis for v1.10.1"
20+
@echo " test-genesis-v1.9.1-local ... with local image"
21+
@echo " test-genesis-v1.10.1-local ... with local image"
22+
@echo ""
23+
@echo "ICA tests:"
24+
@echo " test-ica-v1.9.1 Run ICA tests for v1.9.1"
25+
@echo " test-ica-v1.10.1 Run ICA tests for v1.10.1"
26+
@echo " test-ica-v1.9.1-local ... with local image"
27+
@echo " test-ica-v1.10.1-local ... with local image"
28+
@echo ""
29+
@echo "All tests for a version:"
30+
@echo " test-v1.9.1 Run all tests for v1.9.1"
31+
@echo " test-v1.10.1 Run all tests for v1.10.1"
32+
@echo " test-v1.9.1-local ... with local image"
33+
@echo " test-v1.10.1-local ... with local image"
34+
@echo ""
35+
@echo "Shortcuts (default v1.10.1):"
36+
@echo " test-genesis Test genesis (v1.10.1)"
37+
@echo " test-genesis-local Test genesis with local image"
38+
@echo " test-ica Run ICA tests (v1.10.1)"
39+
@echo " test-ica-local Run ICA tests with local image"
40+
@echo " test Run all tests (v1.10.1)"
41+
@echo " test-local Run all tests with local image"
42+
@echo ""
43+
@echo "Multi-version:"
44+
@echo " test-all-versions Test both v1.9.1 and v1.10.1"
45+
@echo " test-all-versions-local Test both versions with local image"
46+
@echo " full-test Build + test all versions locally"
47+
48+
# ── Docker ──────────────────────────────────────────────
49+
50+
build-docker:
51+
@echo "Building lumerad Docker image..."
52+
./build-docker.sh
53+
54+
clean-docker:
55+
-docker rmi lumerad-local:local 2>/dev/null || true
56+
@echo "Cleanup complete"
57+
58+
docker-info:
59+
@docker images | grep -E "(REPOSITORY|lumerad-local|lumeraprotocol)" || echo "No lumera images found"
60+
61+
verify:
62+
@echo "Verifying setup..."
63+
@which docker > /dev/null && docker --version || echo " Docker not found"
64+
@which go > /dev/null && go version || echo " Go not found"
65+
@test -d ../lumera && echo " Lumera source: found at ../lumera" || echo " Lumera source: not found at ../lumera"
66+
@test -f ../lumera/claims.csv && echo " claims.csv: found" || echo " claims.csv: not found (optional)"
67+
68+
# ── Genesis tests ───────────────────────────────────────
69+
70+
test-genesis-v1.9.1:
71+
LUMERA_VERSION=v1.9.1 go test -v -timeout 10m -run TestLumeraGenesisSetup
72+
73+
test-genesis-v1.10.1:
74+
LUMERA_VERSION=v1.10.1 go test -v -timeout 10m -run TestLumeraGenesisSetup
75+
76+
test-genesis-v1.9.1-local: build-docker
77+
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 10m -run TestLumeraGenesisSetup
78+
79+
test-genesis-v1.10.1-local: build-docker
80+
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 10m -run TestLumeraGenesisSetup
81+
82+
# Shortcuts (default v1.10.1)
83+
test-genesis: test-genesis-v1.10.1
84+
test-genesis-local: test-genesis-v1.10.1-local
85+
86+
# ── ICA tests ───────────────────────────────────────────
87+
88+
test-ica-v1.9.1:
89+
LUMERA_VERSION=v1.9.1 go test -v -timeout 20m -run TestOsmosisLumeraICA
90+
91+
test-ica-v1.10.1:
92+
LUMERA_VERSION=v1.10.1 go test -v -timeout 20m -run TestOsmosisLumeraICA
93+
94+
test-ica-v1.9.1-local: build-docker
95+
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 20m -run TestOsmosisLumeraICA
96+
97+
test-ica-v1.10.1-local: build-docker
98+
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 20m -run TestOsmosisLumeraICA
99+
100+
# Shortcuts (default v1.10.1)
101+
test-ica: test-ica-v1.10.1
102+
test-ica-local: test-ica-v1.10.1-local
103+
104+
# ── All tests for a version ─────────────────────────────
105+
106+
test-v1.9.1:
107+
LUMERA_VERSION=v1.9.1 go test -v -timeout 30m ./...
108+
109+
test-v1.10.1:
110+
LUMERA_VERSION=v1.10.1 go test -v -timeout 30m ./...
111+
112+
test-v1.9.1-local: build-docker
113+
LUMERA_VERSION=v1.9.1 USE_LOCAL_IMAGE=true go test -v -timeout 30m ./...
114+
115+
test-v1.10.1-local: build-docker
116+
LUMERA_VERSION=v1.10.1 USE_LOCAL_IMAGE=true go test -v -timeout 30m ./...
117+
118+
# Shortcuts (default v1.10.1)
119+
test: test-v1.10.1
120+
test-local: test-v1.10.1-local
121+
122+
# ── Multi-version ───────────────────────────────────────
123+
124+
test-all-versions:
125+
go test -v -timeout 30m -run TestBothVersions
126+
127+
test-all-versions-local: build-docker
128+
USE_LOCAL_IMAGE=true go test -v -timeout 30m -run TestBothVersions
129+
130+
full-test: build-docker test-all-versions-local

0 commit comments

Comments
 (0)