-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
228 additions
and
7 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM cgr.dev/chainguard/wolfi-base:latest@sha256:a9547b680d3d322b14c2e46963b04d7afe71d927a3fa701a839559041989debe | ||
|
||
ARG BINARY | ||
|
||
WORKDIR /app | ||
|
||
USER root | ||
|
||
COPY ./$BINARY /app/node | ||
|
||
# trunk-ignore(hadolint/DL3018) | ||
RUN apk update && \ | ||
apk add --no-cache \ | ||
bash \ | ||
libstdc++ \ | ||
jq \ | ||
tini \ | ||
wget \ | ||
&& \ | ||
mkdir -p /config && \ | ||
chown -R nonroot:nonroot /app /config && \ | ||
chmod -R u=rwX,go=rX /app /config && \ | ||
chmod +x /app/node | ||
|
||
# trunk-ignore(checkov/CKV_DOCKER_4) | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.0-rc.2/libwasmvm.aarch64.so /usr/lib/libwasmvm.aarch64.so | ||
# trunk-ignore(checkov/CKV_DOCKER_4) | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.0-rc.2/libwasmvm.x86_64.so /usr/lib/libwasmvm.x86_64.so | ||
|
||
USER nonroot | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
|
||
# API Server | ||
EXPOSE 1317 | ||
|
||
# Pprof Server | ||
EXPOSE 6060 | ||
|
||
# gRPC Server | ||
EXPOSE 9090 | ||
|
||
# CometBFT RPC interface | ||
EXPOSE 26657 | ||
|
||
HEALTHCHECK --interval=1m --timeout=3s CMD /app/node query node status | grep validator_hash || exit 1 | ||
|
||
VOLUME ["/config"] | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD ["/entrypoint.sh"] |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
set -x | ||
|
||
if [[ ${GOARCH} == "arm64" ]]; then | ||
export CC=aarch64-linux-gnu-gcc | ||
export CGO_ENABLED=1 | ||
export GOOS=linux | ||
fi | ||
|
||
# Install CORSS tools | ||
sudo apt install gcc-aarch64-linux-gnu | ||
|
||
# Import go modules | ||
cd "${MATRIX_APP_REPOSITORY}/${MATRIX_APP_PATH}" | ||
go mod tidy | ||
|
||
# See https://github.com/CosmWasm/wasmvm/releases | ||
sudo wget --output-document /lib/libwasmvm.x86_64.so https://github.com/CosmWasm/wasmvm/releases/download/v2.2.0-rc.2/libwasmvm.x86_64.so | ||
sudo wget --output-document /lib/libwasmvm.aarch64.so https://github.com/CosmWasm/wasmvm/releases/download/v2.2.0-rc.2/libwasmvm.aarch64.so | ||
|
||
# Build application | ||
LEDGER_ENABLED=false make build |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process | ||
process: | ||
node: | ||
running: true | ||
|
||
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port | ||
port: | ||
# https://github.com/aelsabbahy/goss/issues/149 | ||
tcp:26657: | ||
listening: true |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -oue pipefail | ||
set -x | ||
|
||
BINARY_PATH="${BINARY_BUILD_OUTPUT_PATH}" | ||
|
||
# Set the timeout to 60 seconds | ||
TIMEOUT=60 | ||
START_TIME=$(date +%s) | ||
|
||
echo "Launch init procedure..." | ||
CONFIG_HOME=$(${BINARY_PATH} config home) | ||
${BINARY_PATH} config set client chain-id testchain | ||
${BINARY_PATH} config set client keyring-backend test | ||
sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.002token1"/' "${CONFIG_HOME}/config/app.toml" | ||
${BINARY_PATH} config set app api.enable true | ||
${BINARY_PATH} keys add alice | ||
${BINARY_PATH} keys add bob | ||
${BINARY_PATH} init testchain-node --chain-id testchain | ||
jq '.app_state.gov.params.voting_period = "600s"' "${CONFIG_HOME}/config/genesis.json" > temp.json && mv temp.json "${CONFIG_HOME}/config/genesis.json" | ||
jq '.app_state.gov.params.expedited_voting_period = "300s"' "${CONFIG_HOME}/config/genesis.json" > temp.json && mv temp.json "${CONFIG_HOME}/config/genesis.json" | ||
jq '.app_state.mint.minter.inflation = "0.300000000000000000"' "${CONFIG_HOME}/config/genesis.json" > temp.json && mv temp.json "${CONFIG_HOME}/config/genesis.json" # to change the inflation | ||
${BINARY_PATH} genesis add-genesis-account alice 5000000000stake --keyring-backend test | ||
${BINARY_PATH} genesis add-genesis-account bob 5000000000stake --keyring-backend test | ||
${BINARY_PATH} genesis gentx alice 1000000stake --chain-id testchain | ||
${BINARY_PATH} genesis collect-gentxs | ||
|
||
# trunk-ignore(shellcheck/SC2210) | ||
${BINARY_PATH} start > ./output.log 2>1 & | ||
APP_PID=$! | ||
|
||
|
||
while true; do | ||
CURRENT_TIME=$(date +%s) | ||
ELAPSED_TIME=$((CURRENT_TIME - START_TIME)) | ||
|
||
if [[ "${ELAPSED_TIME}" -ge "${TIMEOUT}" ]]; then | ||
echo "Timeout reached. Application did not produce the success pattern within 60 seconds." | ||
kill "${APP_PID}" | ||
cat ./output.log | ||
exit 1 | ||
fi | ||
|
||
# Check that 4th block is produced to validate the application | ||
if ${BINARY_PATH} query block-results 4; then | ||
echo "Block #4 has been committed. Application is working correctly." | ||
kill "${APP_PID}" | ||
exit 0 | ||
else | ||
echo "Block height is not greater than 4." | ||
fi | ||
|
||
sleep 3 | ||
done |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
set -x | ||
|
||
export LD_LIBRARY_PATH=/usr/lib64 | ||
export HOME="${NODE_HOME:-/config}" | ||
COSMOS_CHAIN_ID="${COSMOS_CHAIN_ID:-testchain}" | ||
COSMOS_MONIKER="${COSMOS_MONIKER:-testchain-node}" | ||
COSMOS_NODE_CMD=/app/node | ||
GENESIS_FILE="${HOME}/config/genesis.json" | ||
|
||
if [[ ! -f "${HOME}/config/config.toml" ]]; then | ||
echo "Launch init procedure..." | ||
|
||
# Configure client settings | ||
/app/node config set client chain-id "${COSMOS_CHAIN_ID}" --home "${HOME}" | ||
/app/node config set client keyring-backend test --home "${HOME}" | ||
sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.002token1"/' "${HOME}/config/app.toml" | ||
/app/node config set app api.enable true --home "${HOME}" | ||
|
||
# Add keys | ||
for user in validator faucet alice bob; do | ||
"${COSMOS_NODE_CMD}" keys add "${user}" --home "${HOME}" | ||
done | ||
|
||
# Initialize node | ||
"${COSMOS_NODE_CMD}" init "${COSMOS_MONIKER}" --chain-id "${COSMOS_CHAIN_ID}" --home "${HOME}" | ||
|
||
# Set governance and inflation parameters | ||
jq '.app_state.gov.params.voting_period = "600s" | | ||
.app_state.gov.params.expedited_voting_period = "300s" | | ||
.app_state.mint.minter.inflation = "0.300000000000000000"' \ | ||
"${GENESIS_FILE}" >temp.json && mv temp.json "${GENESIS_FILE}" | ||
|
||
# Add genesis accounts | ||
for account in validator faucet alice bob; do | ||
"${COSMOS_NODE_CMD}" genesis add-genesis-account "${account}" 5000000000stake --keyring-backend test --home "${HOME}" | ||
done | ||
"${COSMOS_NODE_CMD}" genesis gentx validator 1000000stake --chain-id "${COSMOS_CHAIN_ID}" --home "${HOME}" | ||
"${COSMOS_NODE_CMD}" genesis collect-gentxs --home "${HOME}" | ||
fi | ||
|
||
exec \ | ||
"${COSMOS_NODE_CMD}" start --home "${HOME}" \ | ||
"$@" |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
app: wasmd | ||
repository: CosmWasm/wasmd | ||
path: ./ | ||
fetch_full_history: true | ||
publish_artifacts: true | ||
binary_build_output_path: build/wasmd | ||
channels: | ||
- name: v0.52.x | ||
branch: upgrade_sdk_0.52 | ||
platforms: [linux/amd64,linux/arm64] | ||
container_tag_name: "0.52" | ||
update_modules: | ||
enabled: false | ||
cosmossdk_branch: refs/heads/release/v0.52.x | ||
tests_enabled: true | ||
- name: v0.52.x-mods | ||
branch: upgrade_sdk_0.52 | ||
platforms: [linux/amd64,linux/arm64] | ||
container_tag_name: 0.52-mods | ||
update_modules: | ||
enabled: true | ||
cosmossdk_branch: refs/heads/release/v0.52.x | ||
tests_enabled: true |
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