Skip to content

Commit

Permalink
Merge pull request #38 from babylonchain/use-private-version-of-signer
Browse files Browse the repository at this point in the history
Use private version of signer
  • Loading branch information
KonradStaniec authored Jun 7, 2024
2 parents e673c10 + 13e7600 commit 9c5657c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
11 changes: 5 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
command: "go env"
- go/load-cache:
key: go-mod-v6-{{ checksum "go.sum" }}
- add_ssh_keys
- go/mod-download
- go/save-cache:
key: go-mod-v6-{{ checksum "go.sum" }}
Expand Down Expand Up @@ -45,13 +46,15 @@ jobs:
resource_class: large
steps:
- checkout
- add_ssh_keys
- aws-ecr/build-image:
push-image: false
dockerfile: Dockerfile
path: ./
build-path: ./
tag: "$CIRCLE_SHA1,$CIRCLE_TAG"
repo: "$CIRCLE_PROJECT_REPONAME"
repo: "cli-tools"
extra-build-args: "--secret id=sshKey,src=/home/circleci/.ssh/$DEPLOY_KEY_NAME"
- run:
name: Save Docker image to export it to workspace
command: |
Expand Down Expand Up @@ -79,7 +82,7 @@ jobs:
- aws-ecr/push-image:
registry-id: AWS_ECR_REGISTRY_ID
region: "$AWS_REGION"
repo: "$CIRCLE_PROJECT_REPONAME"
repo: "cli-tools"
tag: "$CIRCLE_SHA1,$CIRCLE_TAG"

workflows:
Expand All @@ -90,10 +93,6 @@ workflows:
filters:
tags:
only: /.*/
branches:
only:
- main
- dev
- push_docker:
requires:
- build_docker
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ RUN apk add --no-cache --update openssh git make build-base linux-headers libc-d
pkgconfig zeromq-dev musl-dev alpine-sdk libsodium-dev \
libzmq-static libsodium-static gcc

# Load private repos SSH deploy key and configure ssh
RUN mkdir -p /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
ENV GOPRIVATE=github.com/babylonchain/*

# Build
WORKDIR /go/src/github.com/babylonchain/cli-tools
# Cache dependencies
COPY go.mod go.sum /go/src/github.com/babylonchain/cli-tools/
RUN go mod download
RUN --mount=type=secret,id=sshKey,target=/root/.ssh/id_rsa go mod download
# Copy the rest of the files
COPY ./ /go/src/github.com/babylonchain/cli-tools/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

build-docker:
$(DOCKER) build --tag babylonchain/cli-tools -f Dockerfile \
$(DOCKER) build --secret id=sshKey,src=${BBN_PRIV_DEPLOY_KEY} --tag babylonchain/cli-tools -f Dockerfile \
$(shell git rev-parse --show-toplevel)

.PHONY: build build-docker install tests
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ require (
)

require (
github.com/babylonchain/covenant-signer v0.1.0
github.com/babylonchain/covenant-signer v0.1.2
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0
github.com/golang/mock v1.6.0
github.com/prometheus/client_golang v1.18.0
)

require (
Expand Down Expand Up @@ -162,7 +164,6 @@ require (
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang/glog v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/go-cmp v0.6.0 // indirect
Expand Down Expand Up @@ -250,7 +251,6 @@ require (
github.com/pierrec/lz4/v4 v4.1.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.6.0 // indirect
github.com/prometheus/common v0.47.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
Expand Down Expand Up @@ -323,3 +323,5 @@ require (
pgregory.net/rapid v1.1.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/babylonchain/covenant-signer => github.com/babylonchain/covenant-signer v0.1.2
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,8 @@ github.com/aws/aws-sdk-go v1.44.312/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/babylonchain/babylon v0.8.6-0.20240426101001-7778c798e236 h1:Ydna4VcP56xu1+zdgygqHdSCeMduZjuznVhr4exO5do=
github.com/babylonchain/babylon v0.8.6-0.20240426101001-7778c798e236/go.mod h1:lfeASLNJgcUsX7LEns3HRUv0k+MjzcB2q2AMasfz38M=
github.com/babylonchain/covenant-signer v0.0.0-20240507155851-64756e393be2 h1:v5h+81bOlENEw/cyXv/6+/5laUs/EOvxAfZTdWbOW5A=
github.com/babylonchain/covenant-signer v0.0.0-20240507155851-64756e393be2/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
github.com/babylonchain/covenant-signer v0.0.0-20240509110821-b6017a54332f h1:UKNyeBlPZgLB5+1ZUA1YCL6bPtREA+oP1OT6ibNadw0=
github.com/babylonchain/covenant-signer v0.0.0-20240509110821-b6017a54332f/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
github.com/babylonchain/covenant-signer v0.1.0 h1:86IKwReT+3q2TMBsGg9BUzXl5lGkHqAK8PS1QigwdA0=
github.com/babylonchain/covenant-signer v0.1.0/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
github.com/babylonchain/covenant-signer v0.1.2 h1:MaiMG2Rouw+wsA4PhWUtx9/WCYh0Y9r1rMENvzYs8zY=
github.com/babylonchain/covenant-signer v0.1.2/go.mod h1:alX7NoDE2m7gW4O17hLAsluU30P0XaP5RlThAco8Y9Q=
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
Expand Down
2 changes: 2 additions & 0 deletions itest/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
staking "github.com/babylonchain/babylon/btcstaking"
signerbtccli "github.com/babylonchain/covenant-signer/btcclient"
signercfg "github.com/babylonchain/covenant-signer/config"
"github.com/babylonchain/covenant-signer/observability/metrics"
"github.com/babylonchain/covenant-signer/signerapp"
"github.com/babylonchain/covenant-signer/signerservice"
"github.com/babylonchain/covenant-signer/utils"
Expand Down Expand Up @@ -317,6 +318,7 @@ func startSigningServer(
context.Background(),
parsedconfig,
app,
metrics.NewCovenantSignerMetrics(),
)

require.NoError(t, err)
Expand Down

0 comments on commit 9c5657c

Please sign in to comment.