Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
188f1fd
Create a common Makefile for contracts bindings generation
nkuba Jun 7, 2022
434824a
Add Go bindings generator for ecdsa contracts
nkuba Jun 7, 2022
9817897
Add Go bindings generator for random-beacon contracts
nkuba Jun 7, 2022
7758935
Add Go bindings generator for tbtc-v2 contracts
nkuba Jun 7, 2022
396790c
Add Go bindings generator for threshold-network contracts
nkuba Jun 7, 2022
2966277
Ignore solidity sources
nkuba Jun 7, 2022
6c82bc9
Define just the names of required contracts
nkuba Jun 9, 2022
85cf46f
Define path to contracts for external projects
nkuba Jun 9, 2022
3d165c6
Define wildcard for subdirectories
nkuba Jun 9, 2022
0456cf3
Prefix solidity directory with underscore
nkuba Jun 9, 2022
67ef062
Bump go-ethereum to v1.10.18
nkuba Jun 14, 2022
73cb73d
Update go-ethereum to v1.10.19
nkuba Jun 16, 2022
853da78
Update directories structure
nkuba Jun 16, 2022
d418623
Mark legacy V1 directories
nkuba Jun 16, 2022
ae83791
Update keep-common dependency version
nkuba Jun 16, 2022
768371a
Update keep-common dependency version
nkuba Jun 23, 2022
a2b9608
Generated bindings for V2 contracts
nkuba Jun 23, 2022
870728c
Merge remote-tracking branch 'origin/main' into go-bindings-for-v2-co…
nkuba Jun 23, 2022
f60b46d
Update Dockerfile with V2 contracts
nkuba Jun 23, 2022
cc8e738
v0.0.0
nkuba Jun 24, 2022
c59669f
Use https instead of git protocol
nkuba Jun 27, 2022
767713e
Install bash in Dockerfile
nkuba Jun 27, 2022
75c1a6b
Add go.mod and go.sum
nkuba Jun 27, 2022
5d4244e
Build bindings from contract artifacts
nkuba Jun 28, 2022
ccee537
Scripts to download contracts artifacts
nkuba Jun 28, 2022
46f5d91
Use npm pack output as filename to untar
nkuba Jun 28, 2022
3bdec30
Add comment about required npm at least 7.x
nkuba Jun 28, 2022
7cdb935
Remove GO111MODULE from dockerfile
nkuba Jun 28, 2022
c5631aa
Download V2 artifacts in docker build
nkuba Jun 28, 2022
e074218
Copy go.mod and go.sum in one line
nkuba Jun 28, 2022
0fe6c46
Don't regenerate V1 contracts bindings for docker
nkuba Jun 28, 2022
2fabecc
Regenerated Bridge.go abi
nkuba Jun 28, 2022
f5f6d0a
Stop regenerating V1 bindings
nkuba Jun 28, 2022
b72a75d
Download npm packages silently
nkuba Jun 28, 2022
5efd417
Remove dev comment
nkuba Jun 28, 2022
e698866
Download artifacts as part of go generate
nkuba Jun 29, 2022
9101145
Clean _contracts directory
nkuba Jun 29, 2022
1411250
Add force to rm in clean script
nkuba Jun 29, 2022
50db670
Remove download-artifacts.sh from .dockerignore
nkuba Jun 29, 2022
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
17 changes: 7 additions & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ Dockerfile
**/node_modules/*

# Solidity stuff.
# We want to include only bare contracts and NPM package configuration for Go code
# generator.
solidity-v1/
!solidity-v1/contracts
!solidity-v1/package.json
!solidity-v1/package-lock.json
solidity
!solidity/random-beacon/contracts
!solidity/random-beacon/package.json
!solidity/random-beacon/yarn.lock
solidity/

# Go stuff.
**/gen/_contracts
**/gen/*/**/*.go
!pkg/chain/gen/cmd/cmd*.go
!**/gen/cmd/cmd.go

# Legacy V1 contracts bindings.
# We won't generate new bindings in the docker build process, but use the existing ones.
!pkg/chain/gen
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ export.json

# TypeScript
typechain/

# Go bindings generator
pkg/chain/*/gen/_contracts
29 changes: 13 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ ENV GOPATH=/go \
APP_DIR=/go/src/github.com/keep-network/keep-core \
TEST_RESULTS_DIR=/mnt/test-results \
BIN_PATH=/usr/local/bin \
LD_LIBRARY_PATH=/usr/local/lib/ \
# GO111MODULE required to support go modules
GO111MODULE=on
LD_LIBRARY_PATH=/usr/local/lib/

RUN apk add --update --no-cache \
g++ \
Expand All @@ -18,40 +16,39 @@ RUN apk add --update --no-cache \
make \
nodejs \
npm \
bash \
python3 && \
rm -rf /var/cache/apk/ && mkdir /var/cache/apk/ && \
rm -rf /usr/share/man

COPY --from=ethereum/solc:0.5.17 /usr/bin/solc /usr/bin/solc

RUN go install gotest.tools/gotestsum@latest

RUN mkdir -p $APP_DIR $TEST_RESULTS_DIR

WORKDIR $APP_DIR

# Configure GitHub token to be able to get private repositories.
ARG GITHUB_TOKEN
RUN git config --global url."https://$GITHUB_TOKEN:@github.com/".insteadOf "https://github.com/"

# Get dependencies.
COPY go.mod $APP_DIR/
COPY go.sum $APP_DIR/

COPY go.mod go.sum $APP_DIR/
RUN go mod download

# Install code generators.
RUN cd /go/pkg/mod/github.com/gogo/protobuf@v1.3.2/protoc-gen-gogoslick && go install .

COPY ./solidity-v1 $APP_DIR/solidity-v1
RUN cd $APP_DIR/solidity-v1 && npm install

COPY ./pkg/net/gen $APP_DIR/pkg/net/gen
COPY ./pkg/chain/gen $APP_DIR/pkg/chain/gen
COPY ./pkg/chain/common/gen $APP_DIR/pkg/chain/common/gen
COPY ./pkg/chain/ecdsa/gen $APP_DIR/pkg/chain/ecdsa/gen
COPY ./pkg/chain/random-beacon/gen $APP_DIR/pkg/chain/random-beacon/gen
COPY ./pkg/chain/tbtc-v2/gen $APP_DIR/pkg/chain/tbtc-v2/gen
COPY ./pkg/chain/threshold-network/gen $APP_DIR/pkg/chain/threshold-network/gen
COPY ./pkg/beacon/relay/entry/gen $APP_DIR/pkg/beacon/relay/entry/gen
COPY ./pkg/beacon/relay/gjkr/gen $APP_DIR/pkg/beacon/relay/gjkr/gen
COPY ./pkg/beacon/relay/dkg/result/gen $APP_DIR/pkg/beacon/relay/dkg/result/gen
COPY ./pkg/beacon/relay/registry/gen $APP_DIR/pkg/beacon/relay/registry/gen

# If CONTRACTS_NPM_PACKAGE_TAG is not set it will download NPM packages versions
# published and tagged as `development`.
ARG CONTRACTS_NPM_PACKAGE_TAG

# Need this to resolve imports in generated Ethereum commands.
COPY ./config $APP_DIR/config
RUN go generate ./.../gen
Expand Down
18 changes: 9 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/btcsuite/btcd v0.22.0-beta
github.com/celo-org/celo-blockchain v0.0.0-20210222234634-f8c8f6744526
github.com/ethereum/go-ethereum v1.10.15
github.com/ethereum/go-ethereum v1.10.19
github.com/gogo/protobuf v1.3.2
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa
github.com/google/uuid v1.3.0
github.com/ipfs/go-datastore v0.4.6
github.com/ipfs/go-log v1.0.5
github.com/keep-network/go-libp2p-bootstrap v0.0.0-20211001132324-54dddf8aebd4
github.com/keep-network/keep-common v1.7.1-0.20211012131917-7102d7b9c6a0
github.com/keep-network/keep-common v1.7.1-0.20220623084224-58daa5270187
github.com/libp2p/go-addr-util v0.1.0
github.com/libp2p/go-libp2p v0.15.1
github.com/libp2p/go-libp2p-connmgr v0.2.4
Expand All @@ -25,7 +25,7 @@ require (
github.com/libp2p/go-libp2p-tls v0.2.0
github.com/multiformats/go-multiaddr v0.4.0
github.com/urfave/cli v1.22.1
golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
)

require (
Expand All @@ -37,7 +37,7 @@ require (
github.com/celo-org/celo-bls-go v0.2.4 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/elastic/gosigar v0.10.5 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/go-ole/go-ole v1.2.1 // indirect
Expand All @@ -49,7 +49,7 @@ require (
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/huin/goupnp v1.0.2 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/ipfs/go-cid v0.0.7 // indirect
github.com/ipfs/go-ipfs-util v0.0.2 // indirect
github.com/ipfs/go-ipns v0.1.2 // indirect
Expand Down Expand Up @@ -133,13 +133,13 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.7.0 // indirect
go.uber.org/zap v1.19.0 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
golang.org/x/tools v0.1.1 // indirect
golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading