Skip to content

Commit

Permalink
Merge pull request #933 from scrtlabs/v1.3.1-and-docker
Browse files Browse the repository at this point in the history
v1.3.1 and docker
  • Loading branch information
assafmo authored May 26, 2022
2 parents 33df01f + cb98d70 commit 39d51c8
Show file tree
Hide file tree
Showing 30 changed files with 89,414 additions and 22,654 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
fail-fast: false
matrix:
db_backend: [rocksdb, goleveldb]
node_type: [query]
runs-on: ubuntu-latest
env: # Or as an environment variable
SPID_TESTNET: ${{ secrets.SPID_TESTNET }}
Expand Down Expand Up @@ -73,7 +72,7 @@ jobs:
- name: Build testnet
run: |
source "$HOME/.sgxsdk/sgxsdk/environment"
VERSION=${{ steps.get_version.outputs.VERSION }} DB_BACKEND=${{ matrix.db_backend }} FEATURES_U=$(echo ${{ matrix.node_type }} | awk '/query/{printf "query-node,"} /validator/{printf ""}') make build-testnet
VERSION=${{ steps.get_version.outputs.VERSION }} DB_BACKEND=${{ matrix.db_backend }} FEATURES_U=query-node, make build-testnet
cp build/secretnetwork_${{ steps.get_version.outputs.VERSION }}_amd64.deb secretnetwork_${{ steps.get_version.outputs.VERSION }}_testnet_${{ matrix.db_backend }}_amd64.deb
- uses: actions/upload-artifact@v2
with:
Expand All @@ -86,10 +85,11 @@ jobs:
fail-fast: false
matrix:
db_backend: [goleveldb, rocksdb]
node_type: [query]
env: # Or as an environment variable
SPID_MAINNET: ${{ secrets.SPID_MAINNET }}
API_KEY_MAINNET: ${{ secrets.API_KEY_MAINNET }}
REGISTRY: ghcr.io
IMAGE_NAME: scrtlabs/secret-network-node
steps:
- uses: actions/checkout@v3
- name: Get the version
Expand All @@ -104,12 +104,22 @@ jobs:
echo $API_KEY_MAINNET > api_key.txt
- name: Build
run: |
VERSION=${{ steps.get_version.outputs.VERSION }} DB_BACKEND=${{ matrix.db_backend }} FEATURES=production make build-mainnet-upgrade
VERSION=${{ steps.get_version.outputs.VERSION }} DB_BACKEND=${{ matrix.db_backend }} FEATURES=production FEATURES_U=query-node, make build-mainnet-upgrade
cp build/secretnetwork_${{ steps.get_version.outputs.VERSION }}_amd64.deb secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_${{ matrix.db_backend }}_amd64.deb
- uses: actions/upload-artifact@v2
with:
name: secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_${{ matrix.db_backend }}_amd64.deb
path: secretnetwork_${{ steps.get_version.outputs.VERSION }}_mainnet_${{ matrix.db_backend }}_amd64.deb
- name: Log in to the Container registry
if: ${{ matrix.db_backend == 'goleveldb' }}
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push docker image
if: ${{ matrix.db_backend == 'goleveldb' }}
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}

native-build-cli:
runs-on: ${{matrix.os}}
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# 1.3.1

- Updated `/swagger` endpoint in the LCD REST server
- Use all available cores to serve queries.
- Mainnet docker image with automatic node registration & state sync ([docs](https://docs.scrt.network/node-guides/full-node-docker.html)).
- Mempool optimizations (Thanks @ValarDragon!). For more info see [this](https://github.com/scrtlabs/cosmos-sdk/pull/141#issuecomment-1136767411).
- Fix missing `libsnappy1v5` dependency for rocksdb deb package.
- Updated `${LCD_URL}/swagger/` for v1.3 and added `${LCD_URL}/openapi/`.

# 1.3.0

Expand Down
64 changes: 9 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,24 +200,6 @@ deb-no-compile:
dpkg-deb --build /tmp/SecretNetwork/deb/ .
-rm -rf /tmp/SecretNetwork

rename_for_release:
-rename "s/windows-4.0-amd64/v${VERSION}-win64/" *.exe
-rename "s/darwin-10.6-amd64/v${VERSION}-osx64/" *darwin*

sign_for_release: rename_for_release
sha256sum enigma-blockchain*.deb > SHA256SUMS
-sha256sum secretd-* secretcli-* >> SHA256SUMS
gpg -u 91831DE812C6415123AFAA7B420BF1CB005FBCE6 --digest-algo sha256 --clearsign --yes SHA256SUMS
rm -f SHA256SUMS

release: sign_for_release
rm -rf ./release/
mkdir -p ./release/
cp enigma-blockchain_*.deb ./release/
cp secretcli-* ./release/
cp secretd-* ./release/
cp SHA256SUMS.asc ./release/

clean:
-rm -rf /tmp/SecretNetwork
-rm -f ./secretcli*
Expand Down Expand Up @@ -260,11 +242,10 @@ build-testnet: docker_base

build-mainnet-upgrade: docker_base
@mkdir build 2>&3 || true
docker build --build-arg BUILD_VERSION=${VERSION} -f deployment/dockerfiles/mainnet-upgrade-release.Dockerfile -t build-release .
docker build --build-arg BUILD_VERSION=${VERSION} -f deployment/dockerfiles/mainnet-upgrade-release.Dockerfile -t build-release:latest .
docker build --build-arg BUILD_VERSION=${VERSION} --build-arg SGX_MODE=HW -f deployment/dockerfiles/build-deb-mainnet.Dockerfile -t deb_build .
docker run -e VERSION=${VERSION} -v $(CUR_DIR)/build:/build deb_build
docker tag build-release ghcr.io/scrtlabs/secret-network-node-mainnet:$(VERSION)

docker tag build-release ghcr.io/scrtlabs/secret-network-node:$(VERSION)

build-mainnet: docker_base
@mkdir build 2>&3 || true
Expand Down Expand Up @@ -445,21 +426,6 @@ bin-data-production:
secret-contract-optimizer:
sudo docker buildx build --platform=linux/amd64,linux/arm64/v8 -f deployment/dockerfiles/secret-contract-optimizer.Dockerfile -t enigmampc/secret-contract-optimizer:${TAG} --push .

secretjs-build:
cd cosmwasm-js/packages/sdk && yarn && yarn build

# Before running this, first make sure:
# 1. To `npm login` with enigma-dev
# 2. The new version is updated in `cosmwasm-js/packages/sdk/package.json`
secretjs-publish-npm: secretjs-build
cd cosmwasm-js/packages/sdk && npm publish

# Before running this, first make sure:
# 1. To `npm login` with enigma-dev
# 2. The new version is updated in `cosmwasm-js/packages/sdk/package.json`
secretjs-publish-beta-npm: secretjs-build
cd cosmwasm-js/packages/sdk && npm publish --tag beta

aesm-image:
docker build -f deployment/dockerfiles/aesm.Dockerfile -t enigmampc/aesm .

Expand All @@ -476,17 +442,16 @@ statik:
@echo "Installing statik..."
@go install github.com/rakyll/[email protected]


update-swagger-docs: statik
statik -src=client/docs/static/swagger/ -dest=client/docs -f -m
update-swagger-openapi-docs: statik proto-swagger-openapi-gen
statik -src=client/docs/static/ -dest=client/docs -f -m
@if [ -n "$(git status --porcelain)" ]; then \
echo "\033[91mSwagger docs are out of sync!!!\033[0m";\
exit 1;\
else \
echo "\033[92mSwagger docs are in sync\033[0m";\
fi

.PHONY: update-swagger-docs statik
.PHONY: update-swagger-openapi-docs statik

###############################################################################
### Protobuf ###
Expand All @@ -505,27 +470,16 @@ update-swagger-docs: statik

protoVer=v0.7

proto-all: proto-format proto-lint proto-gen proto-swagger-gen
proto-all: proto-format proto-lint proto-gen proto-swagger-openapi-gen

proto-gen:
@echo "Generating Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace tendermintdev/sdk-proto-gen:$(protoVer) sh ./scripts/protocgen.sh

# This one doesn't work and i can't find the right docker repo
proto-format:
@echo "Formatting Protobuf files"
$(DOCKER) run --rm -v $(CURDIR):/workspace \
--workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \;

proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
proto-swagger-openapi-gen:
@./scripts/protoc-swagger-openapi-gen.sh

proto-lint:
@$(DOCKER_BUF) lint --error-format=json

## TODO - change branch release/v0.5.x to master after columbus-5 merged
proto-check-breaking:
@$(DOCKER_BUF) breaking --against-input $(HTTPS_GIT)#branch=release/v0.43-stargate

.PHONY: proto-all proto-gen proto-swagger-gen proto-format proto-lint proto-check-breaking
.PHONY: proto-all proto-gen proto-swagger-openapi-gen proto-format proto-lint proto-check-breaking
8 changes: 4 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,10 +724,10 @@ func RegisterSwaggerAPI(_ client.Context, rtr *mux.Router) {
panic(err)
}

staticServer := http.FileServer(statikFS)
rtr.PathPrefix("/static/").Handler(http.StripPrefix("/static/", staticServer))
rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
// rtr.PathPrefix("/swagger/").Handler(staticServer)
statikServer := http.FileServer(statikFS)
rtr.PathPrefix("/static/").Handler(http.StripPrefix("/static/", statikServer))
rtr.PathPrefix("/swagger/").Handler(statikServer)
rtr.PathPrefix("/openapi/").Handler(statikServer)
}

// BlockedAddrs returns all the app's module account addresses that are not
Expand Down
Loading

0 comments on commit 39d51c8

Please sign in to comment.