Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. PROTO_FILES=$(shell find proto -name "*.proto")
  2. GO_FILES=$(shell find . -name "*.go")
  3. # Address of the main tilt validator that the others should connect to
  4. TILT_VALADDRESS=wormholevaloper1cyyzpxplxdzkeea7kwsydadg87357qna87hzv8
  5. VERSION := $(shell echo $(shell git describe --tags 2> /dev/null || echo v0.0.1))
  6. COMMIT := $(shell git log -1 --format='%h' 2> /dev/null || echo 'abc123')
  7. ldflags = \
  8. -X github.com/cosmos/cosmos-sdk/version.Name=wormchain\
  9. -X github.com/cosmos/cosmos-sdk/version.ServerName=wormchaind\
  10. -X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
  11. -X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
  12. -X "github.com/cosmos/cosmos-sdk/version.BuildTags=ledger"
  13. BUILD_FLAGS := -ldflags '$(ldflags)'
  14. .PHONY: all
  15. all: client
  16. .PHONY: client build/wormchaind
  17. client: build/wormchaind
  18. build/wormchaind: cmd/wormchaind/main.go $(GO_FILES)
  19. @echo building "wormchaind-$(VERSION)"
  20. go build -v $(BUILD_FLAGS) -tags ledger -o $@ $<
  21. cp "$@" "$@"-"$(VERSION)"
  22. # proto: $(PROTO_FILES)
  23. # DOCKER_BUILDKIT=1 docker build --target go-export -f Dockerfile.proto -o type=local,dest=. ..
  24. # vue: $(GO_FILES) proto
  25. # mkdir -p $@
  26. # touch -m $@
  27. # DOCKER_BUILDKIT=1 docker build --target vue-export -f Dockerfile.proto -o type=local,dest=. ..
  28. # For now this is a phony target so we just rebuild it each time instead of
  29. # tracking dependencies
  30. .PHONY: ts-sdk
  31. ts-sdk: vue
  32. npm ci --prefix $@
  33. npm run build --prefix $@
  34. .PHONY: run
  35. run: build/wormchaind
  36. ./$< start --home build --log_level="debug"
  37. # get npm packages for contracts/tools
  38. contracts-tools-deps: contracts/tools/package-lock.json
  39. npm ci --prefix=contracts/tools
  40. # get .env and devnet-consts.json for contracts/tools
  41. contracts-devnet-env:
  42. cd .. && ./scripts/guardian-set-init.sh 1
  43. cd .. && ./scripts/distribute-devnet-consts.sh
  44. # get wasm artifacts for cosmwasm contracts
  45. contracts-artifacts:
  46. cd ../cosmwasm && $(MAKE) artifacts
  47. cp -r ../cosmwasm/artifacts contracts
  48. # get everything needed to
  49. contracts-deploy-setup: contracts-tools-deps contracts-devnet-env contracts-artifacts
  50. # runs the contract deployment script
  51. contracts-deploy-local: contracts-deploy-setup
  52. npm run deploy-wormchain --prefix=contracts/tools
  53. .PHONY: test
  54. test:
  55. go test -v ./...
  56. .PHONY: bootstrap
  57. bootstrap:
  58. npm run bootstrap --prefix testing/js
  59. .PHONY: clean
  60. clean:
  61. rm -rf build/wormchaind build/wormchaind-* build/**/*.db build/**/*.wal vue
  62. echo "{\"height\":\"0\",\"round\":0,\"step\":0}" > build/data/priv_validator_state.json
  63. #####################
  64. ## INTERCHAINTESTS ##
  65. #####################
  66. # Generate Wormchain Image
  67. local-image: build/wormchaind
  68. docker build -t wormchain:local -f Dockerfile.ict ..
  69. # Individual Tests ($$ is interpreted as $)
  70. rm-testcache:
  71. go clean -testcache
  72. .PHONY: rm-testcache
  73. ictest-cancel-upgrade: rm-testcache
  74. cd interchaintest && go test -race -v -run ^TestCancelUpgrade$$ ./...
  75. .PHONY: ictest-cancel-upgrade
  76. ictest-malformed-payload: rm-testcache
  77. cd interchaintest && go test -race -v -run ^TestMalformedPayload$$ ./...
  78. .PHONY: ictest-malformed-payload
  79. ictest-slashing-params-update-vaa: rm-testcache
  80. cd interchaintest && go test -race -v -run ^TestSlashingParamsUpdateVaa$$ ./...
  81. .PHONY: ictest-slashing-params-update-vaa
  82. ictest-upgrade-failure: rm-testcache
  83. cd interchaintest && go test -race -v -run ^TestUpgradeFailure$$ ./...
  84. .PHONY: ictest-upgrade-failure
  85. ictest-upgrade: rm-testcache
  86. cd interchaintest && go test -race -v -run ^TestUpgrade$$ ./...
  87. .PHONY: ictest-upgrade
  88. ictest-wormchain: rm-testcache
  89. cd interchaintest && go test -race -v -run ^TestWormchain$$ ./...
  90. .PHONY: ictest-wormchain
  91. ictest-ibc-receiver: rm-testcache
  92. cd interchaintest && go test -race -v -run ^TestIbcReceiver ./...
  93. .PHONY: ictest-ibc-receiver
  94. ictest-cw-wormhole: rm-testcache
  95. cd interchaintest && go test -race -v -run ^TestCWWormhole ./...
  96. .PHONY: ictest-cw-wormhole
  97. ictest-cw-shutdown-contracts: rm-testcache
  98. cd interchaintest && go test -race -v -run ^TestShutdown ./...
  99. .PHONY: ictest-cw-shutdown-contracts
  100. ictest-cw-shutdown-contracts: rm-testcache
  101. cd interchaintest && go test -race -v -run ^TestShutdown ./...
  102. ictest-validator-hotswap: rm-testcache
  103. cd interchaintest && go test -race -v -run ^TestValidatorHotswap$$ ./...
  104. .PHONY: ictest-validator-hotswap