From 043933d265c509ced230e5fd464cb81c8780a7df Mon Sep 17 00:00:00 2001 From: n0cte Date: Wed, 27 Sep 2023 15:14:32 +0400 Subject: [PATCH 1/2] add build option for avalanche --- chains.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/chains.yaml b/chains.yaml index 5547adc..cbf8bd6 100644 --- a/chains.yaml +++ b/chains.yaml @@ -155,7 +155,12 @@ github-organization: ava-labs github-repo: avalanchego dockerfile: avalanche - build-target: + build-target: | + startTime="$(sed -n 's|.*"startTime":\([^"]*\),.*|\1|p' genesis/genesis_local.json)" + if [ "$(date +%s)" -gt $startTime ]; then + sed "s/$startTime/1690862400/g" genesis/genesis_local.json > genesis/genesis_local_tmp.json + mv genesis/genesis_local_tmp.json genesis/genesis_local.json + fi bash scripts/build.sh binaries: - build/avalanchego @@ -314,7 +319,7 @@ COMMIT=$(git log -1 --format='%H') LDFLAGS="$LDFLAGS -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app -X github.com/cosmos/cosmos-sdk/version.AppName=celestia-appd -X github.com/cosmos/cosmos-sdk/version.Version=$VERSION -X github.com/cosmos/cosmos-sdk/version.Commit=$COMMIT" go install -ldflags="$LDFLAGS" ./cmd/celestia-appd - binaries: + binaries: - /go/bin/celestia-appd # Celestia Node @@ -326,7 +331,7 @@ versioningPath="github.com/celestiaorg/celestia-node/nodebuilder/node" LDFLAGS="$LDFLAGS -X '${versioningPath}.buildTime=$(date)' -X '${versioningPath}.lastCommit=$(git rev-parse HEAD)' -X '${versioningPath}.semanticVersion=$(git describe --tags --dirty=-dev 2>/dev/null || git rev-parse --abbrev-ref HEAD)'" go install -ldflags="$LDFLAGS" ./cmd/celestia - binaries: + binaries: - /go/bin/celestia # Cerberus @@ -1193,7 +1198,7 @@ build-target: | BUILD_TAGS=netgo,muslc LD_FLAGS="-s -w -X github.com/cosmos/cosmos-sdk/version.Name=wormchain -X github.com/cosmos/cosmos-sdk/version.Version=$(echo $(git describe --tags) | sed 's/^v//') -X github.com/cosmos/cosmos-sdk/version.Commit=$(git log -1 --format='%H') -X github.com/cosmos/cosmos-sdk/version.BuildTags=\"${BUILD_TAGS}\" -X github.com/cosmos/cosmos-sdk/version.ServerName=wormchaind" - go build -mod=readonly -tags="${BUILD_TAGS}" -ldflags="$LDFLAGS ${LD_FLAGS}" -o build/wormchaind cmd/wormchaind/main.go + go build -mod=readonly -tags="${BUILD_TAGS}" -ldflags="$LDFLAGS ${LD_FLAGS}" -o build/wormchaind cmd/wormchaind/main.go build-dir: wormchain binaries: - wormchain/build/wormchaind From 03eb1eff1448623c8a17c232de8b539895486653 Mon Sep 17 00:00:00 2001 From: n0cte Date: Fri, 27 Oct 2023 15:05:12 +0400 Subject: [PATCH 2/2] fix startTime modification --- chains.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/chains.yaml b/chains.yaml index cbf8bd6..d67b450 100644 --- a/chains.yaml +++ b/chains.yaml @@ -155,13 +155,14 @@ github-organization: ava-labs github-repo: avalanchego dockerfile: avalanche - build-target: | + pre-build: | startTime="$(sed -n 's|.*"startTime":\([^"]*\),.*|\1|p' genesis/genesis_local.json)" - if [ "$(date +%s)" -gt $startTime ]; then - sed "s/$startTime/1690862400/g" genesis/genesis_local.json > genesis/genesis_local_tmp.json + nowTime="$(date +%s)" + if [ $nowTime -gt $startTime ]; then + sed "s/$startTime/$nowTime/g" genesis/genesis_local.json > genesis/genesis_local_tmp.json mv genesis/genesis_local_tmp.json genesis/genesis_local.json fi - bash scripts/build.sh + build-target: bash scripts/build.sh binaries: - build/avalanchego