Skip to content

Commit

Permalink
Merge branch 'main' into smuu/lunar-boot-dnsaddr
Browse files Browse the repository at this point in the history
  • Loading branch information
smuu authored Jan 20, 2025
2 parents f4e75a7 + b9fbaf5 commit b02cb98
Show file tree
Hide file tree
Showing 408 changed files with 19,526 additions and 12,899 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# global owners are only requested if there isn't a more specific
# codeowner specified below. For this reason, the global codeowners
# are often repeated in package-level definitions.
* @renaynay @Wondertan @vgonkivs @distractedm1nd @walldiss @cristaloleg
* @renaynay @Wondertan @vgonkivs @walldiss @cristaloleg

docs/adr @adlerjohn @liamsi
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ updates:
open-pull-requests-limit: 10
labels:
- kind:deps
groups:
patch-updates:
applies-to: version-updates
update-types:
- "patch"
- package-ecosystem: gomod
directory: "/"
schedule:
Expand All @@ -25,6 +30,10 @@ updates:
- dependency-name: "*otel*"
update-types: ["version-update:semver-patch"]
groups:
patch-updates:
applies-to: version-updates
update-types:
- "patch"
otel:
patterns:
- "go.opentelemetry.io/otel*"
Expand All @@ -37,3 +46,8 @@ updates:
open-pull-requests-limit: 10
labels:
- kind:deps
groups:
patch-updates:
applies-to: version-updates
update-types:
- "patch"
84 changes: 45 additions & 39 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: CI and Release

on:
merge_group:
push:
branches:
- main
tags:
- '**'
release:
types: [published]
pull_request:
workflow_dispatch:
inputs:
version:
# Friendly description to be shown in the UI instead of 'name'
description: "Semver type of new version (major / minor / patch)"
# Input has to be provided for the workflow to run
run-on-tag:
description: 'Tag for release'
required: true
type: choice
options:
- patch
- minor
- major

jobs:
# set up go version for use through pipelines, setting
Expand Down Expand Up @@ -54,15 +50,15 @@ jobs:
# Dockerfile Linting
hadolint:
uses: celestiaorg/.github/.github/workflows/[email protected].3 # yamllint disable-line rule:line-length
uses: celestiaorg/.github/.github/workflows/[email protected].5 # yamllint disable-line rule:line-length
with:
dockerfile: Dockerfile

yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: celestiaorg/.github/.github/actions/[email protected].3
- uses: celestiaorg/.github/.github/actions/[email protected].5

markdown-lint:
name: Markdown Lint
Expand All @@ -82,41 +78,31 @@ jobs:
with:
go-version: ${{ needs.setup.outputs.go-version }}

# If this was a workflow dispatch event, we need to generate and push a tag
# for goreleaser to grab
version_bump:
needs: [hadolint, yamllint, markdown-lint, go-ci, setup]
runs-on: ubuntu-latest
permissions: "write-all"
steps:
- uses: actions/checkout@v4

- name: Bump version and push tag
# Placing the if condition here is a workaround for needing to block
# on this step during workflow dispatch events but the step not
# needing to run on tags. If we had the if condition on the full
# version_bump section, it would skip and not run, which would result
# in goreleaser not running either.
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: ${{ inputs.version }}
release_branches: ${{ needs.setup.outputs.branch }}

# Generate the release with goreleaser to include pre-built binaries
goreleaser:
needs: [version_bump, setup]
needs: [setup]
runs-on: ubuntu-latest
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'release'
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch'
permissions: "write-all"
steps:
- uses: actions/checkout@v4

- run: git fetch --force --tags

- name: Set LATEST_TAG for release
if: github.event_name == 'release'
run: echo "LATEST_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV

- name: Set LATEST_TAG for workflow_dispatch
if: github.event_name == 'workflow_dispatch'
run: echo "LATEST_TAG=${{ inputs.run-on-tag }}" >> $GITHUB_ENV

- name: Checkout a given tag
if: github.event_name == 'workflow_dispatch'
run: git checkout ${{ inputs.run-on-tag }}

- uses: actions/setup-go@v5
with:
go-version: ${{ needs.setup.outputs.go-version }}
Expand All @@ -137,17 +123,37 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GORELEASER_CURRENT_TAG: ${{ env.LATEST_TAG }}

upload-docs:
needs: goreleaser
if: github.event_name == 'release'
needs: [setup]
if: |
github.event_name == 'release' ||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: git fetch --force --tags

- name: Set LATEST_TAG for release
if: github.event_name == 'release'
run: echo "LATEST_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV

- name: Set LATEST_TAG for workflow_dispatch
if: github.event_name == 'workflow_dispatch'
run: echo "LATEST_TAG=${{ inputs.run-on-tag }}" >> $GITHUB_ENV

- name: Checkout a given tag
if: github.event_name == 'workflow_dispatch'
run: git checkout ${{ inputs.run-on-tag }}

- run: |
make openrpc-gen > openrpc.json
gh release upload ${{github.event.release.tag_name}} openrpc.json
gh release upload "$LATEST_TAG" openrpc.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 0 additions & 14 deletions .github/workflows/create_release_tracking_epic.yml

This file was deleted.

14 changes: 9 additions & 5 deletions .github/workflows/docker-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ on:
branches:
- "main"
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
- "v*"
pull_request:
workflow_dispatch:
inputs:
ref:
description: "The checkout reference (ie tag, branch, sha)"
required: true
type: string

jobs:
docker-security-build:
permissions:
contents: write
packages: write
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.4.3 # yamllint disable-line rule:line-length
uses: celestiaorg/.github/.github/workflows/reusable_dockerfile_pipeline.yml@v0.5.0 # yamllint disable-line rule:line-length
with:
dockerfile: Dockerfile
checkout_ref: ${{ github.event.inputs.ref }}
secrets: inherit
15 changes: 15 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,18 @@ jobs:

- name: run sync tests
run: make test-integration SHORT=true TAGS=sync

pruning_tests:
name: Integration Tests Sync
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: set up go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: run sync tests
run: make test-integration SHORT=true TAGS=pruning
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
before:
Expand Down Expand Up @@ -67,5 +68,7 @@ changelog:
- "^test:"
release:
prerelease: auto
mode: keep-existing
git:
prerelease_suffix: "-rc*"
tag_sort: -version:creatordate
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM docker.io/golang:1.23-alpine3.20 as builder
FROM --platform=$BUILDPLATFORM docker.io/golang:1.23-alpine3.20 AS builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand All @@ -21,9 +21,11 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . .

RUN uname -a &&\
CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
make build && make cel-key
RUN uname -a && \
export CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS} GOARCH=${TARGETARCH} && \
make build && \
make cel-key && \
make cel-shed

FROM docker.io/alpine:3.20.2

Expand All @@ -34,8 +36,8 @@ ARG USER_NAME=celestia
ENV CELESTIA_HOME=/home/${USER_NAME}

# Default node type can be overwritten in deployment manifest
ENV NODE_TYPE bridge
ENV P2P_NETWORK mocha
ENV NODE_TYPE=bridge
ENV P2P_NETWORK=mocha

# hadolint ignore=DL3018
RUN uname -a &&\
Expand All @@ -54,6 +56,7 @@ RUN uname -a &&\
# Copy in the binary
COPY --from=builder /src/build/celestia /bin/celestia
COPY --from=builder /src/./cel-key /bin/cel-key
COPY --from=builder /src/./cel-shed /bin/cel-shed

COPY --chown=${USER_NAME}:${USER_NAME} docker/entrypoint.sh /opt/entrypoint.sh

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ ifeq ($(SHORT),true)
else
INTEGRATION_RUN_LENGTH =
endif

include celestia-node.mk

## help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
Expand Down Expand Up @@ -163,13 +166,14 @@ PB_CORE=$(shell go list -f {{.Dir}} -m github.com/tendermint/tendermint)
PB_GOGO=$(shell go list -f {{.Dir}} -m github.com/gogo/protobuf)
PB_CELESTIA_APP=$(shell go list -f {{.Dir}} -m github.com/celestiaorg/celestia-app)
PB_NMT=$(shell go list -f {{.Dir}} -m github.com/celestiaorg/nmt)
PB_NODE=$(shell pwd)

## pb-gen: Generate protobuf code for all /pb/*.proto files in the project.
pb-gen:
@echo '--> Generating protobuf'
@for dir in $(PB_PKGS); \
do for file in `find $$dir -type f -name "*.proto"`; \
do protoc -I=. -I=${PB_CORE}/proto/ -I=${PB_GOGO} -I=${PB_CELESTIA_APP}/proto -I=${PB_NMT} --gogofaster_out=paths=source_relative:. $$file; \
do protoc -I=. -I=${PB_CORE}/proto/ -I=${PB_NODE} -I=${PB_GOGO} -I=${PB_CELESTIA_APP}/proto -I=${PB_NMT} --gogofaster_out=paths=source_relative:. $$file; \
echo '-->' $$file; \
done; \
done;
Expand Down
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ Continue reading [here](https://blog.celestia.org/celestia-mvp-release-data-avai
- [API docs](#api-docs)
- [Node types](#node-types)
- [Run a node](#run-a-node)
- [Quick Start with Light Node on arabica](#quick-start-with-light-node-on-arabica)
- [Environment variables](#environment-variables)
- [Package-specific documentation](#package-specific-documentation)
- [Code of Conduct](#code-of-conduct)

## Minimum requirements

| Requirement | Notes |
| ----------- |----------------|
| ----------- | -------------- |
| Go version | 1.23 or higher |

## System Requirements
Expand Down Expand Up @@ -79,6 +80,40 @@ celestia <node_type> start

Please refer to [this guide](https://docs.celestia.org/nodes/celestia-node/) for more information on running a node.

### Quick Start with Light Node on arabica

View available commands and their usage:

```sh
make node-help
```

Install celestia node and cel-key binaries:

```sh
make node-install
```

Start a light node with automated setup:

```sh
make light-arabica-up
```

This command:

- Automatically checks wallet balance
- Requests funds from faucet if needed
- Sets node height to latest-1 for quick startup
- Initializes the node if running for the first time

Options:

```sh
make light-arabica-up COMMAND=again # Reset node state to latest height
make light-arabica-up CORE_IP=<ip> # Use custom core IP
```

## Environment variables

| Variable | Explanation | Default value | Required |
Expand Down
Loading

0 comments on commit b02cb98

Please sign in to comment.