From adad353eb5d944da368dab5dc794431397181af9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:24:14 +0000 Subject: [PATCH 1/3] Initial plan From 0600625c255b62433391266674ba4c1f6a71e825 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:37:21 +0000 Subject: [PATCH 2/3] Remove unmaintained local net script and documentation Co-authored-by: evan-forbes <42654277+evan-forbes@users.noreply.github.com> --- DOCKER/README.md | 12 -- Makefile | 18 +- docker-compose.yml | 66 ------- docs/networks/README.md | 3 - docs/networks/docker-compose.md | 179 ------------------ dredd.yml | 2 +- networks/local/Makefile | 7 - networks/local/README.md | 3 - networks/local/localnode/Dockerfile | 15 -- networks/local/localnode/config-template.toml | 2 - networks/local/localnode/wrapper.sh | 36 ---- 11 files changed, 2 insertions(+), 341 deletions(-) delete mode 100644 docker-compose.yml delete mode 100644 docs/networks/docker-compose.md delete mode 100644 networks/local/Makefile delete mode 100644 networks/local/README.md delete mode 100644 networks/local/localnode/Dockerfile delete mode 100644 networks/local/localnode/config-template.toml delete mode 100755 networks/local/localnode/wrapper.sh diff --git a/DOCKER/README.md b/DOCKER/README.md index 33a6bd1021..75820d42e4 100644 --- a/DOCKER/README.md +++ b/DOCKER/README.md @@ -35,18 +35,6 @@ 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/cometbft/cometbft/blob/v0.38.x/Makefile) and run: - -```sh -make build-linux -make build-docker-localnode -make localnet-start -``` - -Note that this will build and use a different image than the ones provided here. - ## License - CometBFT's license is [Apache 2.0](https://github.com/cometbft/cometbft/blob/v0.38.x/LICENSE). diff --git a/Makefile b/Makefile index 0ed22c77fb..e6439ea9b4 100644 --- a/Makefile +++ b/Makefile @@ -311,11 +311,6 @@ build-linux: GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) $(MAKE) build .PHONY: build-linux -#? build-docker-localnode: Build the "localnode" docker image -build-docker-localnode: - @cd networks/local && make -.PHONY: build-docker-localnode - # 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/cometbft @@ -324,17 +319,6 @@ build_c-amazonlinux: docker run --rm -it -v `pwd`:/cometbft cometbft/cometbft:build_c-amazonlinux .PHONY: build_c-amazonlinux -#? localnet-start: 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:/cometbft:Z cometbft/localnode testnet --config /etc/cometbft/config-template.toml --o . --starting-ip-address 192.167.10.2; fi - docker compose up -d -.PHONY: localnet-start - -#? localnet-stop: Stop testnet -localnet-stop: - docker compose down -.PHONY: localnet-stop - #? build-contract-tests-hooks: Build hooks for dredd, to skip or add information on some steps build-contract-tests-hooks: ifeq ($(OS),Windows_NT) @@ -344,7 +328,7 @@ else endif .PHONY: build-contract-tests-hooks -#? contract-tests: Run a nodejs tool to test endpoints against a localnet +#? contract-tests: Run a nodejs tool to test endpoints against a testnet # The command takes care of starting and stopping the network # prerequisits: build-contract-tests-hooks build-linux # the two build commands were not added to let this command run from generic containers or machines. diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index f6c37165ab..0000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,66 +0,0 @@ -version: '3' - -services: - node0: - container_name: node0 - image: "cometbft/localnode" - ports: - - "26656-26657:26656-26657" - environment: - - ID=0 - - LOG=${LOG:-cometbft.log} - volumes: - - ./build:/cometbft:Z - networks: - localnet: - ipv4_address: 192.167.10.2 - - node1: - container_name: node1 - image: "cometbft/localnode" - ports: - - "26659-26660:26656-26657" - environment: - - ID=1 - - LOG=${LOG:-cometbft.log} - volumes: - - ./build:/cometbft:Z - networks: - localnet: - ipv4_address: 192.167.10.3 - - node2: - container_name: node2 - image: "cometbft/localnode" - environment: - - ID=2 - - LOG=${LOG:-cometbft.log} - ports: - - "26661-26662:26656-26657" - volumes: - - ./build:/cometbft:Z - networks: - localnet: - ipv4_address: 192.167.10.4 - - node3: - container_name: node3 - image: "cometbft/localnode" - environment: - - ID=3 - - LOG=${LOG:-cometbft.log} - ports: - - "26663-26664:26656-26657" - volumes: - - ./build:/cometbft:Z - networks: - localnet: - ipv4_address: 192.167.10.5 - -networks: - localnet: - driver: bridge - ipam: - driver: default - config: - - subnet: 192.167.0.0/16 diff --git a/docs/networks/README.md b/docs/networks/README.md index ceea235985..6771c578e0 100644 --- a/docs/networks/README.md +++ b/docs/networks/README.md @@ -7,7 +7,4 @@ parent: # Overview -Use [Docker Compose](./docker-compose.md) to spin up CometBFT testnets on your -local machine. - See the `cometbft testnet --help` command for more help initializing testnets. diff --git a/docs/networks/docker-compose.md b/docs/networks/docker-compose.md deleted file mode 100644 index fef5ae5a39..0000000000 --- a/docs/networks/docker-compose.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -order: 2 ---- - -# Docker Compose - -With Docker Compose, you can spin up local testnets with a single command. - -## Requirements - -1. [Install CometBFT](../guides/install.md) -2. [Install docker](https://docs.docker.com/engine/installation/) -3. [Install docker-compose](https://docs.docker.com/compose/install/) - -## Build - -Build the `cometbft` binary and, optionally, the `cometbft/localnode` -docker image. - -Note the binary will be mounted into the container so it can be updated without -rebuilding the image. - -```sh -# Build the linux binary in ./build -make build-linux - -# (optionally) Build cometbft/localnode image -make build-docker-localnode -``` - -## Run a testnet - -To start a 4 node testnet run: - -```sh -make localnet-start -``` - -The nodes bind their RPC servers to ports 26657, 26660, 26662, and 26664 on the -host. - -This file creates a 4-node network using the localnode image. - -The nodes of the network expose their P2P and RPC endpoints to the host machine -on ports 26656-26657, 26659-26660, 26661-26662, and 26663-26664 respectively. - -To update the binary, just rebuild it and restart the nodes: - -```sh -make build-linux -make localnet-start -``` - -## Configuration - -The `make localnet-start` creates files for a 4-node testnet in `./build` by -calling the `cometbft testnet` command. - -The `./build` directory is mounted to the `/cometbft` mount point to attach -the binary and config files to the container. - -To change the number of validators / non-validators change the `localnet-start` Makefile target [here](../../Makefile): - -```makefile -localnet-start: localnet-stop - @if ! [ -f build/node0/config/genesis.json ]; then docker run --rm -v $(CURDIR)/build:/cometbft:Z cometbft/localnode testnet --v 5 --n 3 --o . --populate-persistent-peers --starting-ip-address 192.167.10.2 ; fi - docker compose up -d -``` - -The command now will generate config files for 5 validators and 3 -non-validators. Along with generating new config files the docker-compose file needs to be edited. -Adding 4 more nodes is required in order to fully utilize the config files that were generated. - -```yml - node3: # bump by 1 for every node - container_name: node3 # bump by 1 for every node - image: "cometbft/localnode" - environment: - - ID=3 - - LOG=${LOG:-cometbft.log} - ports: - - "26663-26664:26656-26657" # Bump 26663-26664 by one for every node - volumes: - - ./build:/cometbft:Z - networks: - localnet: - ipv4_address: 192.167.10.5 # bump the final digit by 1 for every node -``` - -Before running it, don't forget to cleanup the old files: - -```sh -# Clear the build folder -rm -rf ./build/node* -``` - -## Configuring ABCI containers - -To use your own ABCI applications with 4-node setup edit the [docker-compose.yaml](https://github.com/cometbft/cometbft/blob/v0.38.x/docker-compose.yml) file and add images to your ABCI application. - -```yml - abci0: - container_name: abci0 - image: "abci-image" - build: - context: . - dockerfile: abci.Dockerfile - command: - networks: - localnet: - ipv4_address: 192.167.10.6 - - abci1: - container_name: abci1 - image: "abci-image" - build: - context: . - dockerfile: abci.Dockerfile - command: - networks: - localnet: - ipv4_address: 192.167.10.7 - - abci2: - container_name: abci2 - image: "abci-image" - build: - context: . - dockerfile: abci.Dockerfile - command: - networks: - localnet: - ipv4_address: 192.167.10.8 - - abci3: - container_name: abci3 - image: "abci-image" - build: - context: . - dockerfile: abci.Dockerfile - command: - networks: - localnet: - ipv4_address: 192.167.10.9 - -``` - -Override the [command](https://github.com/cometbft/cometbft/blob/v0.38.x/networks/local/localnode/Dockerfile#L11) in each node to connect to it's ABCI. - -```yml - node0: - container_name: node0 - image: "cometbft/localnode" - ports: - - "26656-26657:26656-26657" - environment: - - ID=0 - - LOG=$${LOG:-cometbft.log} - volumes: - - ./build:/cometbft:Z - command: node --proxy_app=tcp://abci0:36658 - networks: - localnet: - ipv4_address: 192.167.10.2 -``` - -Similarly do for node1, node2 and node3 then [run testnet](#run-a-testnet). - -## Logging - -Log is saved under the attached volume, in the `cometbft.log` file. If the -`LOG` environment variable is set to `stdout` at start, the log is not saved, -but printed on the screen. - -## Special binaries - -If you have multiple binaries with different names, you can specify which one -to run with the `BINARY` environment variable. The path of the binary is relative -to the attached volume. diff --git a/dredd.yml b/dredd.yml index 66487e670a..73b731b3e6 100644 --- a/dredd.yml +++ b/dredd.yml @@ -3,7 +3,7 @@ dry-run: null hookfiles: build/contract_tests language: go require: null -server: make localnet-start +# server: # localnet functionality has been removed - see CONTRIBUTING.md for current status server-wait: 30 init: false custom: {} diff --git a/networks/local/Makefile b/networks/local/Makefile deleted file mode 100644 index 6d96fe2f59..0000000000 --- a/networks/local/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# Makefile for the "localnode" docker image. - -all: - docker buildx build --platform linux/amd64 --tag cometbft/localnode localnode - -.PHONY: all - diff --git a/networks/local/README.md b/networks/local/README.md deleted file mode 100644 index 7159c45df9..0000000000 --- a/networks/local/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Local Cluster with Docker Compose - -See the [docs](https://docs.cometbft.com/v0.38.x/networks/docker-compose.html). diff --git a/networks/local/localnode/Dockerfile b/networks/local/localnode/Dockerfile deleted file mode 100644 index f1a93d5b9c..0000000000 --- a/networks/local/localnode/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM alpine:3.19 - -RUN apk update && \ - apk upgrade && \ - apk --no-cache add curl jq file - -VOLUME /cometbft -WORKDIR /cometbft -EXPOSE 26656 26657 -ENTRYPOINT ["/usr/bin/wrapper.sh"] -CMD ["node", "--proxy_app", "kvstore"] -STOPSIGNAL SIGTERM - -COPY wrapper.sh /usr/bin/wrapper.sh -COPY config-template.toml /etc/cometbft/config-template.toml diff --git a/networks/local/localnode/config-template.toml b/networks/local/localnode/config-template.toml deleted file mode 100644 index a90eb7bd5f..0000000000 --- a/networks/local/localnode/config-template.toml +++ /dev/null @@ -1,2 +0,0 @@ -[rpc] -laddr = "tcp://0.0.0.0:26657" diff --git a/networks/local/localnode/wrapper.sh b/networks/local/localnode/wrapper.sh deleted file mode 100755 index 700d4ac8a0..0000000000 --- a/networks/local/localnode/wrapper.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env sh - -## -## Input parameters -## -BINARY=/cometbft/${BINARY:-cometbft} -ID=${ID:-0} -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 'cometbft' E.g.: -e BINARY=my_test_binary" - - exit 1 -fi -BINARY_CHECK="$(file "$BINARY" | grep 'ELF 64-bit LSB executable, x86-64')" -if [ -z "${BINARY_CHECK}" ]; then - echo "Binary needs to be OS linux, ARCH amd64 (build with 'make build-linux')" - exit 1 -fi - -## -## Run binary with all parameters -## -export CMTHOME="/cometbft/node${ID}" - -if [ -d "`dirname ${CMTHOME}/${LOG}`" ]; then - "$BINARY" "$@" | tee "${CMTHOME}/${LOG}" -else - "$BINARY" "$@" -fi - -chmod 777 -R /cometbft - From 78cb591fce66858d78c913f494fcb10b6c6af8e1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 17:40:12 +0000 Subject: [PATCH 3/3] Update documentation to clarify contract tests are not available Co-authored-by: evan-forbes <42654277+evan-forbes@users.noreply.github.com> --- CONTRIBUTING.md | 21 ++++++++------------- Makefile | 6 +++--- dredd.yml | 2 +- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f7041382c..41378c1a9e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -416,16 +416,11 @@ Run: `cd test/fuzz && make fuzz-{PACKAGE-COMPONENT}` **If you contribute to the RPC endpoints it's important to document your changes in the [Openapi file](./rpc/openapi/openapi.yaml)**. -To test your changes you must install `nodejs` and run: - -```bash -npm i -g dredd -make build-linux build-contract-tests-hooks -make contract-tests -``` - -**WARNING: these are currently broken due to -not supporting complete OpenAPI 3**. - -This command will popup a network and check every endpoint against what has -been documented. +**WARNING: contract tests are currently not available. They previously depended +on a local network setup that has been removed due to maintenance issues. The +tests were also broken due to not supporting +complete OpenAPI 3**. + +The contract tests would check every endpoint against what has been documented +in the OpenAPI specification. Alternative testing approaches should be used to +validate API changes. diff --git a/Makefile b/Makefile index e6439ea9b4..98924c1ed0 100644 --- a/Makefile +++ b/Makefile @@ -329,9 +329,9 @@ endif .PHONY: build-contract-tests-hooks #? contract-tests: Run a nodejs tool to test endpoints against a testnet -# The command takes care of starting and stopping the network -# prerequisits: build-contract-tests-hooks build-linux -# the two build commands were not added to let this command run from generic containers or machines. +# NOTE: Currently not functional due to removal of localnet infrastructure +# prerequisits: build-contract-tests-hooks +# The binary build commands were not added to let this command run from generic containers or machines. # The binaries should be built beforehand contract-tests: dredd diff --git a/dredd.yml b/dredd.yml index 73b731b3e6..5044aa268f 100644 --- a/dredd.yml +++ b/dredd.yml @@ -3,7 +3,7 @@ dry-run: null hookfiles: build/contract_tests language: go require: null -# server: # localnet functionality has been removed - see CONTRIBUTING.md for current status +# server: # localnet functionality has been removed - contract tests not currently available server-wait: 30 init: false custom: {}