-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add dockerfile that and script that automates node operation #72
Closed
JeancarloBarrios
wants to merge
2
commits into
main
from
JeancarloBarrios/fix-docker-build-for-arm-arch
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
.env | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ build/ | |
dist/ | ||
|
||
/.act-event-file | ||
|
||
scripts/testnet/config.sh | ||
scripts/testnet/nodes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,19 +65,141 @@ endif | |
all: tools build lint test | ||
|
||
############################################################################### | ||
### Build ### | ||
## Build ## | ||
############################################################################### | ||
|
||
build: go.sum | ||
CGO_ENABLED=1 go build -mod=readonly $(BUILD_FLAGS) -o build/seda-chaind ./cmd/seda-chaind | ||
build_tags = netgo | ||
|
||
# experimental feature | ||
ifeq ($(EXPERIMENTAL),true) | ||
build_tags += experimental | ||
endif | ||
|
||
ifeq ($(LEDGER_ENABLED),true) | ||
ifeq ($(OS),Windows_NT) | ||
GCCEXE = $(shell where gcc.exe 2> NUL) | ||
ifeq ($(GCCEXE),) | ||
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
else | ||
build_tags += ledger | ||
endif | ||
else | ||
UNAME_S = $(shell uname -s) | ||
ifeq ($(UNAME_S),OpenBSD) | ||
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988)) | ||
else | ||
GCC = $(shell command -v gcc 2> /dev/null) | ||
ifeq ($(GCC),) | ||
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false) | ||
else | ||
build_tags += ledger | ||
endif | ||
endif | ||
endif | ||
endif | ||
|
||
ifeq (secp,$(findstring secp,$(COSMOS_BUILD_OPTIONS))) | ||
build_tags += libsecp256k1_sdk | ||
endif | ||
|
||
whitespace := | ||
whitespace += $(whitespace) | ||
comma := , | ||
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags)) | ||
|
||
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=seda-chain \ | ||
-X github.com/cosmos/cosmos-sdk/version.AppName=seda-chaind \ | ||
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \ | ||
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \ | ||
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \ | ||
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TMVERSION) | ||
|
||
ifeq ($(ENABLE_ROCKSDB),true) | ||
BUILD_TAGS += rocksdb | ||
test_tags += rocksdb | ||
endif | ||
|
||
# DB backend selection | ||
ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS))) | ||
build_tags += gcc | ||
endif | ||
ifeq (badgerdb,$(findstring badgerdb,$(COSMOS_BUILD_OPTIONS))) | ||
BUILD_TAGS += badgerdb | ||
endif | ||
# handle rocksdb | ||
ifeq (rocksdb,$(findstring rocksdb,$(COSMOS_BUILD_OPTIONS))) | ||
ifneq ($(ENABLE_ROCKSDB),true) | ||
$(error Cannot use RocksDB backend unless ENABLE_ROCKSDB=true) | ||
endif | ||
CGO_ENABLED=1 | ||
endif | ||
Comment on lines
+126
to
+135
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need these DB checks? |
||
|
||
ifeq ($(LINK_STATICALLY),true) | ||
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" | ||
endif | ||
|
||
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) | ||
ldflags += -w -s | ||
endif | ||
ldflags += $(LDFLAGS) | ||
ldflags := $(strip $(ldflags)) | ||
|
||
build_tags += $(BUILD_TAGS) | ||
build_tags := $(strip $(build_tags)) | ||
|
||
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)' | ||
# check for nostrip option | ||
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) | ||
BUILD_FLAGS += -trimpath | ||
endif | ||
|
||
# Check for debug option | ||
ifeq (debug,$(findstring debug,$(COSMOS_BUILD_OPTIONS))) | ||
BUILD_FLAGS += -gcflags "all=-N -l" | ||
endif | ||
|
||
all: tools build lint test | ||
|
||
echo-build-tags: | ||
echo ${BUILD_TAGS} | ||
|
||
BUILD_TARGETS := build install | ||
|
||
build: BUILD_ARGS=-o $(BUILDDIR)/ | ||
build-linux: | ||
@if [ "${ENABLE_ROCKSDB}" != "true" ]; then \ | ||
echo "RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true"; fi | ||
GOOS=linux GOARCH=$(if $(findstring aarch64,$(shell uname -m)) || $(findstring arm64,$(shell uname -m)),arm64,amd64) LEDGER_ENABLED=false $(MAKE) build | ||
|
||
$(BUILD_TARGETS): go.sum $(BUILDDIR)/ | ||
@if [ "${ENABLE_ROCKSDB}" != "true" ]; then \ | ||
echo "RocksDB support is disabled; to build and test with RocksDB support, set ENABLE_ROCKSDB=true"; fi | ||
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./... | ||
Comment on lines
+168
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it'd be better if |
||
|
||
$(BUILDDIR)/: | ||
mkdir -p $(BUILDDIR)/ | ||
|
||
build-experimental: go.sum | ||
@echo "--> Building Experimental version..." | ||
EXPERIMENTAL=true $(MAKE) build | ||
|
||
build-no_cgo: | ||
@echo "--> Building static binary with no CGO nor GLIBC dynamic linking..." | ||
ifneq ($(ENABLE_ROCKSDB),true) | ||
$(error RocksDB requires CGO) | ||
endif | ||
CGO_ENABLED=0 CGO_LDFLAGS="-static" $(MAKE) build | ||
|
||
|
||
go-mod-tidy: | ||
@contrib/scripts/go-mod-tidy-all.sh | ||
|
||
build-linux: go.sum | ||
LEDGER_ENABLED=false GOOS=linux CGO_ENABLED=1 go build -mod=readonly $(BUILD_FLAGS) -o build/seda-chaind-linux ./cmd/seda-chaind | ||
clean: | ||
@echo "--> Cleaning..." | ||
@rm -rf $(BUILD_DIR)/** $(DIST_DIR)/** | ||
|
||
install: go.sum | ||
CGO_ENABLED=1 go install -mod=readonly $(BUILD_FLAGS) ./cmd/seda-chaind | ||
.PHONY: build build-linux build-experimental build-no_cgo clean go-mod-tidy | ||
|
||
.PHONY: build install | ||
|
||
############################################################################### | ||
### Tools & Dependencies ### | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have this already, no?