Skip to content

Commit

Permalink
feat: add artifact config
Browse files Browse the repository at this point in the history
  • Loading branch information
hacheigriega authored and DeshErBojhaa committed May 9, 2024
1 parent 11f9295 commit 18d02c7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
6 changes: 6 additions & 0 deletions scripts/testnet/config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ WASMVM_VERSION=v1.5.2
WASM_PERMISSION_EVERYONE=true # true for everyone and false for mainnet configuration
SHORT_VOTING_PERIOD=true # true for 180s voting period or false for mainnet configuration

# If DOWNLOAD_FROM_RELEASE is set to false, specify RUN_NO and ARTIFACT_NO so the script
# can download the artifact.
DOWNLOAD_FROM_RELEASE=false
RUN_NO=0123
ARTIFACT_NO=0123

LOCAL_BIN=$(git rev-parse --show-toplevel)/build/sedad # chain binary executable on your machine
HOME_DIR=$HOME/.sedad # chain directory
HOME_CONFIG_DIR=$HOME_DIR/config # chain config directory
Expand Down
44 changes: 20 additions & 24 deletions scripts/testnet/upload_and_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,26 @@ if [ ! -f "$LOCAL_BIN" ]; then
exit 1
fi

# Download chain binaries

# From release:
# curl -LO https://github.com/sedaprotocol/seda-chain/releases/download/$CHAIN_VERSION/sedad-amd64
# curl -LO https://github.com/sedaprotocol/seda-chain/releases/download/$CHAIN_VERSION/sedad-arm64

# From artifact:
RUN_NO=8941156340
ARTIFACT_NO=1471046522

set +x
url=$(curl -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/sedaprotocol/seda-chain/actions/runs/$RUN_NO/artifacts | \
jq -r '.artifacts[] | select(.id=='"$ARTIFACT_NO"') | .archive_download_url')
curl -L -o artifact.zip \
-H "Authorization: token $GITHUB_TOKEN" \
$url
set -x

unzip artifact.zip

mv sedad-amd64 $NODE_DIR
mv sedad-arm64 $NODE_DIR
if [ "$DOWNLOAD_FROM_RELEASE" = "true" ]; then
# Download chain binaries from releases
curl -LO https://github.com/sedaprotocol/seda-chain/releases/download/$CHAIN_VERSION/sedad-amd64
curl -LO https://github.com/sedaprotocol/seda-chain/releases/download/$CHAIN_VERSION/sedad-arm64
else
# Download chain binaries from artifacts
set +x
url=$(curl -H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/sedaprotocol/seda-chain/actions/runs/$RUN_NO/artifacts | \
jq -r '.artifacts[] | select(.id=='"$ARTIFACT_NO"') | .archive_download_url')
curl -L -o artifact.zip \
-H "Authorization: token $GITHUB_TOKEN" \
$url
set -x

unzip artifact.zip
mv sedad-amd64 $NODE_DIR
mv sedad-arm64 $NODE_DIR
fi


################################################
Expand Down

0 comments on commit 18d02c7

Please sign in to comment.