Skip to content

Commit

Permalink
Use the newer version of builder which extracts non-essential tools
Browse files Browse the repository at this point in the history
  • Loading branch information
masihyeganeh committed Jan 24, 2025
1 parent 2381b02 commit 569c88f
Show file tree
Hide file tree
Showing 11 changed files with 620 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ znet-start:
znet-remove:
$(BUILDER) znet remove

.PHONY: setup
setup:
$(BUILDER) setup

.PHONY: lint
lint:
$(BUILDER) lint
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ The specification is described [here](spec/spec.md).

## Relayer

## Prerequisites

You may need to install required binaries and docker images.

```bash
make setup
```

### Build relayer binary

```bash
Expand Down
2 changes: 1 addition & 1 deletion build/bridge/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package bridge
import (
"context"

"github.com/CoreumFoundation/coreumbridge-xrpl/build/tools"
"github.com/CoreumFoundation/crust/build/golang"
"github.com/CoreumFoundation/crust/build/tools"
"github.com/CoreumFoundation/crust/build/types"
)

Expand Down
4 changes: 2 additions & 2 deletions build/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreumbridge-xrpl/build

go 1.21
go 1.23.3

// Crust replacements
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
Expand Down Expand Up @@ -32,7 +32,7 @@ replace (

require (
github.com/CoreumFoundation/coreum/build v0.0.0-20240617083016-5a1fbce5d2bc
github.com/CoreumFoundation/crust v0.0.0-20240618072929-2f1dbe86e20b
github.com/CoreumFoundation/crust v0.0.0-20250122103008-8aa8b7b7214e
github.com/pkg/errors v0.9.1
)

Expand Down
2 changes: 2 additions & 0 deletions build/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/CoreumFoundation/coreumbridge-xrpl/build/bridge"
"github.com/CoreumFoundation/crust/build/crust"
"github.com/CoreumFoundation/crust/build/golang"
"github.com/CoreumFoundation/crust/build/tools"
"github.com/CoreumFoundation/crust/build/types"
)

Expand All @@ -24,6 +25,7 @@ var Commands = map[string]types.Command{
"build/contract": {Fn: bridge.BuildSmartContract, Description: "Builds smart contract"},
"fuzz-test": {Fn: bridge.RunFuzzTests, Description: "Runs fuzz tests"},
"generate": {Fn: bridge.Generate, Description: "Generates artifacts"},
"setup": {Fn: tools.InstallAll, Description: "Installs all the required tools"},
"images": {Fn: bridge.BuildRelayerDockerImage, Description: "Builds relayer docker image"},
"integration-tests": {Fn: bridge.RunAllIntegrationTests, Description: "Runs integration tests"},
"integration-tests/xrpl": {Fn: bridge.RunIntegrationTests(bridge.TestXRPL),
Expand Down
17 changes: 16 additions & 1 deletion build/tools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import (
)

// CoreumBridgeXRPLWASMV110 is the previous version of bridge smart contract.
const CoreumBridgeXRPLWASMV110 tools.Name = "coreumbridge-xrpl-wasm-v1.1.0"
const (
CoreumBridgeXRPLWASMV110 tools.Name = "coreumbridge-xrpl-wasm-v1.1.0"
Mockgen tools.Name = "mockgen"
)

// Tools is a list of tools required by the bridge builder.
var Tools = []tools.Tool{
Expand All @@ -27,9 +30,21 @@ var Tools = []tools.Tool{
},
},
},

// https://github.com/uber-go/mock/releases
tools.GoPackageTool{
Name: Mockgen,
Version: "v0.4.0",
Package: "go.uber.org/mock/mockgen",
},
}

// EnsureBridgeXRPLWASM ensures bridge smart contract is available.
func EnsureBridgeXRPLWASM(ctx context.Context, _ types.DepsFunc) error {
return tools.Ensure(ctx, CoreumBridgeXRPLWASMV110, tools.TargetPlatformLocal)
}

// EnsureMockgen ensures that mockgen is available.
func EnsureMockgen(ctx context.Context, deps types.DepsFunc) error {
return tools.Ensure(ctx, Mockgen, tools.TargetPlatformLocal)
}
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21
go 1.23.3

use (
./build
Expand Down
582 changes: 582 additions & 0 deletions go.work.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration-tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreumbridge-xrpl/integration-tests

go 1.21
go 1.23.3

// same replacements as in coreum
replace (
Expand Down
4 changes: 2 additions & 2 deletions relayer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.21.2-alpine3.18 as builder
FROM --platform=$BUILDPLATFORM golang:1.23.3-alpine3.20 as builder

RUN apk add --no-cache make git

Expand All @@ -19,7 +19,7 @@ ARG GOARCH=amd64

RUN make build-relayer GOOS=${GOOS} GOARCH=${GOARCH}

FROM --platform=$TARGETPLATFORM alpine:3.18
FROM --platform=$TARGETPLATFORM alpine:3.20

COPY --from=builder /code/build/coreumbridge-xrpl-relayer /bin/coreumbridge-xrpl-relayer

Expand Down
2 changes: 1 addition & 1 deletion relayer/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/CoreumFoundation/coreumbridge-xrpl/relayer

go 1.21
go 1.23.3

// same replacements as in coreum
replace (
Expand Down

0 comments on commit 569c88f

Please sign in to comment.