8000 replace tm-db with cometbft-db in 0.34 by jmalicevic · Pull Request #160 · cometbft/cometbft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

replace tm-db with cometbft-db in 0.34 #160

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

Merged
merged 38 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9404ba8
replace tmdb with comedb in 0.34
jmalicevic Jan 19, 2023
89d456a
Merge branch 'v0.34.x' into jasmina/135-replace-tmdb-0.34
jmalicevic Jan 19, 2023
b5872ca
updates to workflow files
jmalicevic Jan 19, 2023
e364244
e2e test docker files
jmalicevic Jan 19, 2023
58eb9ee
e2e test docker files
jmalicevic Jan 19, 2023
1529e3b
updated cometbft-docker
jmalicevic Jan 19, 2023
2ca7734
missing tag
jmalicevic Jan 19, 2023
f858825
removed line not recognized properly
jmalicevic Jan 19, 2023
4064f97
Apply suggestions from code review
jmalicevic Jan 19, 2023
845c276
Revert "Apply suggestions from code review"
jmalicevic Jan 19, 2023
62237b9
fixed spacing
jmalicevic Jan 19, 2023
f390a3d
fixed spacing
jmalicevic Jan 19, 2023
efbd53d
Merge branch 'v0.34.x' into jasmina/135-replace-tmdb-0.34
jmalicevic Jan 19, 2023
7f8070b
removed whitespace
jmalicevic Jan 19, 2023
d483791
Merge branch 'jasmina/135-replace-tmdb-0.34' of github.com:CometBFT/t…
jmalicevic Jan 19, 2023
aab4ec5
attempting to fix the docker.yml
jmalicevic Jan 19, 2023
7a744bf
minor
jmalicevic Jan 19, 2023
1ec7dfe
minor
jmalicevic Jan 19, 2023
c3d63be
minor
jmalicevic Jan 19, 2023
b4eab3c
minor
jmalicevic Jan 19, 2023
9f7ab02
minor
jmalicevic Jan 19, 2023
572e7e7
fixing docker
jmalicevic Jan 19, 2023
0974db6
trying to fix missing tags
jmalicevic Jan 19, 2023
8bd07ed
install git in dockerfile
jmalicevic Jan 19, 2023
b66db93
try quotes
jmalicevic Jan 19, 2023
a7bc3b0
try quotes
jmalicevic Jan 19, 2023
02130c6
try quotes
jmalicevic Jan 19, 2023
0422e18
try quotes
jmalicevic Jan 19, 2023
199b725
try quotes
jmalicevic Jan 19, 2023
b3b4de1
change run cmd format
jmalicevic Jan 19, 2023
fb96a0a
changing arg in yml
jmalicevic Jan 19, 2023
dd49efc
changing arg in yml
jmalicevic Jan 19, 2023
3a7c095
changing arg in yml
jmalicevic Jan 19, 2023
0d64c69
added git install in run cmd
jmalicevic Jan 19, 2023
5c1cf68
reverted change in run cmd
jmalicevic Jan 19, 2023
813711f
added git install in run cmd
jmalicevic Jan 19, 2023
00dcd8f
reordered commands in Dockerfile
jmalicevic Jan 20, 2023
fcedd70
Applied Thanes fix for dockerfiles
jmalicevic Jan 20, 2023
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/check-generated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ permissions:
jobs:
check-mocks:
runs-on: ubuntu-latest
# TODO (thane): Remove once we make the cometbft-db repository public
env:
GOPRIVATE: github.com/cometbft/cometbft-db
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3


# TODO (thane): Remove once we make the cometbft-db repository public
- run : git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- name: "Check generated mocks"
run: |
set -euo pipefail
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cometbft-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10


jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,3 +59,5 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.prep.outputs.tags }}
build-args: |
"GO_MODULES_TOKEN=${{ secrets.GO_MODULES_TOKEN }}"
8 changes: 8 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
matrix:
goarch: ["arm", "amd64"]
timeout-minutes: 5
# ToDo (thane): Remove once we make cometbft-db public
env:
GOPRIVATE: github.com/cometbft/cometbft-db
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -52,6 +56,8 @@ jobs:
**/**.go
go.mod
go.sum
# ToDo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- name: install
run: GOOS=linux GOARCH=${{ matrix.goarch }} make build
if: "env.GIT_DIFF != ''"
Expand All @@ -74,6 +80,8 @@ jobs:
**/**.go
go.mod
go.sum
# ToDo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- uses: actions/download-artifact@v3
with:
name: "${{ github.sha }}-${{ matrix.part }}"
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/e2e-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@ jobs:
group: ['00', '01', '02', '03']
runs-on: ubuntu-latest
timeout-minutes: 60
# TODO (thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
# We supply this as an environment variable in order to pass it
# through to the "docker" Makefile target in ./test/e2e
GO_MODULES_TOKEN: ${{ secrets.GO_MODULES_TOKEN }}
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3

# TODO (thane): Remove once we make the cometbft-db repository public.
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Build
working-directory: test/e2e
# Run make jobs in parallel, since we can't run steps in parallel.
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/e2e-nightly-34x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
group: ['00', '01', '02', '03']
runs-on: ubuntu-latest
timeout-minutes: 60
# TODO (thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
# We have to supply this as an environment variable in order to pass it
# through to the "docker" Makefile target in ./test/e2e
GO_MODULES_TOKEN: ${{ secrets.GO_MODULES_TOKEN }}
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -34,6 +40,9 @@ jobs:
# Run make jobs in parallel, since we can't run steps in parallel.
run: make -j2 docker generator runner

# TODO(thane): Remove once we make the cometbft-db repository public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Generate testnets
working-directory: test/e2e
# When changing -g, also change the matrix groups above
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/e2e-nightly-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ jobs:
group: ['00', '01', '02', '03']
runs-on: ubuntu-latest
timeout-minutes: 60
# TODO(thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
# We have to supply this as an environment variable in order to pass it
# through to the "docker" Makefile target in ./test/e2e
GO_MODULES_TOKEN: ${{ secrets.GO_MODULES_TOKEN }}
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.18'

- uses: actions/checkout@v3

# TODO(thane): Remove once we make the cometbft-db repository public.
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Build
working-directory: test/e2e
# Run make jobs in parallel, since we can't run steps in parallel.
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
e2e-test:
runs-on: ubuntu-latest
timeout-minutes: 15
# TODO(thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
# We have to supply this as an environment variable in order to pass it
# through to the "docker" Makefile target in ./test/e2e
GO_MODULES_TOKEN: ${{ secrets.GO_MODULES_TOKEN }}
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -24,6 +30,10 @@ jobs:
go.mod
go.sum

# TODO(thane): Remove once we make the cometbft-db repository public.
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/


- name: Build
working-directory: test/e2e
# Run two make jobs in parallel, since we can't run steps in parallel.
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
jobs:
govulncheck:
runs-on: ubuntu-latest
# TODO(thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
steps:
- uses: actions/setup-go@v3
with:
Expand All @@ -26,6 +29,8 @@ jobs:
go.mod
go.sum
Makefile
# TODO(thane): Remove once we make the cometbft-db repository public.
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- name: govulncheck
run: make vulncheck
if: "env.GIT_DIFF != ''"
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
timeout-minutes: 8
# TODO(thane): Remove once we make the cometbft-db repository public.
env:
GOPRIVATE: github.com/cometbft/cometbft-db
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
Expand All @@ -23,6 +26,8 @@ jobs:
**/**.go
go.mod
go.sum
# TODO(thane): Remove once we make the cometbft-db repository public.
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/testapp-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10
# TODO(thane): Remove once we make the cometbft-db repository public.

jobs:
build:
Expand Down Expand Up @@ -58,3 +59,6 @@ jobs:
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'beep_boop' }}
tags: ${{ steps.prep.outputs.tags }}
# TODO(thane): Remove when we publish cometbft-db repository.
build-args: |
"GO_MODULES_TOKEN=${{ secrets.GO_MODULES_TOKEN }}"
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
# ToDo (thane): Remove once we make cometbft-db public
GOPRIVATE: github.com/cometbft/cometbft-db
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

Expand All @@ -33,6 +35,8 @@ jobs:
**/**.go
go.mod
go.sum
# Todo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- name: install
run: make install install_abci
if: "env.GIT_DIFF != ''"
Expand Down Expand Up @@ -65,6 +69,8 @@ jobs:
**/**.go
go.mod
go.sum
# Todo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
Expand Down Expand Up @@ -97,6 +103,8 @@ jobs:
**/**.go
go.mod
go.sum
# Todo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
Expand Down Expand Up @@ -128,6 +136,8 @@ jobs:
**/**.go
go.mod
go.sum
# Todo (thane): Remove once we make cometbft-db public
- run: git config --global url.https://${{ secrets.GO_MODULES_TOKEN }}@github.com/.insteadOf https://github.com/
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
Expand Down
10 changes: 9 additions & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@
FROM golang:1.18-alpine as builder
RUN apk update && \
apk upgrade && \
apk --no-cache add make
apk --no-cache add make git
COPY / /cometbft
WORKDIR /cometbft
# TODO(thane): Remove once we publish the cometbft-db repository.
ENV GOPRIVATE=github.com/cometbft/cometbft-db
ARG GO_MODULES_TOKEN
RUN apk --no-cache add git && git config --global "url.https://${GO_MODULES_TOKEN}@github.com/".insteadOf "https://github.com/"
RUN make build-linux

# stage 2
FROM golang:1.18-alpine



LABEL maintainer="hello@informal.systems"


# CometBFT will be looking for the genesis file in /cometbft/config/genesis.json
# (unless you change `genesis_file` in config.toml). You can put your config.toml and
# private validator file into /cometbft/config.
Expand Down
6 changes: 5 additions & 1 deletion DOCKER/build.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_N
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t "cometbft/cometbft" -t "cometbft/cometbft:$TAG" -t "cometbft/cometbft:$TAG_NO_PATCH" .
docker build \
--build-arg GO_MODULES_TOKEN=${GO_MODULES_TOKEN} \
-t "cometbft/cometbft" \
-t "cometbft/cometbft:$TAG" \
-t "cometbft/cometbft:$TAG_NO_PATCH" .
fi
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BUILD_TAGS?=cometbft
ifneq ($(shell git symbolic-ref -q --short HEAD),)
VERSION := unreleased-$(shell git symbolic-ref -q --short HEAD)-$(shell git rev-parse HEAD)
else
VERSION := $(shell git describe)
VERSION := $(shell git describe --tags)
endif

LD_FLAGS = -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(VERSION)
Expand Down Expand Up @@ -237,7 +237,7 @@ sync-docs:

build-docker: build-linux
cp $(OUTPUT) DOCKER/cometbft
docker build --label=cometbft --tag="cometbft/cometbft" DOCKER
docker build --label=cometbft --tag="cometbft/cometbft" --build-arg GO_MODULES_TOKEN=${GO_MODULES_TOKEN} --progress=plain DOCKER --no-cache
rm -rf DOCKER/cometbft
.PHONY: build-docker

Expand Down
2 changes: 1 addition & 1 deletion abci/example/kvstore/kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/json"
"fmt"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
Expand Down
2 changes: 1 addition & 1 deletion abci/example/kvstore/persistent_kvstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

"github.com/tendermint/tendermint/abci/example/code"
"github.com/tendermint/tendermint/abci/types"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/v0/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

abci "github.com/tendermint/tendermint/abci/types"
cfg "github.com/tendermint/tendermint/config"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/v1/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

abci "github.com/tendermint/tendermint/abci/types"
cfg "github.com/tendermint/tendermint/config"
Expand Down
2 changes: 1 addition & 1 deletion blockchain/v2/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"testing"
"time"

dbm "github.com/cometbft/cometbft-db"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/behaviour"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tendermint/commands/light.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/spf13/cobra"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

"github.com/tendermint/tendermint/libs/log"
cmtmath "github.com/tendermint/tendermint/libs/math"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tendermint/commands/reindex_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strings"

dbm "github.com/cometbft/cometbft-db"
"github.com/spf13/cobra"
dbm "github.com/tendermint/tm-db"

abcitypes "github.com/tendermint/tendermint/abci/types"
cmtcfg "github.com/tendermint/tendermint/config"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tendermint/commands/reindex_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

abcitypes "github.com/tendermint/tendermint/abci/types"
cmtcfg "github.com/tendermint/tendermint/config"
Expand Down
2 changes: 1 addition & 1 deletion cmd/tendermint/commands/rollback.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra"

dbm "github.com/tendermint/tm-db"
dbm "github.com/cometbft/cometbft-db"

cfg "github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/libs/os"
Expand Down
Loading
0