Skip to content

Commit

Permalink
chore: Remove localnet functionality from Makefile (#184)
Browse files Browse the repository at this point in the history
This functionality is not useful as a network of Babylon nodes just by
itself does not allow us to test much. This is evident by the fact that
we never use this for testing. Instead we typically utilise a deployment
containing all the interconnected components consisting of the Babylon
network.
  • Loading branch information
vitsalis authored Oct 11, 2024
1 parent 58e13f0 commit e66765c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 149 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* [#170](https://github.com/babylonlabs-io/babylon/pull/170) Go releaser setup
* [#168](https://github.com/babylonlabs-io/babylon/pull/168) Remove devdoc from
Makefile and remove unnecessary gin replace.
* [#184](https://github.com/babylonlabs-io/babylon/pull/184) Remove localnet
setup as it provides no additional testing value.

## v0.12.0

Expand Down
45 changes: 6 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ format: ## Run code formatter
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/docs/statik/statik.go" -not -name '*.pb.go' | xargs goimports -w -local github.com/babylonlabs-io/babylon

.PHONY: format

###############################################################################
Expand Down Expand Up @@ -441,56 +442,22 @@ build-cosmos-relayer-docker: ## Build Docker image for the Cosmos relayer
clean-docker-network:
$(DOCKER) network rm ${dockerNetworkList}

.PHONY: build-docker build-docker-e2e build-cosmos-relayer-docker clean-docker-network

###############################################################################
### Localnet ###
###############################################################################

init-testnet-dirs: ## Initialize directories for testnet, creates a ./.testnets directory containing configuration for 4 Babylon nodes
# need to create the dir before hand so that the docker container has write access to the `.testnets` dir
# regardless of the user it uses
mkdir -p $(CURDIR)/.testnets && chmod o+w $(CURDIR)/.testnets
$(DOCKER) run --rm -v $(CURDIR)/.testnets:/home/babylon/.testnets:Z babylonlabs-io/babylond \
babylond testnet init-files --v 4 -o /home/babylon/.testnets \
--starting-ip-address 192.168.10.2 --keyring-backend=test \
--chain-id chain-test --btc-confirmation-depth 2 --additional-sender-account true \
--epoch-interval 5

localnet-start-nodes: init-testnet-dirs ## Boot the nodes described in the docker-compose.yml file
docker-compose up -d

localnet-start: localnet-stop build-docker localnet-start-nodes ## Run with 4 nodes, a bitcoin instance, and a vigilante instance

# localnet-stop will clean up and stop all localnets running
localnet-stop:
rm -rf $(CURDIR)/.testnets
docker-compose down

build-test-wasm: ## Build WASM bindings for testing
docker run --rm -v "$(WASM_DIR)":/code \
$(DOCKER) run --rm -v "$(WASM_DIR)":/code \
--mount type=volume,source="$(WASM_DIR_BASE_NAME)_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer-arm64:0.12.13
docker run --rm -v "$(WASM_DIR)":/code \
$(DOCKER) run --rm -v "$(WASM_DIR)":/code \
--mount type=volume,source="$(WASM_DIR_BASE_NAME)_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.13

.PHONY: \
init-testnet-dirs \
localnet-start-nodes \
localnet-start \
localnet-stop
.PHONY: build-docker build-docker-e2e build-cosmos-relayer-docker clean-docker-network build-test-wasm

.PHONY: diagrams
diagrams: ## Generate diagrams for documentation
$(MAKE) -C client/docs/diagrams

.PHONY: update-changelog
update-changelog: ## Update the project changelog
@echo ./scripts/update_changelog.sh $(since_tag) $(upcoming_tag)
./scripts/update_changelog.sh $(since_tag) $(upcoming_tag)
.PHONY: diagrams

###############################################################################
### Release ###
Expand Down Expand Up @@ -544,4 +511,4 @@ release:
else
release:
@echo "Error: GITHUB_TOKEN is not defined. Please define it before running 'make release'."
endif
endif
95 changes: 0 additions & 95 deletions docker-compose.yml

This file was deleted.

15 changes: 0 additions & 15 deletions docs/run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ babylond --home .testnet/node0/babylond --chain-id chain-test \
tx btclightclient insert-header <header-hex>
```

## Running a multi-node testnet

We provide support for running a multi-node testnet using Docker. To build it

```console
make localnet-start
```

The corresponding node directories can be found under `.testnets`

```console
$ ls .testnets
gentxs node0 node1 node2 node3
```

## Running node in Production

When running the Babylon node in a production setting, operators should adhere to 
Expand Down

0 comments on commit e66765c

Please sign in to comment.