github.com/cryptohub-digital/blockbook-fork@v0.0.0-20230713133354-673c927af7f1/build/docker/bin/Makefile (about)

     1  SHELL = /bin/bash
     2  VERSION ?= devel
     3  GITCOMMIT = $(shell cd /src && git config --global --add safe.directory /src && git describe --always --dirty)
     4  BUILDTIME = $(shell date --iso-8601=seconds)
     5  LDFLAGS := -X github.com/trezor/blockbook/common.version=$(VERSION) -X github.com/trezor/blockbook/common.gitcommit=$(GITCOMMIT) -X github.com/trezor/blockbook/common.buildtime=$(BUILDTIME)
     6  BLOCKBOOK_BASE := $(GOPATH)/src/github.com/trezor
     7  BLOCKBOOK_SRC := $(BLOCKBOOK_BASE)/blockbook
     8  ARGS ?=
     9  
    10  all: build tools
    11  
    12  build: prepare-sources
    13  	cd $(BLOCKBOOK_SRC) && go build -o $(CURDIR)/blockbook -ldflags="-s -w $(LDFLAGS)" $(ARGS)
    14  	cp $(CURDIR)/blockbook /out/blockbook
    15  	chown $(PACKAGER) /out/blockbook
    16  
    17  build-debug: prepare-sources
    18  	cd $(BLOCKBOOK_SRC) && go build -o $(CURDIR)/blockbook -ldflags="$(LDFLAGS)" $(ARGS)
    19  	cp $(CURDIR)/blockbook /out/blockbook
    20  	chown $(PACKAGER) /out/blockbook
    21  
    22  tools:
    23  	cp $(CURDIR)/{ldb,sst_dump} /out
    24  	chown $(PACKAGER) /out/{ldb,sst_dump}
    25  
    26  test: prepare-sources
    27  	cd $(BLOCKBOOK_SRC) && go test -tags 'unittest' `go list ./... | grep -vP '^github.com/trezor/blockbook/(contrib|tests)'` $(ARGS)
    28  
    29  test-integration: prepare-sources
    30  	cd $(BLOCKBOOK_SRC) && go test -tags 'integration' `go list github.com/trezor/blockbook/tests/...` $(ARGS)
    31  
    32  test-all: prepare-sources
    33  	cd $(BLOCKBOOK_SRC) && go test -tags 'unittest integration' `go list ./... | grep -v '^github.com/trezor/blockbook/contrib'` $(ARGS)
    34  
    35  prepare-sources:
    36  	@ [ -n "`ls /src 2> /dev/null`" ] || (echo "/src doesn't exist or is empty" 1>&2 && exit 1)
    37  	rm -rf $(BLOCKBOOK_SRC)
    38  	mkdir -p $(BLOCKBOOK_BASE)
    39  	cp -r /src $(BLOCKBOOK_SRC)
    40  	cd $(BLOCKBOOK_SRC) && go mod download
    41  	sed -i 's/wsMessageSizeLimit\ =\ 15\ \*\ 1024\ \*\ 1024/wsMessageSizeLimit = 80 * 1024 * 1024/g' $(GOPATH)/pkg/mod/github.com/ethereum/go-ethereum*/rpc/websocket.go
    42  	sed -i 's/wsMessageSizeLimit\ =\ 15\ \*\ 1024\ \*\ 1024/wsMessageSizeLimit = 80 * 1024 * 1024/g' $(GOPATH)/pkg/mod/github.com/ava-labs/coreth*/rpc/websocket.go