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

v1.3.1 and docker #933

Merged
merged 30 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7da6228
Fixed up the mainnet docker image - now downloads the current binarie…
Cashmaney May 10, 2022
f2e5bad
Merge remote-tracking branch 'enigmampc/mainnet-build-fix'
Cashmaney May 10, 2022
6dceaf9
Builds properly now
Cashmaney May 10, 2022
c8d46c8
Try to make swagger work
assafmo May 22, 2022
5d58053
Docker image works. Added releasing mainnet docker image to CI as well
Cashmaney May 24, 2022
e7e62ab
Merge remote-tracking branch 'enigmampc/master' into mainnet-docker-i…
Cashmaney May 24, 2022
0dc803d
Cosmos-sdk checktx patch
Cashmaney May 24, 2022
e20d9db
Some progress with updating swagger to v1.3
assafmo May 24, 2022
4b8f1eb
go.mod: fix apperant version of cosmos-sdk
assafmo May 24, 2022
7bc0839
release.yaml: Revert a stupid regression
assafmo May 24, 2022
cbb776e
wat
assafmo May 24, 2022
470be1a
Fix CI?
assafmo May 24, 2022
90c12d0
fix build-release
Cashmaney May 24, 2022
55ddb3e
Try to fix release.yaml
assafmo May 25, 2022
dd0d07e
v1.3.1 changelog
assafmo May 25, 2022
3818c08
v1.3.1 changelog
assafmo May 25, 2022
4e07a93
Update $LCD/swagger to v1.3 and add $LCD/openapi
assafmo May 25, 2022
6a1e3b5
Merge branch 'v1.3.1-and-docker' into fix-swagger-for-v1.3
assafmo May 25, 2022
2122947
Merge pull request #934 from scrtlabs/fix-swagger-for-v1.3
assafmo May 25, 2022
bfb4890
`${LCD_URL}/{swagger,openapi}/` for v1.3 now work :tada:
assafmo May 25, 2022
eca0d9b
Update v1.3.1 changelog
assafmo May 25, 2022
c5514ec
Conditional pushing of docker image just for goleveldb (for now)
Cashmaney May 25, 2022
d1bd756
Merge remote-tracking branch 'enigmampc/v1.3.1-and-docker' into mainn…
Cashmaney May 25, 2022
e8e84f6
Swagger: don't show beta version number
assafmo May 25, 2022
907c6b1
Add libsnappy1v5 as .deb package dependency
assafmo May 25, 2022
b28248a
Testnet doesn't compile with production flag
Cashmaney May 25, 2022
fa1d518
Update CHANGELOG.md
assafmo May 25, 2022
d40b85a
CHANGELOG
assafmo May 25, 2022
b42a18b
Changelog
assafmo May 25, 2022
cb98d70
v1.3.1 changelog
assafmo May 26, 2022
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
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