Skip to content

Commit

Permalink
major update
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Jan 26, 2024
1 parent a730eeb commit 9534f7b
Show file tree
Hide file tree
Showing 140 changed files with 46,771 additions and 3,295 deletions.
2 changes: 1 addition & 1 deletion .chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/BoltzExchange/boltz-lnd
repository_url: https://github.com/BoltzExchange/boltz-client
options:
commits:
filters:
Expand Down
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.so
*.a
vendor
bin
90 changes: 20 additions & 70 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Artifacts

on:
workflow_dispatch:
push:
branches:
- master

tags:
- v*

Expand All @@ -14,88 +12,40 @@ jobs:

strategy:
matrix:
platform: [ ubuntu-latest ]
go-version: [ 1.20.x ]
platform: [ubuntu-latest]

runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Install C cross compilers
run: sudo apt-get update && sudo apt-get -y install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi gcc-mingw-w64 gcc-mingw-w64-i686

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Fetch dependencies
run: go mod vendor
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build
run: make binaries

- name: Upload Linux AMD64 artifact
uses: actions/upload-artifact@v3
with:
name: boltz-lnd-linux-amd64
path: binaries/linux-amd64/
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Upload Linux ARM64 artifact
uses: actions/upload-artifact@v3
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
name: boltz-lnd-linux-arm64
path: binaries/linux-arm64/
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Upload Linux ARM artifact
uses: actions/upload-artifact@v3
with:
name: boltz-lnd-linux-arm
path: binaries/linux-arm/
- name: Build dockerfile
run: make docker

- name: Upload Windows AMD64 artifact
uses: actions/upload-artifact@v3
with:
name: boltz-lnd-windows-amd64
path: binaries/windows-amd64/
- name: Build binaries
run: make binaries

- name: Upload Windows 386 artifact
- name: Upload Linux AMD64 artifact
uses: actions/upload-artifact@v3
with:
name: boltz-lnd-windows-386
path: binaries/windows-386/

darwin:
name: Build binaries for Darwin

strategy:
matrix:
platform: [ macos-latest ]
go-version: [ 1.19.x ]

runs-on: ${{ matrix.platform }}

steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Fetch dependencies
run: go mod vendor
name: boltz-client-linux-amd64
path: bin/linux_amd64

- name: Build
run: make build

- name: Upload Darwin AMD64 artifact
- name: Upload Linux ARM64 artifact
uses: actions/upload-artifact@v3
with:
name: boltz-lnd-darwin-amd64
path: |
boltzd
boltzcli
name: boltz-client-linux-arm64
path: bin/linux_arm64
35 changes: 24 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
name: CI

on: [ push, pull_request ]
on:
push:
branches:
- main
pull_request:

jobs:
build:
name: CI

strategy:
matrix:
platform: [ ubuntu-latest ]
go-version: [ 1.20.x ]
platform: [ubuntu-latest]
go-version: [1.21.x]

runs-on: ${{ matrix.platform }}

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Fetch dependencies
run: go mod vendor

- name: Build
run: make build

- name: Test
- name: Setup Regtest
run: |
git clone https://github.com/BoltzExchange/legend-regtest-enviroment.git ~/regtest -b remove-mempool
sudo chmod -R 777 ~/regtest
cd ~/regtest
chmod +x ./regtest
./regtest
sudo chmod -R a+rwx .
- name: Unit Tests
run: make unit

- name: Integration Tests
run: make integration

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
version: 'latest'
version: "latest"
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
*.exe~
*.dll
*.so
*.a
*.dylib

boltzd
boltzcli
!cmd/boltzd
!cmd/boltzcli
binaries/

# Test binary, built with `go test -c`
Expand All @@ -20,6 +23,8 @@ vendor/

# Config, database, log, certificate and macaroon files
boltz.toml
!cmd/boltzd/test/boltz.toml
cmd/boltzd/test/autoswap.toml
boltz.db
boltz.log
tls.key
Expand All @@ -28,3 +33,5 @@ tls.cert

# Goland
.idea/

liquid-wallet
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "go-secp256k1-zkp"]
path = go-secp256k1-zkp
url = https://github.com/vulpemventures/go-secp256k1-zkp
branch = v1.1.6
40 changes: 23 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
FROM golang:1.20.2-alpine3.17 as builder
FROM golang:1.21-alpine as go
FROM michael1011/gdk-ubuntu-builder:0.68.2 as builder

# Install dependencies.
RUN apk add --no-cache --update \
alpine-sdk \
git \
make \
gcc
ARG GDK_ARGS
RUN git clone https://github.com/Blockstream/gdk --depth 1 --branch release_0.68.2
RUN export PATH="/root/.cargo/bin:$PATH" && cd gdk && ./tools/build.sh --gcc --buildtype release --no-deps-rebuild --external-deps-dir /prebuild/gcc ${GDK_ARGS}

# Shallow clone project.
RUN git clone --depth=1 https://github.com/BoltzExchange/boltz-lnd /go/src/github.com/BoltzExchange/boltz-lnd
COPY --from=go /usr/local/go /usr/local/go
ENV PATH="/usr/local/go/bin:$PATH"

WORKDIR /boltz-client

COPY . ./
RUN cp /root/gdk/gdk/build-gcc/libgreenaddress_full.a /boltz-client/onchain/wallet/lib/

# Build the binaries.
RUN cd /go/src/github.com/BoltzExchange/boltz-lnd \
&& go mod vendor \
&& make build
RUN make deps static

FROM scratch AS binaries

COPY --from=builder /boltz-client/boltzd /
COPY --from=builder /boltz-client/boltzcli /

# Start a new, final image.
FROM alpine:3.17 as final
FROM ubuntu:jammy as final

# Root volume for data persistence.
VOLUME /root/.boltz-lnd
VOLUME /root/.boltz

# Copy binaries.
COPY --from=builder /go/src/github.com/BoltzExchange/boltz-lnd/boltzd /bin/
COPY --from=builder /go/src/github.com/BoltzExchange/boltz-lnd/boltzcli /bin/
COPY --from=builder /boltz-client/boltzd /bin/
COPY --from=builder /boltz-client/boltzcli /bin/

# gRPC and REST ports
EXPOSE 9002 9003

ENTRYPOINT ["boltzd"]
CMD ["boltzd"]
Loading

0 comments on commit 9534f7b

Please sign in to comment.