Skip to content
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

build: add helper for quickly setting up simapp #15846

Merged
merged 4 commits into from
Apr 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
build: add helper for quickly setting up simapp
  • Loading branch information
julienrbrt committed Apr 14, 2023
commit d377efb3a50855e2cdcc7d510a56d4930d84879a
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ MOCKS_DIR = $(CURDIR)/tests/mocks
HTTPS_GIT := https://github.com/cosmos/cosmos-sdk.git
DOCKER := $(shell which docker)
PROJECT_NAME = $(shell git remote get-url origin | xargs basename -s .git)
SIMD_BIN ?= $(shell which simd)

# process build tags
build_tags = netgo
Expand Down Expand Up @@ -189,6 +190,23 @@ build-docs:
### Tests & Simulation ###
###############################################################################

# make run initializes a single local node network
# it is useful for testing and development
# Usage: make build && make run && simd start
# Attention: make run will remove all data in simapp home directory
run:
@echo "using $(SIMD_BIN)"
if [ -d "$(shell $(SIMD_BIN) config home)" ]; then rm -r $(shell $(SIMD_BIN) config home); fi
$(SIMD_BIN) config set client chain-id demo
$(SIMD_BIN) config set client keyring-backend test
$(SIMD_BIN) keys add alice
$(SIMD_BIN) keys add bob
$(SIMD_BIN) init test --chain-id demo
$(SIMD_BIN) genesis add-genesis-account alice 5000000000stake --keyring-backend test
$(SIMD_BIN) genesis add-genesis-account bob 5000000000stake --keyring-backend test
$(SIMD_BIN) genesis gentx alice 1000000stake --chain-id demo
$(SIMD_BIN) genesis collect-gentxs

test: test-unit
test-e2e:
$(MAKE) -C tests test-e2e
Expand Down