Skip to content

Commit

Permalink
Merge pull request #5 from babylonlabs-io/release/v0.2.0
Browse files Browse the repository at this point in the history
Release/v0.2.0
  • Loading branch information
gitferry authored Aug 1, 2024
2 parents e2de00e + 56edbc6 commit 5fd91be
Show file tree
Hide file tree
Showing 36 changed files with 1,337 additions and 883 deletions.
102 changes: 0 additions & 102 deletions .circleci/config.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ci

on:
pull_request:
branches:
- '**'

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true

docker_pipeline:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit
with:
publish: false
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: docker_publish

on:
push:
branches:
- 'main'
- 'dev'
tags:
- '*'

jobs:
lint_test:
uses: babylonlabs-io/.github/.github/workflows/[email protected]
with:
run-unit-tests: true
run-integration-tests: true
run-lint: true

docker_pipeline:
needs: ["lint_test"]
uses: babylonlabs-io/.github/.github/workflows/[email protected]
secrets: inherit
with:
publish: true
51 changes: 20 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
FROM golang:1.21.4-alpine as builder

# Version to build. Default is the Git HEAD.
ARG VERSION="HEAD"

# Use muslc for static libs
ARG BUILD_TAGS="muslc"


RUN apk add --no-cache --update openssh git make build-base linux-headers libc-dev \
pkgconfig zeromq-dev musl-dev alpine-sdk libsodium-dev \
libzmq-static libsodium-static gcc
FROM golang:1.21.4 as builder

RUN apt-get update && apt-get install -y make git bash gcc curl jq

# Build
WORKDIR /go/src/github.com/babylonchain/covenant-emulator
WORKDIR /go/src/github.com/babylonlabs-io/covenant-emulator
# Cache dependencies
COPY go.mod go.sum /go/src/github.com/babylonchain/covenant-emulator/
COPY go.mod go.sum /go/src/github.com/babylonlabs-io/covenant-emulator/
RUN go mod download
# Copy the rest of the files
COPY ./ /go/src/github.com/babylonchain/covenant-emulator/

# Cosmwasm - Download correct libwasmvm version
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)
COPY ./ /go/src/github.com/babylonlabs-io/covenant-emulator/

RUN CGO_LDFLAGS="$CGO_LDFLAGS -lstdc++ -lm -lsodium" \
CGO_ENABLED=1 \
BUILD_TAGS=$BUILD_TAGS \
LINK_STATICALLY=true \
RUN BUILD_TAGS=netgo \
LDFLAGS="-w -s" \
make build

# FINAL IMAGE
FROM alpine:3.16 AS run
FROM debian:bookworm-slim AS run

RUN addgroup --gid 1138 --system covenant-emulator && adduser --uid 1138 --system --home /home/covenant-emulator covenant-emulator

RUN addgroup --gid 1138 -S covenant-emulator && adduser --uid 1138 -S covenant-emulator -G covenant-emulator
RUN apt-get update && apt-get install -y bash curl jq wget

RUN apk add bash curl jq
COPY --from=builder /go/src/github.com/babylonlabs-io/covenant-emulator/go.mod /tmp
RUN WASMVM_VERSION=$(grep github.com/CosmWasm/wasmvm /tmp/go.mod | cut -d' ' -f2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm.$(uname -m).so \
-O /lib/libwasmvm.$(uname -m).so && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm.$(uname -m).so | grep $(cat /tmp/checksums.txt | grep libwasmvm.$(uname -m) | cut -d ' ' -f 1)
RUN rm -f /tmp/go.mod

COPY --from=builder /go/src/github.com/babylonchain/covenant-emulator/build/covd /bin/covd
COPY --from=builder /go/src/github.com/babylonlabs-io/covenant-emulator/build/covd /bin/covd

WORKDIR /home/covenant-emulator
RUN chown -R covenant-emulator /home/covenant-emulator
Expand Down
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.

Parameters

Licensor: Babylonchain, Inc.
Licensor: Babylon Labs, Ltd.

Licensed Work: covenant-emulator
The Licensed Work is (c) 2023 Babylonchain, Inc.
The Licensed Work is (c) 2024 Babylon Labs, Ltd.

Additional Use Grant: None.

Change Date: 2027-01-20 (January 20th, 2027]
Change Date: 2027-01-20 (January 20th, 2027)

Change License: Apache 2.0

Expand Down
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BUILDDIR ?= $(CURDIR)/build
TOOLS_DIR := tools

BABYLON_PKG := github.com/babylonchain/babylon/cmd/babylond
BABYLON_PKG := github.com/babylonlabs-io/babylon/cmd/babylond

GO_BIN := ${GOPATH}/bin

Expand Down Expand Up @@ -29,6 +29,14 @@ endif
BUILD_TARGETS := build install
BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)'

# Update changelog vars
ifneq (,$(SINCE_TAG))
sinceTag := --since-tag $(SINCE_TAG)
endif
ifneq (,$(UPCOMING_TAG))
upcomingTag := --future-release $(UPCOMING_TAG)
endif

all: build install

build: BUILD_ARGS := $(build_args) -o $(BUILDDIR)
Expand All @@ -40,7 +48,7 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
$(DOCKER) build --tag babylonchain/covenant-emulator -f Dockerfile \
$(DOCKER) build --tag babylonlabs-io/covenant-emulator -f Dockerfile \
$(shell git rev-parse --show-toplevel)

.PHONY: build build-docker
Expand All @@ -55,3 +63,11 @@ test-e2e:
mock-gen:
mkdir -p $(MOCKS_DIR)
$(MOCKGEN_CMD) -source=clientcontroller/interface.go -package mocks -destination $(MOCKS_DIR)/babylon.go

.PHONY: mock-gen

update-changelog:
@echo ./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)
./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)

.PHONY: update-changelog
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ verified the validity of the transactions and sent corresponding signatures.

Upon a pending staking request being found, the covenant emulation daemon
(`covd`), validates it against the spending rules defined in
[Staking Script specification](https://github.com/babylonchain/babylon/blob/dev/docs/staking-script.md),
[Staking Script specification](https://github.com/babylonlabs-io/babylon/blob/dev/docs/staking-script.md),
and sends three types of signatures to the Babylon chain:

1. **Slashing signature**. This signature is an [adaptor signature](https://bitcoinops.org/en/topics/adaptor-signatures/),
Expand Down Expand Up @@ -100,11 +100,11 @@ the [official Go installation guide](https://golang.org/doc/install).
To get started, clone the repository to your local machine from Github:

```bash
$ git clone [email protected]:babylonchain/covenant-emulator.git
$ git clone [email protected]:babylonlabs-io/covenant-emulator.git
```

You can choose a specific version from
the [official releases page](https://github.com/babylonchain/covenant-emulator/releases):
the [official releases page](https://github.com/babylonlabs-io/covenant-emulator/releases):

```bash
$ cd covenant-emulator # cd into the project directory
Expand Down
Loading

0 comments on commit 5fd91be

Please sign in to comment.