Skip to content

Commit

Permalink
ci: Test with CometBFT v0.38.0
Browse files Browse the repository at this point in the history
Signed-off-by: Thane Thomson <[email protected]>
  • Loading branch information
thanethomson committed Nov 8, 2023
1 parent 1b81cd9 commit f8e742a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ test:
go test -cover -race ./...
.PHONY: test

# Builds a Docker image called "tendermint/localnode", which is based on
# Builds a Docker image called "cometbft/localnode", which is based on
# Tendermint Core. Takes the current system user and group ID as the user/group
# IDs for the tmuser user within the container so as to eliminate permissions
# issues when generating testnet files in the localnet target.
localnode:
@docker build -f ./test/localnode/Dockerfile \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
-t tendermint/localnode:latest \
-t cometbft/localnode:latest \
./test/localnode/
.PHONY: localnode

Expand All @@ -48,9 +48,9 @@ localnet: localnode
mkdir -p build && \
docker run \
--rm \
-v $(BUILD_DIR):/tendermint:Z \
tendermint/localnode \
testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.168.10.2; \
-v $(BUILD_DIR):/cometbft:Z \
cometbft/localnode \
testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.168.10.2; \
fi
.PHONY: localnet

Expand Down
24 changes: 12 additions & 12 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,56 @@ version: '3'
services:
node0:
container_name: node0
image: "tendermint/localnode"
image: "cometbft/localnode"
ports:
- "26656-26657:26656-26657"
environment:
- ID=0
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.2

node1:
container_name: node1
image: "tendermint/localnode"
image: "cometbft/localnode"
ports:
- "26659-26660:26656-26657"
environment:
- ID=1
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.3

node2:
container_name: node2
image: "tendermint/localnode"
image: "cometbft/localnode"
environment:
- ID=2
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
ports:
- "26661-26662:26656-26657"
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.4

node3:
container_name: node3
image: "tendermint/localnode"
image: "cometbft/localnode"
environment:
- ID=3
- LOG=${LOG:-tendermint.log}
- LOG=${LOG:-cometbft.log}
ports:
- "26663-26664:26656-26657"
volumes:
- ../build:/tendermint:Z
- ../build:/cometbft:Z
networks:
localnet:
ipv4_address: 192.168.10.5
Expand Down
2 changes: 1 addition & 1 deletion test/localnode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tendermint/tendermint:v0.34.24
FROM cometbft/cometbft:v0.38.0
LABEL maintainer="[email protected]"

ARG UID
Expand Down
16 changes: 8 additions & 8 deletions test/localnode/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
##
## Input parameters
##
BINARY=${BINARY:-/usr/bin/tendermint}
BINARY=${BINARY:-/usr/bin/cometbft}
ID=${ID:-0}
LOG=${LOG:-tendermint.log}
LOG=${LOG:-cometbft.log}

##
## Assert linux binary
##
if ! [ -f "${BINARY}" ]; then
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'tendermint' E.g.: -e BINARY=tendermint_my_test_version"
echo "The binary $(basename "${BINARY}") cannot be found. Please add the binary to the shared folder. Please use the BINARY environment variable if the name of the binary is not 'cometbft' E.g.: -e BINARY=cometbft_my_test_version"
exit 1
fi
BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')"
Expand All @@ -25,14 +25,14 @@ id
##
## Run binary with all parameters
##
export TMHOME="/tendermint/node${ID}"
export CMTHOME="/cometbft/node${ID}"

if [ -d "`dirname ${TMHOME}/${LOG}`" ]; then
"$BINARY" "$@" | tee "${TMHOME}/${LOG}"
if [ -d "`dirname ${CMTHOME}/${LOG}`" ]; then
"$BINARY" "$@" | tee "${CMTHOME}/${LOG}"
else
"$BINARY" "$@"
fi

find /tendermint -type d -exec chmod ug=rwx,o=rx {} \;
find /tendermint -type f -exec chmod ug=rw,o=r {} \;
find /cometbft -type d -exec chmod ug=rwx,o=rx {} \;
find /cometbft -type f -exec chmod ug=rw,o=r {} \;

0 comments on commit f8e742a

Please sign in to comment.