Skip to content

Commit

Permalink
Rename binary and Docker (#152)
Browse files Browse the repository at this point in the history
* [backport] Renaming in docker-related files (#123)

* [cherry-picked] Renaming in docker-related files (#110)

* Performed renaming in docker-related files

* Fix e2e launch

* Rename TENDERMINT_BUILD_OPTIONS to COMETBFT_BUILD_OPTIONS all over

* Revert `cometbft-proof` to `tendermint-proof`

* Replaced TENDERMINT_VERSION --> COMETBFT_VERSION all over the codebase

* [backport] Rename inside `test/e2e` (#139) (#144)

* Renamed all help text for cometbft CLI

* Update networks/local/localnode/Dockerfile

Co-authored-by: Thane Thomson <connect@thanethomson.com>

Co-authored-by: Thane Thomson <connect@thanethomson.com>
  • Loading branch information
sergio-mena and thanethomson committed Jan 19, 2023
1 parent 96f6a75 commit 21d783e
Show file tree
Hide file tree
Showing 47 changed files with 206 additions and 206 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Docker
# Build & Push rebuilds the Tendermint docker image on every push to main and creation of tags
# and pushes the image to https://hub.docker.com/r/cometbft/tendermint
# Build & Push rebuilds the CometBFT docker image on every push to main and creation of tags
# and pushes the image to https://hub.docker.com/r/cometbft/cometbft
on:
push:
branches:
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=cometbft/tendermint
DOCKER_IMAGE=cometbft/cometbft
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ builds:
- id: "Tendermint"
main: ./cmd/tendermint/main.go
ldflags:
- -s -w -X github.com/tendermint/tendermint/version.TMCoreSemVer={{ .Version }}
- -s -w -X github.com/cometbft/cometbft/version.TMCoreSemVer={{ .Version }}
env:
- CGO_ENABLED=0
goos:
Expand Down
2 changes: 1 addition & 1 deletion DOCKER/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tendermint
cometbft
22 changes: 11 additions & 11 deletions DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# stage 1 Generate Tendermint Binary
# stage 1 Generate CometBFT Binary
FROM golang:1.18-alpine as builder
RUN apk update && \
apk upgrade && \
apk --no-cache add make
COPY / /tendermint
WORKDIR /tendermint
COPY / /cometbft
WORKDIR /cometbft
RUN make build-linux

# stage 2
FROM golang:1.18-alpine
LABEL maintainer="hello@tendermint.com"
LABEL maintainer="hello@informal.systems"

# Tendermint will be looking for the genesis file in /tendermint/config/genesis.json
# 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 /tendermint/config.
# private validator file into /cometbft/config.
#
# The /tendermint/data dir is used by tendermint to store state.
ENV TMHOME /tendermint
# The /cometbft/data dir is used by CometBFT to store state.
ENV TMHOME /cometbft

# OS environment setup
# Set user right away for determinism, create directory for persistence and give our user ownership
# jq and curl used for extracting `pub_key` from private validator while
# deploying tendermint with Kubernetes. It is nice to have bash so the users
# deploying CometBFT with Kubernetes. It is nice to have bash so the users
# could execute bash commands.
RUN apk update && \
apk upgrade && \
Expand All @@ -39,11 +39,11 @@ EXPOSE 26656 26657 26660

STOPSIGNAL SIGTERM

COPY --from=builder /tendermint/build/tendermint /usr/bin/tendermint
COPY --from=builder /cometbft/build/cometbft /usr/bin/cometbft

# You can overwrite these before the first run to influence
# config.json and genesis.json. Additionally, you can override
# CMD to add parameters to `tendermint node`.
# CMD to add parameters to `cometbft node`.
ENV PROXY_APP=kvstore MONIKER=dockernode CHAIN_ID=dockerchain

COPY ./DOCKER/docker-entrypoint.sh /usr/local/bin/
Expand Down
6 changes: 3 additions & 3 deletions DOCKER/Dockerfile.build_c-amazonlinux
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ ENV PATH=$PATH:/usr/local/go/bin:/go/bin
ENV GOBIN=/go/bin
ENV GOPATH=/go/src

RUN mkdir -p /tendermint
WORKDIR /tendermint
RUN mkdir -p /cometbft
WORKDIR /cometbft

CMD ["/usr/bin/make", "build", "TENDERMINT_BUILD_OPTIONS=cleveldb"]
CMD ["/usr/bin/make", "build", "COMETBFT_BUILD_OPTIONS=cleveldb"]

4 changes: 2 additions & 2 deletions DOCKER/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ push:
@sh -c "'$(CURDIR)/push.sh'"

build_testing:
docker build --tag tendermint/testing -f ./Dockerfile.testing .
docker build --tag cometbft/testing -f ./Dockerfile.testing .

build_amazonlinux_buildimage:
docker build -t "tendermint/tendermint:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux .
docker build -t "cometbft/cometbft:build_c-amazonlinux" -f Dockerfile.build_c-amazonlinux .

.PHONY: build push build_testing build_amazonlinux_buildimage
34 changes: 17 additions & 17 deletions DOCKER/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@

## Supported tags and respective `Dockerfile` links

DockerHub tags for official releases are [here](https://hub.docker.com/r/tendermint/tendermint/tags/). The "latest" tag will always point to the highest version number.
DockerHub tags for official releases are [here](https://hub.docker.com/r/cometbft/cometbft/tags/). The "latest" tag will always point to the highest version number.

Official releases can be found [here](https://github.com/tendermint/tendermint/releases).
Official releases can be found [here](https://github.com/cometbft/cometbft/releases).

The Dockerfile for tendermint is not expected to change in the near future. The master file used for all builds can be found [here](https://raw.githubusercontent.com/tendermint/tendermint/main/DOCKER/Dockerfile).
The Dockerfile for CometBFT is not expected to change in the near future. The main file used for all builds can be found [here](https://raw.githubusercontent.com/cometbft/cometbft/main/DOCKER/Dockerfile).

Respective versioned files can be found <https://raw.githubusercontent.com/tendermint/tendermint/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).
Respective versioned files can be found <https://raw.githubusercontent.com/cometbft/cometbft/vX.XX.XX/DOCKER/Dockerfile> (replace the Xs with the version number).

## Quick reference

- **Where to get help:** <https://tendermint.com/>
- **Where to file issues:** <https://github.com/tendermint/tendermint/issues>
- **Where to get help:** <https://cometbft.com/>
- **Where to file issues:** <https://github.com/cometbft/cometbft/issues>
- **Supported Docker versions:** [the latest release](https://github.com/moby/moby/releases) (down to 1.6 on a best-effort basis)

## Tendermint
## CometBFT

Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines.
CometBFT is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines.

For more background, see the [the docs](https://docs.tendermint.com/v0.34/introduction/#quick-start).
For more background, see the [the docs](https://docs.cometbft.com/v0.34/introduction/#quick-start).

To get started developing applications, see the [application developers guide](https://docs.tendermint.com/v0.34/introduction/quick-start.html).
To get started developing applications, see the [application developers guide](https://docs.cometbft.com/v0.34/introduction/quick-start.html).

## How to use this image

### Start one instance of the Tendermint core with the `kvstore` app
### Start one instance of the CometBFT with the `kvstore` app

A quick example of a built-in app and Tendermint core in one container.
A quick example of a built-in app and CometBFT in one container.

```sh
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app=kvstore
docker run -it --rm -v "/tmp:/cometbft" cometbft/cometbft init
docker run -it --rm -v "/tmp:/cometbft" cometbft/cometbft node --proxy_app=kvstore
```

## Local cluster

To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/tendermint/tendermint/blob/v0.34.x/Makefile) and run:
To run a 4-node network, see the `Makefile` in the root of [the repo](https://github.com/cometbft/cometbft/blob/v0.34.x/Makefile) and run:

```sh
make build-linux
Expand All @@ -49,8 +49,8 @@ Note that this will build and use a different image than the ones provided here.

## License

- Tendermint's license is [Apache 2.0](https://github.com/tendermint/tendermint/blob/main/LICENSE).
- CometBFT's license is [Apache 2.0](https://github.com/cometbft/cometbft/blob/main/LICENSE).

## Contributing

Contributions are most welcome! See the [contributing file](https://github.com/tendermint/tendermint/blob/main/CONTRIBUTING.md) for more information.
Contributions are most welcome! See the [contributing file](https://github.com/cometbft/cometbft/blob/v0.34.x/CONTRIBUTING.md) for more information.
2 changes: 1 addition & 1 deletion DOCKER/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ read -p "==> Build 3 docker images with the following tags (latest, $TAG, $TAG_N
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker build -t "tendermint/tendermint" -t "tendermint/tendermint:$TAG" -t "tendermint/tendermint:$TAG_NO_PATCH" .
docker build -t "cometbft/cometbft" -t "cometbft/cometbft:$TAG" -t "cometbft/cometbft:$TAG_NO_PATCH" .
fi
6 changes: 3 additions & 3 deletions DOCKER/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
set -e

if [ ! -d "$TMHOME/config" ]; then
echo "Running tendermint init to create (default) configuration for docker run."
tendermint init
echo "Running cometbft init to create (default) configuration for docker run."
cometbft init

sed -i \
-e "s/^proxy_app\s*=.*/proxy_app = \"$PROXY_APP\"/" \
Expand All @@ -20,4 +20,4 @@ if [ ! -d "$TMHOME/config" ]; then
mv "$TMHOME/config/genesis.json.new" "$TMHOME/config/genesis.json"
fi

exec tendermint "$@"
exec cometbft "$@"
6 changes: 3 additions & 3 deletions DOCKER/push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ read -p "==> Push 3 docker images with the following tags (latest, $TAG, $TAG_NO
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
docker push "tendermint/tendermint:latest"
docker push "tendermint/tendermint:$TAG"
docker push "tendermint/tendermint:$TAG_NO_PATCH"
docker push "cometbft/cometbft:latest"
docker push "cometbft/cometbft:$TAG"
docker push "cometbft/cometbft:$TAG_NO_PATCH"
fi
44 changes: 22 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PACKAGES=$(shell go list ./...)
OUTPUT?=build/tendermint
OUTPUT?=build/cometbft

BUILD_TAGS?=tendermint
BUILD_TAGS?=cometbft

# If building a release, please checkout the version tag to get the correct version setting
ifneq ($(shell git symbolic-ref -q --short HEAD),)
Expand All @@ -10,42 +10,42 @@ else
VERSION := $(shell git describe)
endif

LD_FLAGS = -X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)
LD_FLAGS = -X github.com/cometbft/cometbft/version.TMCoreSemVer=$(VERSION)
BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)"
HTTPS_GIT := https://github.com/tendermint/tendermint.git
HTTPS_GIT := https://github.com/cometbft/cometbft.git
CGO_ENABLED ?= 0

# handle nostrip
ifeq (,$(findstring nostrip,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (,$(findstring nostrip,$(COMETBFT_BUILD_OPTIONS)))
BUILD_FLAGS += -trimpath
LD_FLAGS += -s -w
endif

# handle race
ifeq (race,$(findstring race,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (race,$(findstring race,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_FLAGS += -race
endif

# handle cleveldb
ifeq (cleveldb,$(findstring cleveldb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (cleveldb,$(findstring cleveldb,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += cleveldb
endif

# handle badgerdb
ifeq (badgerdb,$(findstring badgerdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (badgerdb,$(findstring badgerdb,$(COMETBFT_BUILD_OPTIONS)))
BUILD_TAGS += badgerdb
endif

# handle rocksdb
ifeq (rocksdb,$(findstring rocksdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (rocksdb,$(findstring rocksdb,$(COMETBFT_BUILD_OPTIONS)))
CGO_ENABLED=1
BUILD_TAGS += rocksdb
endif

# handle boltdb
ifeq (boltdb,$(findstring boltdb,$(TENDERMINT_BUILD_OPTIONS)))
ifeq (boltdb,$(findstring boltdb,$(COMETBFT_BUILD_OPTIONS)))
BUILD_TAGS += boltdb
endif

Expand All @@ -58,7 +58,7 @@ all: check build test install
include tests.mk

###############################################################################
### Build Tendermint ###
### Build CometBFT ###
###############################################################################

build:
Expand Down Expand Up @@ -159,7 +159,7 @@ go.sum: go.mod
draw_deps:
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
@goviz -i github.com/cometbft/cometbft/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
.PHONY: draw_deps

get_deps_bin_size:
Expand All @@ -175,9 +175,9 @@ get_deps_bin_size:

# generates certificates for TLS testing in remotedb and RPC server
gen_certs: clean_certs
certstrap init --common-name "tendermint.com" --passphrase ""
certstrap init --common-name "cometbft.com" --passphrase ""
certstrap request-cert --common-name "server" -ip "127.0.0.1" --passphrase ""
certstrap sign "server" --CA "tendermint.com" --passphrase ""
certstrap sign "server" --CA "cometbft.com" --passphrase ""
mv out/server.crt rpc/jsonrpc/server/test.crt
mv out/server.key rpc/jsonrpc/server/test.key
rm -rf out
Expand All @@ -195,7 +195,7 @@ clean_certs:

format:
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/tendermint/tendermint
find . -name '*.go' -type f -not -path "*.git*" -not -name '*.pb.go' -not -name '*pb_test.go' | xargs goimports -w -local github.com/cometbft/cometbft
.PHONY: format

lint:
Expand Down Expand Up @@ -236,9 +236,9 @@ sync-docs:
###############################################################################

build-docker: build-linux
cp $(OUTPUT) DOCKER/tendermint
docker build --label=tendermint --tag="tendermint/tendermint" DOCKER
rm -rf DOCKER/tendermint
cp $(OUTPUT) DOCKER/cometbft
docker build --label=cometbft --tag="cometbft/cometbft" DOCKER
rm -rf DOCKER/cometbft
.PHONY: build-docker

###############################################################################
Expand All @@ -254,17 +254,17 @@ build-docker-localnode:
@cd networks/local && make
.PHONY: build-docker-localnode

# Runs `make build TENDERMINT_BUILD_OPTIONS=cleveldb` from within an Amazon
# Runs `make build COMETBFT_BUILD_OPTIONS=cleveldb` from within an Amazon
# Linux (v2)-based Docker build container in order to build an Amazon
# Linux-compatible binary. Produces a compatible binary at ./build/tendermint
# Linux-compatible binary. Produces a compatible binary at ./build/cometbft
build_c-amazonlinux:
$(MAKE) -C ./DOCKER build_amazonlinux_buildimage
docker run --rm -it -v `pwd`:/tendermint tendermint/tendermint:build_c-amazonlinux
docker run --rm -it -v `pwd`:/cometbft cometbft/cometbft:build_c-amazonlinux
.PHONY: build_c-amazonlinux

# Run a 4-node testnet locally
localnet-start: localnet-stop build-docker-localnode
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/tendermint:Z tendermint/localnode testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
@if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.167.10.2; fi
docker-compose up
.PHONY: localnet-start

Expand Down
6 changes: 3 additions & 3 deletions cmd/tendermint/commands/compact.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var CompactGoLevelDBCmd = &cobra.Command{
Use: "experimental-compact-goleveldb",
Short: "force compacts the tendermint storage engine (only GoLevelDB supported)",
Short: "force compacts the CometBFT storage engine (only GoLevelDB supported)",
Long: `
This is a temporary utility command that performs a force compaction on the state
and blockstores to reduce disk space for a pruning node. This should only be run
Expand Down Expand Up @@ -49,7 +49,7 @@ func compactGoLevelDBs(rootDir string, logger log.Logger) {
dbPath := filepath.Join(rootDir, "data", dbName+".db")
store, err := leveldb.OpenFile(dbPath, o)
if err != nil {
logger.Error("failed to initialize tendermint db", "path", dbPath, "err", err)
logger.Error("failed to initialize cometbft db", "path", dbPath, "err", err)
return
}
defer store.Close()
Expand All @@ -58,7 +58,7 @@ func compactGoLevelDBs(rootDir string, logger log.Logger) {

err = store.CompactRange(util.Range{Start: nil, Limit: nil})
if err != nil {
logger.Error("failed to compact tendermint db", "path", dbPath, "err", err)
logger.Error("failed to compact cometbft db", "path", dbPath, "err", err)
}
}()
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/tendermint/commands/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ var (
)

// DebugCmd defines the root command containing subcommands that assist in
// debugging running Tendermint processes.
// debugging running CometBFT processes.
var DebugCmd = &cobra.Command{
Use: "debug",
Short: "A utility to kill or watch a Tendermint process while aggregating debugging data",
Short: "A utility to kill or watch a CometBFT process while aggregating debugging data",
}

func init() {
Expand All @@ -33,7 +33,7 @@ func init() {
&nodeRPCAddr,
flagNodeRPCAddr,
"tcp://localhost:26657",
"the Tendermint node's RPC address (<host>:<port>)",
"the CometBFT node's RPC address (<host>:<port>)",
)

DebugCmd.AddCommand(killCmd)
Expand Down
Loading

0 comments on commit 21d783e

Please sign in to comment.