Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update price-feeder dep to v2.0.2 and remove FTX #412

Merged
merged 15 commits into from
Dec 15, 2022
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
env:
GOOS: ${{ matrix.targetos }}
GOARCH: ${{ matrix.arch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v3
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Build
uses: goreleaser/goreleaser-action@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- name: Display Go Version
run: go version
- name: Install tparse
Expand All @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
with:
Expand All @@ -56,7 +56,7 @@ jobs:

test-e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 20
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.1
Expand All @@ -68,7 +68,7 @@ jobs:
- uses: actions/setup-go@v3
if: env.GIT_DIFF
with:
go-version: 1.18
go-version: 1.19
cache: true

# In this step, this action saves a list of existing images,
Expand Down
13 changes: 4 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
project_name: peggo

env:
- GO111MODULE=on
- CGO_ENABLED=1

before:
hooks:
- go mod tidy -compat=1.18
- go mod download

builds:
- main: ./
Expand All @@ -15,17 +15,12 @@ builds:
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.commit={{.Commit}} -X main.date={{ .CommitDate }} -X github.com/umee-network/peggo/cmd/peggo.Version={{ .Version }} -X github.com/umee-network/peggo/cmd/peggo.Commit=$(COMMIT)={{ .Commit }}
goos:
- darwin
- linux
goarch:
- amd64
- arm
- arm64

archives:
- format: tar.gz
Expand All @@ -35,8 +30,8 @@ archives:
format: zip
name_template: "{{ .Binary }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
files:
- LICENSE
- README.md
- LICENSE

release:
github:
Expand All @@ -52,4 +47,4 @@ snapshot:
name_template: SNAPSHOT-{{ .Commit }}

changelog:
skip: true
skip: false
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Improvements

- [#412](https://github.com/umee-network/peggo/pull/412) Update price-feeder to v2.0.1 and removed FTX and Binance from default providers.
- update go to 1.19
- [#328f55c](https://github.com/umee-network/peggo/commit/328f55c5944101527df13d43e791c47155ddd8d7) Cosmos SDK to v0.46.7.
- [#399](https://github.com/umee-network/peggo/pull/399) Update price-feeder to v101 and umee to v3.1.0.

## [v1.3.0](https://github.com/umee-network/peggo/releases/tag/v1.3.0) - 2022-10-26
Expand Down Expand Up @@ -180,7 +183,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

- [#134] Fix logs, CLI help and a panic when a non-function call transaction was
received during the TX pending check.
received during the TX pending check.

## [v0.2.0](https://github.com/umee-network/peggo/releases/tag/v0.2.0) - 2022-01-17

Expand Down
33 changes: 15 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
## image for docker Peggo release

ARG IMG_TAG=latest

# Fetch base packages
FROM golang:1.18-alpine AS base-builder
ENV PACKAGES make git libc-dev gcc linux-headers
RUN apk add --no-cache $PACKAGES
FROM golang:1.19-bullseye AS builder

# Compile the peggo binary
FROM base-builder AS peggo-builder
WORKDIR /src/app/
COPY go.mod go.sum* ./
RUN go mod download
WORKDIR /src/peggo/
COPY . .
RUN apk add --no-cache $PACKAGES
RUN go mod download
RUN make install

# Fetch umeed binary
FROM base-builder AS umeed-builder
ARG UMEE_VERSION=v3.0.0-beta1
ENV PACKAGES curl eudev-dev
RUN apk add --no-cache $PACKAGES
WORKDIR /downloads/
RUN git clone https://github.com/umee-network/umee.git
RUN cd umee && git checkout ${UMEE_VERSION} && CGO_ENABLED=0 make build && cp ./build/umeed /usr/local/bin/
# Build umeed
WORKDIR /src/umee
# RUN wget https://github.com/umee-network/umee/releases/download/v3.0.3/umeed-v3.0.3-linux-amd64.tar.gz && \
RUN wget https://github.com/umee-network/umee/releases/download/v3.3.0-rc1/umeed-v3.3.0-rc1-linux-amd64 && \
chmod +x umeed-v3.3.0-rc1-linux-amd64* && \
cp umeed-v3.3.0-rc1-linux-amd64* /usr/local/bin/umeed
RUN wget https://raw.githubusercontent.com/CosmWasm/wasmvm/v1.1.1/internal/api/libwasmvm.x86_64.so

# Add to a distroless container
FROM gcr.io/distroless/cc:$IMG_TAG
ARG IMG_TAG
COPY --from=peggo-builder /go/bin/peggo /usr/local/bin/
COPY --from=umeed-builder /usr/local/bin/umeed /usr/local/bin/
COPY --from=builder /go/bin/peggo /usr/local/bin/
COPY --from=builder /usr/local/bin/umeed /usr/local/bin/
COPY --from=builder /src/umee/libwasmvm.x86_64.so /lib/
EXPOSE 26656 26657 1317 9090
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ endif
ldflags = -X github.com/umee-network/peggo/cmd/peggo.Version=$(VERSION) \
-X github.com/umee-network/peggo/cmd/peggo.Commit=$(COMMIT) \
-X github.com/umee-network/peggo/cmd/peggo.SDKVersion=$(SDK_VERSION)
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -ldflags '$(ldflags)'
build_tags += $(BUILD_TAGS)
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'

build: go.sum
@echo "--> Building..."
CGO_ENABLED=0 go build -mod=readonly -o $(BUILD_DIR)/ $(BUILD_FLAGS) ./...
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILD_DIR)/ ./...

install: go.sum
@echo "--> Installing..."
CGO_ENABLED=0 go install -mod=readonly $(BUILD_FLAGS) ./...
go install -mod=readonly $(BUILD_FLAGS) ./...

.PHONY: build install

Expand All @@ -47,7 +50,7 @@ test-unit: ARGS=-timeout=5m -tags='norace'
test-unit: TEST_PACKAGES=$(PACKAGES_UNIT)
test-unit-cover: ARGS=-timeout=5m -tags='norace' -coverprofile=coverage.txt -covermode=atomic
test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT)
test-e2e: ARGS=-timeout=25m -v
test-e2e: ARGS=-timeout=20m -v
test-e2e: TEST_PACKAGES=$(PACKAGES_E2E)
$(TEST_TARGETS): run-tests

Expand Down Expand Up @@ -106,7 +109,7 @@ solidity-wrappers: $(SOLIDITY_DIR)/contracts/*.sol
###############################################################################

docker-build:
@docker build -t umeenet/peggo .
@docker build -t umeenet/peggo --platform=linux/amd64 .

docker-build-debug:
@docker build -t umeenet/peggo --build-arg IMG_TAG=debug .
Expand Down
5 changes: 2 additions & 3 deletions cmd/peggo/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"golang.org/x/sync/errgroup"
"google.golang.org/grpc"

umeepfprovider "github.com/umee-network/umee/price-feeder/oracle/provider"
umeepfprovider "github.com/umee-network/umee/price-feeder/v2/oracle/provider"

"github.com/umee-network/peggo/cmd/peggo/client"
"github.com/umee-network/peggo/orchestrator"
Expand Down Expand Up @@ -295,7 +295,6 @@ func getOrchestratorCmd() *cobra.Command {
umeepfprovider.ProviderHuobi.String(),
umeepfprovider.ProviderOkx.String(),
umeepfprovider.ProviderCoinbase.String(),
umeepfprovider.ProviderBinance.String(),
umeepfprovider.ProviderBitget.String(),
umeepfprovider.ProviderMexc.String(),
umeepfprovider.ProviderCrypto.String(),
Expand All @@ -304,8 +303,8 @@ func getOrchestratorCmd() *cobra.Command {
allProviders := append([]string{
umeepfprovider.ProviderKraken.String(),
umeepfprovider.ProviderGate.String(),
umeepfprovider.ProviderFTX.String(),
umeepfprovider.ProviderMock.String(),
umeepfprovider.ProviderBinance.String(),
}, defaultProviders...)

cmd.Flags().StringSlice(flagOracleProviders, defaultProviders,
Expand Down
2 changes: 2 additions & 0 deletions contrib/images/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## image for e2e tests

# Fetch base packages
FROM golang:1.19-alpine AS builder
ENV PACKAGES make git libc-dev gcc linux-headers
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/spf13/viper v1.14.0
github.com/stretchr/testify v1.8.1
github.com/tendermint/tendermint v0.34.24
github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737
github.com/umee-network/umee/price-feeder/v2 v2.0.2
github.com/umee-network/umee/v3 v3.3.0-rc1
golang.org/x/sync v0.1.0
golang.org/x/term v0.2.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1413,8 +1413,8 @@ github.com/umee-network/bech32-ibc v0.3.2 h1:T2QgfMVktA9iAYLYmhmcukJr5qoaEJgRLDo
github.com/umee-network/bech32-ibc v0.3.2/go.mod h1:kbT1K+mxxzDkvmcsHtBXgM2meNv6AXroxPdSeWAcZE0=
github.com/umee-network/cosmos-sdk v0.46.7-umee h1:6/JO17fjm1kxiFVjfblbNIRbilZcHV2WsC87iD63+kI=
github.com/umee-network/cosmos-sdk v0.46.7-umee/go.mod h1:fqKqz39U5IlEFb4nbQ72951myztsDzFKKDtffYJ63nk=
github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737 h1:8NZaHAl6/Xoss6qfsUvxc6o9JZdPQzUS6ku87UvhJeQ=
github.com/umee-network/umee/price-feeder v1.0.1-0.20221027015322-96357449c737/go.mod h1:qtGLqvFnz9I9gJBpI3918hEIZZbeqJ3r2yJW/1fK8mM=
github.com/umee-network/umee/price-feeder/v2 v2.0.2 h1:pSCH5NAQVnTy1T+DBX2zXr9TtG8mP7VDHoygAvqMNK4=
github.com/umee-network/umee/price-feeder/v2 v2.0.2/go.mod h1:cpN8tgH0aby8FaEAVH5UgFjhKtgLBogHFTH8oXgIjkQ=
github.com/umee-network/umee/v3 v3.3.0-rc1 h1:Wm1x42b3N0iY8THCNOyrA78CvImnW8CW7hyfLbcipvg=
github.com/umee-network/umee/v3 v3.3.0-rc1/go.mod h1:AMWNhC28k/OPvTLf8IWTCS0eSJJ4A72AWFwt8UB2eaQ=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
Expand Down
2 changes: 1 addition & 1 deletion orchestrator/oracle/currency.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package oracle
import (
"strings"

umeepftypes "github.com/umee-network/umee/price-feeder/oracle/types"
umeepftypes "github.com/umee-network/umee/price-feeder/v2/oracle/types"
)

const (
Expand Down
8 changes: 4 additions & 4 deletions orchestrator/oracle/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/rs/zerolog"
"golang.org/x/sync/errgroup"

pforacle "github.com/umee-network/umee/price-feeder/oracle"
pfprovider "github.com/umee-network/umee/price-feeder/oracle/provider"
pftypes "github.com/umee-network/umee/price-feeder/oracle/types"
pfsync "github.com/umee-network/umee/price-feeder/pkg/sync"
pforacle "github.com/umee-network/umee/price-feeder/v2/oracle"
pfprovider "github.com/umee-network/umee/price-feeder/v2/oracle/provider"
pftypes "github.com/umee-network/umee/price-feeder/v2/oracle/types"
pfsync "github.com/umee-network/umee/price-feeder/v2/pkg/sync"
umeeparams "github.com/umee-network/umee/v3/app/params"
)

Expand Down