Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple build and push workflow, if we need to adjust this to use the one provided by celestia ops team then we can do that later, afaik the only difference is certain arch support for running k8s which we don't need here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just work when merged to main. Can take a look when this PR lands

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha I think the same thing every time I touch Docker CI workflows but I would not be surprised if a permission issue prevented this from working out of the box.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Push Docker Image

on:
push:
branches: [ main ]
paths:
- '**/Dockerfile'
- '.github/workflows/docker.yml'

jobs:
build-and-push:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write # Required for pushing to GHCR

steps:
- name: Checkout source
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./hyperlane/Dockerfile
push: true
tags: ghcr.io/${{ github.repository_owner }}/hyperlane-init:latest
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ demo:

## start: Start all Docker containers for the demo.
start:
@docker compose -f docker-compose.rollkit.yml up --detach
@docker compose up --detach
.PHONY: start

## setup: Set up the IBC light clients.
Expand Down Expand Up @@ -112,13 +112,10 @@ query-balance:
@go run ./testing/demo/pkg/transfer/ query-balance
.PHONY: query-balance

## stop: Stop all Docker containers and remove the tmp directory.
## stop: Stop all Docker containers and remove volumes.
stop:
@echo "--> Stopping all Docker containers"
@docker compose -f docker-compose.rollkit.yml down
@docker compose -f docker-compose.rollkit.yml rm
@echo "--> Removing the tmp directory"
@rm -rf .tmp
@docker compose down -v
.PHONY: stop

## build: Build the simapp and indexer binaries into the ./build directory.
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,25 @@ services:
networks:
- celestia-zkevm-net

hyperlane-init:
image: ghcr.io/celestiaorg/hyperlane-init:latest
container_name: hyperlane-init
volumes:
- hyperlane:/home/hyperlane/
entrypoint: "scripts/docker-entrypoint.sh"
depends_on:
celestia-validator:
condition: service_healthy
reth:
condition: service_started
restart: "no"
networks:
- celestia-zkevm-net

volumes:
celestia-app:
celestia-bridge:
hyperlane:
reth:

networks:
Expand Down
24 changes: 24 additions & 0 deletions hyperlane/Dockerfile
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be extended to install foundry tools in order to complete the last step: enroll-remote-router on both celestia-app and evm.

I think this can be done in a follow up PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#53

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM golang:1.24.3-alpine AS go-builder

WORKDIR /home/hyperlane

COPY hyperlane/go.* /home/hyperlane/
COPY hyperlane/cmd /home/hyperlane/cmd

# Build your Go CLI for cosmosnative deployment
RUN go build -o hyp ./cmd/hyp

FROM node:24-slim

# Install the hyperlane CLI (used for evm deployment)
RUN npm install -g @hyperlane-xyz/cli

COPY --from=go-builder /home/hyperlane/hyp /usr/local/bin/hyp

WORKDIR /home/hyperlane

COPY hyperlane/configs /home/hyperlane/configs
COPY hyperlane/registry /home/hyperlane/registry
COPY hyperlane/scripts /home/hyperlane/scripts

ENTRYPOINT [ "scripts/docker-entrypoint.sh" ]
7 changes: 7 additions & 0 deletions hyperlane/cmd/hyp/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"encoding/json"
"log"
"os"

"github.com/bcp-innovations/hyperlane-cosmos/util"
ismtypes "github.com/bcp-innovations/hyperlane-cosmos/x/core/01_interchain_security/types"
Expand Down Expand Up @@ -111,6 +112,12 @@ func getDeployCmd() *cobra.Command {
log.Fatalf("failed to marshal config: %v", err)
}

outputPath := "hyperlane-cosmosnative.json"
err = os.WriteFile(outputPath, out, 0644)
if err != nil {
log.Fatalf("failed to write JSON file: %v", err)
}

cmd.Printf("successfully deployed Hyperlane: \n%s", string(out))
},
}
Expand Down
1 change: 1 addition & 0 deletions hyperlane/registry/chains/celestia/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/hyperlane-xyz/hyperlane-registry/v15.2.0/chains/schema.json
# NOTE: The following chain spec is unused by the official Hyperlane CLI until cosmosnative support is added
bech32Prefix: celestia
blockExplorers:
- apiUrl: https://apis.mintscan.io/v1/celestia
Expand Down
2 changes: 1 addition & 1 deletion hyperlane/registry/chains/rethlocal/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ nativeToken:
symbol: ETH
protocol: ethereum
rpcUrls:
- http: http://localhost:8545
- http: http://reth:8545
technicalStack: other
2 changes: 1 addition & 1 deletion hyperlane/registry/strategies/default-strategy.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: The following deployment strategy file is unused by the official Hyperlane CLI until cosmosnative support is added
celestia:
submitter:
chain: celestia
privateKey: 00ae97487709f19987c2d62caab232d2bb5e489fc319480970782096bf1eda6a
type: jsonRpc
userAddress: celestia13vedhr3w833pdwlr9ctnqjc5ezne8sfz7n63vj

23 changes: 23 additions & 0 deletions hyperlane/scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -euo pipefail

export HYP_KEY=0x82bfcfadbf1712f6550d8d2c00a39f05b33ec78939d0167be2a737d691f33a6a

CONFIG_FILE="hyperlane-cosmosnative.json"

if [[ ! -f "$CONFIG_FILE" ]]; then
echo "Using Hyperlane registry:"
hyperlane registry list --registry ./registry

echo "Deploying Hyperlane core EVM contracts..."
hyperlane core deploy --chain rethlocal --registry ./registry --yes

echo "Deploying Hyperlane warp synthetic token EVM contracts..."
hyperlane warp deploy --config ./configs/warp-config.yaml --registry ./registry --yes

echo "Deploying Hyperlane on cosmosnative..."
hyp deploy celestia-validator:9090
else
echo "Skipping deployment: $CONFIG_FILE already exists."
fi